Difference between revisions of "Ls"
(Init from PHPWiki) |
(Added link to redirection page.) |
||
Line 14: | Line 14: | ||
[[ls]] > myfiles.txt | [[ls]] > myfiles.txt | ||
− | This is one of the most useful [[ls]] commands. It allows you to redirect [[ls]]'s output to a file with the name of your choice. The data in the file can be manipulated with your favorite editor. [[ls]] puts each file or directory on a newline in the file. | + | This is one of the most useful [[ls]] commands. It allows you to redirect [[ls]]'s output to a file with the name of your choice. The data in the file can be manipulated with your favorite editor. [[ls]] puts each file or directory on a newline in the file. Please see [[redirection]] for more information. |
[[Category:Useful Linux Commands]] | [[Category:Useful Linux Commands]] |
Revision as of 08:11, 19 September 2005
ls The ls command is used to list files on linux based systems. GUI file managers are nice to use. However, ls can be used as a fast tool where a user does not have to click themselves to death.
ls -l
List files in a directory in long directory information format.
ls -lrt
List files in a directory in long directory information format; reverse order; sorted by time.
ls -lart
List files in a directory in long directory information format; a including hidden, ., dot files and directories; reverse order; sorted by time.
ls -l | egrep -i '^(d|l)'
The reason why you would want to venture into the command line world occurs when you start to pipe, |, the ls output into another command for customized list of files.
ls > myfiles.txt
This is one of the most useful ls commands. It allows you to redirect ls's output to a file with the name of your choice. The data in the file can be manipulated with your favorite editor. ls puts each file or directory on a newline in the file. Please see redirection for more information.