Ls usage

From raju

Note:- This page will be migrated to Once the migration is done, it will be deleted.


"ls -F" appends indicators */=>@| to filenames.

  • * means executable.
  • / means directory.
  • = means socket.
  • > means door.
  • @ means symbolic link (or that the file has extended attributes).
  • | means named pipe.


only show filename and modification time

    ls -al | cut -d ' ' -f 6- 

Another way (using find):

    find -maxdepth 1 -type f -printf "%TY %Tb %Td %TH:%TM\t%p\n"

To sort the files based on timestamp (reverse chronological order)

    find -maxdepth 1 -type f -printf "%T+#%TY %Tb %Td %TH:%TM\t%p\n" | sort -rn| cut -d# -f2-

The %T+ is used to sort the output properly and gets removed by cut afterwards.