To list all folders on the root directory, type:
ls -d /*
Sample Output:
/bin /dev /smsbackup
/lost+found /mnt /proc
/selinux /tmp
/boot /etc /lib
/media /net /root
/srv /usr
/cgroup /home /lib64
/misc /opt /sbin
/sys /var
To list all folders on the current folder, one level depth
only; type:
[xxx@mx var]$ ls -d */
Sample Output:
account/ cvs/ games/
local/ lost+found/ opt/
spool/ yp/
cache/ db/ gdm/
lock/ sms/ preserve/ tmp/
crash/ empty/ lib/
log/ nis/ run/ www/
List all folders and sub folders, 2 level depth or 2 level hierarchy;
type:
[xxx@mx var]$ ls -d */*/
Sample Output:
cache/abrt-di/
lib/misc/
log/ConsoleKit/
run/portreserve/
cache/cups/
lib/mlocate/ log/cups/ run/rhsm/
cache/fontconfig/
lib/net-snmp/ log/sms/ run/saslauthd/
cache/foomatic/
lib/nfs/ log/gdm/ run/sepermit/
cache/gdm/
lib/ntp/ log/httpd/ run/setrans/
cache/hald/
lib/PackageKit/
log/ntpstats/
run/spice-vdagentd/
cache/krb5rcache/
lib/plymouth/ log/prelink/ run/udisks/
cache/ldconfig/
lib/polkit-1/
log/RealSSDManager/ run/winbindd/
List all folders recursively and no depth level define, this
output will be very huge depending on the number of folders on the path specified.
It's better to redirect the output to a text file, so the
file can be searched or can be printed out.
But I think just do this when the server or machine is not
fully in use or less utilization of the server.
To list all folders, recursively type:
ls -R | grep
"./" | more
That's it, hope it helps..till next time..have fun.
================================
Free Android Apps:
Click on links below to find out more:
Excel Keyboard shortcuts guide
Linux Android App cheat sheet:
Multiplication Table for early learners
https://play.google.com/store/apps/details?id=com.TableMultiplication
Catholic Rosary Guide for Android:
Divine Mercy Chaplet Guide (A Powerful prayer):
Comments
Post a Comment