Friday 6 March 2015

Few 'ls' commands you might not Familiar with..

If you are a linux system administrator then you must be familiar with the 'ls' command. ls command is basically used for listing the contents and information about the files. Let's take a look at some interesting ls commands options which you might not familiar with:

# ls -a
List all files including hidden also known as dot (.) files

#ls -A
List all files including hidden files but do not list implied . and ..

#ls --author -l
Will print out the author of each file

#ls -b
Will print escape for non graphic character.

#ls --block-size=M -l
List all files and directories in the desired block size format. block size may be M, K etc

#ls -B
List all files but ignore backup files.

#ls -cl
Sort all files within a directory by name and show last modification information.

#ls -ltc
Sort all files within a directory by modification time and show related information.

#ls --color=never
control the output of ls command without any color. color argument takes the three self explanatory parameters auto, never and always.

No comments:

Post a Comment