Friday 27 October 2017

ls_Commands

https://dbissues.blogspot.com/2017/10/1.html

1. List Files using ls with no option
# ls
----------------------------------------------------------------------------------
2 List Files With option –l
# ls -l
----------------------------------------------------------------------------------
3. View Hidden Files
# ls -a
----------------------------------------------------------------------------------
4. List Files with Human Readable Format with option -lh
# ls -lh
----------------------------------------------------------------------------------
5. List Files and Directories with ‘/’ Character at the end
# ls -F
----------------------------------------------------------------------------------
6. List Files in Reverse Order
# ls -r
----------------------------------------------------------------------------------
7. Recursively list Sub-Directories
# ls -R
----------------------------------------------------------------------------------
8. Reverse Output Order
# ls -ltr
----------------------------------------------------------------------------------
9. Sort Files by File Size
ls -lS
----------------------------------------------------------------------------------
10. Display Inode number of File or Directory
# ls -i
----------------------------------------------------------------------------------
11. Shows version of ls command
# ls --version
----------------------------------------------------------------------------------
12. Show Help Page
# ls --help
----------------------------------------------------------------------------------
13. List Directory Information
With ls -l command list files under directory /tmp. Wherein with -ld parameters displays information of /tmp directory
# ls -l /tmp
# ls -ld /tmp/
----------------------------------------------------------------------------------
14. Display UID and GID of Files
# ls -n

15. ls command and it’s Aliases
We have made alias for ls command, when we execute ls command it’ll take -l option by default and display long listing as mentioned earlier.
# alias ls="ls -l"

Note: We can see number of alias available in your system with below alias command and same can be unalias as shown below example.

# alias
To remove an alias previously defined, just use the unalias command
# unalias ls

No comments:

Post a Comment