RosettaCodeData/Task/Unix-ls/00-TASK.txt

34 lines
715 B
Plaintext

;Task:
Write a program that will list everything in the current folder,   similar to:
:::* &nbsp; the Unix utility &nbsp; “<tt>ls</tt>” &nbsp; [http://man7.org/linux/man-pages/man1/ls.1.html] &nbsp; &nbsp; &nbsp; or
:::* &nbsp; the Windows terminal command &nbsp; “<tt>DIR</tt>”
<br>
The output must be sorted, but printing extended details and producing multi-column output is not required.
;Example output
For the list of paths:
<pre>
/foo/bar
/foo/bar/1
/foo/bar/2
/foo/bar/a
/foo/bar/b
</pre>
When the program is executed in &nbsp; `/foo`, &nbsp; it should print:
<pre>
bar
</pre>
and when the program is executed in &nbsp; `/foo/bar`, &nbsp; it should print:
<pre>
1
2
a
b
</pre>
<br><br>