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.
I've been working with Linux now for half a year or so. I generally find its command line interface superior to DOS except for one command, the 'ls' command.
I'd like the equivalent of the dir command: 'dir /o:g' which lists directories first.
I've looked at the info and man pages, and I'm not sure how to get 'ls' to do that. If anyone knows please tell me.
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700
Rep:
If you like that command line you can make an alias so you don't have to remember it. Edit your home directory file .bashrc and add a line like this.
alias dir="ls -l | sort -k 1.1,1.2 -k 8.1 -f | less"
I hope theres no prob if i post a query of mine.
How can I use the command line to list all files of a particular extension recursively?
What I am trying to do is go to a particular directory and then search all the directories inside this directory for certain filetypes.
I tried ls -R *.mp3 or ls -R *.mp3 ./ but it doesnt work.
If I do ls|grep -R --include==*.mp3 ./ it returns a whole lot of garbage...I know grep searches even for the contents of the file, but just gave it a try.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.