Listing of files

 

  • ls : it displays list of files and directories
  • $ls -x : displays width wise
  • $ls | pg : it displays list of files and directroies page wise
  • $ls -x | pg: displays list of files and directories page wise and width wise
  • $ls -a : displays files and directories including . And .. hidden files
  • $ls -F : it displays files, directories , executable files, symbolic files.
  • $ls -r : it displays files and directories in reverse order i.e descending order
  • $ls-R : it displays files and directories in recursively.
  • $ls -t: it displays files and directories based on date & time of creation i.e. Last file to first file
  • $ls -rt: displays files and directories based on date and time of creation but in reverse order. i.e first file to last file
  • $ls -i: displays files and directories along with inode number
  • $ls -l: it displays files and directories in long list format.

Wild card characters :

  • $ls a* : displays all files, starting letter with a.
  • $ls b*k : displays all files with starting letter b and ending letter with k.
  • $ls *k: displays all files ending letter is k.
  • $ls a?k : displays all 3 length filenames but starting letter is a.
  • $ls b??k : displays all 4 length filenames but starting letter is b and ending letter is k.
  • $ls [aeiou]* : it displays all files but first character of the file name to be listed must be any of the letters given with in the square brackets and the remaining can be anything.
  • $ls [!aeiou]* : displays all files whose first character is anything other than a vowel
  • $ls [k-v]* : It displays all files whose starting letter between k and v
You can leave a response, or trackback from your own site.

Leave a Reply

Powered by k2schools
%d bloggers like this: