Listing Files in the Current Directory with ls
ls command, like
ln, is one of those you expect to be very straightforward. It lists files, but how many options can it possibly have? In true Linux style, the answer is many, although again you need only know a few to wield great power!
The basic usage is simply
ls, which lists the files and directories in the current location. You can filter that using normal wildcards, so all these are valid:
matthew@seymour:~$ ls *matthew@seymour:~$ ls *.txtmatthew@seymour:~$ ls my*ls *.txt *.xml
Any directories that match these filters are recursed into one level. That is, if you run
ls my* and you have the files
myfile2.txt and a directory
mystuff, the matching files are printed first. Then ...