Take some time to learn some of the options available with this powerful utility that does more than just “list files”, including:
- -R = Recurse directories.
- -l = “Long” listing–show file sizes, timestamps and permissions.
- –color = Colorize output, or disable colors with ‘ls –color=never’.
- -a = All files–show everything, including “hidden” files (those beginning with a ‘.’ (period)).
- -A = Almost all files. Like -a but does not show ‘.’ or ‘..’ shortcuts (since they are always present).
- -S = sort output (see ‘ls –help’ for details on parameters for sorting, or use the individual “sort switches”, such as:
- -t = sort by timestamp
- -S = sort by size
- -v = sort by version
- -X = sort by file extension
Given all of that, can you guess what my favorite alias command for ls is? I’ll give you a hint: it’s one of these (from my ~/.bashrc file):
alias ll='ls -l -a --color' alias la='ls -A --color' alias l='ls -CF --color' alias l1='ls -1 -a --color=never'
Note: That last one is lowercase ‘L’ and the digit ‘1’ (one).
How do you use ls? Please share in the comments below. I will acknowledge all ideas you give me (and, in fact, by leaving a comment you can “seal it in stone”).
If you found this page useful or interesting, please stay tuned to the “Linux Tips” tag. We here at Section9 always appreciate any shares and/or links to our pages. Link to one of our pages on your site, then post a comment here with a link back to your page that you put the link on. In this way you can promote your website on Section9.space (and we encourage you to do so).
I would also appreciate reports of any errors, typos, mis-statements and anything else you care to nit-pick. 🙂 Leave me a comment here (preferred), or send a private message (PM) on any of the social media sites that you find me on. (Google+, Facebook, Section9.space, Twitter, Instagram, etc.) I try to always at least acknowledge all questions within 24 hours. If I don’t know the answer, I’ll either google it before replying, or at sometime after that, depending on how difficult I think a true answer will be to write.)
Thank you for your interest,