Listing only directories in Linux
Posted: 21 Jan 2015, 13:14
I use ncdu to list my folders or directories and others may have other methods.
The obvious and easiest way has never been mentioned here so I'll mention it
This will list all directories - but not the subdirectories. This can come in handy when you are in /etc.
One should never forget the (not so?) obvious.
To find all directories that end with UTF-8 you could do this:
To fins all directories that start with..say...modprobe ...you can do this:
In /etc that could be modprobe.d and modprobe.preload.d etc
The obvious and easiest way has never been mentioned here so I'll mention it
Code: Select all
ls -d */This will list all directories - but not the subdirectories. This can come in handy when you are in /etc.
One should never forget the (not so?) obvious.
To find all directories that end with UTF-8 you could do this:
Code: Select all
ls -d *UTF-8/To fins all directories that start with..say...modprobe ...you can do this:
Code: Select all
ls -d modprobe*/In /etc that could be modprobe.d and modprobe.preload.d etc