Listing the Essentials
ls: the ultimate command for when you're feeling list-less.
- -a: List all the files, including the ones in hidden directories.
- -A: Like -a, but with an attitude.
- -b: Don't bother with human-readable output, just show the bare essentials.
- -c: Show the file timestamps in a format that'll make you cry.
And don't forget, you can combine these options to get the most out of ls!
For more advanced ls-ing, check out 2. ls - Advanced
Examples
Example 1: ls -al
ls -al | grep 'example'
This will list all the files in the current directory that match the string 'example'.
Example 2: ls -c
ls -c | awk '{print strftime("%c", $1)}'
This will show the timestamps of all the files in the current directory in a format that'll make you cry.