Directory browsing and listing commands

Directory listing commands

01. See a current location (print work directory)
[root@daddylinux~]# pwd

02. List content in the folder
[root@daddylinux~]# ls
[root@daddylinux~]# tree

03. List all content in the folder (Hidden file)
[root@daddylinux~]# ls -a
[root@daddylinux~]# tree -a
Object Color Codes

White Color – Text base files (Htmal , Java, etc….)
Dark Blue – Folders
Green – Executable binary files and executable text file (Scripts) or any files copied from windows to Linux.
Red – Compressed files (gzip, etc….)
Purple – Multimedia files (Mp3, Pictures)
Orange – Device Driver File
Light blue color – Symlinks (Short Cuts)

04. See a long list
[root@daddylinux~]# ls -l

05. Long list with a hidden file
[root@daddylinux~]# ls -la

06. Long list, with color, and hidden files and fit to screen
[root@daddylinux~]# ls --color -la |more

Directory browsing commands

To go to sub folders

Use the relative path of the folder
Don’t type the current location that you are in

Ex - # cd test
[root@daddylinux~]# cd uddika

To go to main folders

Use full path
Always start with /

Ex - [root@daddylinux~]# cd /etc
        [root@daddylinux~]# cd /usr/share

07. One folder back
[root@daddylinux~]# cd ..

08. To your home folder
[root@daddylinux~]# cd

09. To previous location
[root@daddylinux~]# cd -

10. To root partitions
[root@daddylinux~]# cd /

2 comments:

Post a Comment