In the command line world, you can use the ls
command to display all of the files in a directory and their properties at once.
Use ls without any options to get a plain list of files in the current directory. You can also
use all the standard wildcards to find particular files or types of files:
rich@testing:~> ls *.txt
README.txt license.txt printer.txt test.txt
info.txt notice.txt rpms.txt
rich@testing:~>
This produces a list of files with a .txt extension in the directory, but with no other
information about the files. The ls command offers many ways to display file information.
Here are some of the standard switches for ls:
File Management Commands 653
33
. -a??”Include hidden files
. -h??”Display file sizes in kilobytes (K) and megabytes (M)
. -l??”Displays the ???long??? listing, like the Details view of a GUI file manager
. -r??”Reverse order
. -R??”Recursively list directories
. -s??”Shows file and directory sizes
. ??”sort??”Sorts the listing
One of my favorite option combinations is -sail. Besides being easy to remember, it
provides a wealth of file information in a single command:
rich@testing:~> ls ??“sail
total 200
131485 8 drwxr-xr-x 22 rich users 4096 2006-12-18 15:13 .
Pages:
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234