Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 12.1, AND IM LOVIN EVERY MINUTE OF IT, JERRY! :D
Posts: 122
Rep:
TIP - happy with the 'ls' command output?
Ive always had a problem with the output of the 'ls' command when wanting to quickly view the sizes of files and sub-folders in a top-level folder, it never seemed quite right.
it seems to be better (for me at least) to use the 'du' (disk usage) command like this
ls -l covers pretty much 90% of my directory listing needs when I am not using display criteria and wild cards, like listing hidden files and directories (ls -l .*). I find this will give you the contents of hidden directories too. ls -dl will give you the just contents of the top directory listing of your criteria with no immediate subdirectory content listing.
Thanks for the tip. I took your duh and also made a duhs =
'du --human-readable --all --max-depth=1 | sort -k 2,2 '
Now the output is in order by filename (ascii or alphabetically).
However, the total is first instead of last.
i guess, the best one for the sorted human readable out of a directory contents in a clean way is
$ ls -rShl (its more simple, right? try this)
Nice, I liked this.
Added to my list of ls aliases:
Code:
alias ls='ls -F --color=auto' # color the output, classify files
alias ll='ls -lh' # ls with long listing, human readable format
alias lsr='ll -rt' # ls with long listing, recently changed last
alias ls1='ls -1' # ls with each entry on its own line
alias lss='ll -rS' # ls with long listing, biggest files last
Oh, by the way.
If you'd like to use a regular ls, without using any of the aliases, just use:
Code:
\ls
The backslash makes the shell interpret your command literally.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.