Ls: Difference between revisions
From Hackepedia
Jump to navigationJump to search
m add jpg |
m fix devices->device |
||
Line 1: | Line 1: | ||
[[Image:permission.jpg]] | [[Image:permission.jpg]] | ||
<code>ls</code> is the basic "LiSt me the contents in the [[filesystem]]" command used in a unix [[shell]]. It operates on the current directory by default, and displays a list of all [[files]], [[directories]], named pipes ([[FIFO]]), [[socket]]s, [[symlinks]], and [[devices]]. | <code>ls</code> is the basic "LiSt me the contents in the [[filesystem]]" command used in a unix [[shell]]. It operates on the current directory by default, and displays a list of all [[file|files]], [[directory|directories]], named pipes ([[FIFO]]), [[socket]]s, [[symlinks]], and [[device|devices]]. | ||
There are many, many options to <code>ls</code>, and they can vary greatly from system to system. Check the local [[manual]] pages for details on each argument. You want to install gnuls if you want ls with colour. | There are many, many options to <code>ls</code>, and they can vary greatly from system to system. Check the local [[manual]] pages for details on each argument. You want to install gnuls if you want ls with colour. |
Revision as of 02:09, 24 May 2008
ls
is the basic "LiSt me the contents in the filesystem" command used in a unix shell. It operates on the current directory by default, and displays a list of all files, directories, named pipes (FIFO), sockets, symlinks, and devices.
There are many, many options to ls
, and they can vary greatly from system to system. Check the local manual pages for details on each argument. You want to install gnuls if you want ls with colour.
$ ls -lart
is a popular usage with arguments. A long listing which shows .files, reversed by time. You can alternatively shell:alias this if you use it a lot.
$ ls -laSr
here we replace the t with file Size, and it will also list the largest files in reverse order, with the largest last.