User Tools

Site Tools


ls_usage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
ls_usage [2022/07/22 23:27] – [Show file date in different date formats] rajuls_usage [2022/07/22 23:34] (current) – [indicators] raju
Line 66: Line 66:
  
 Ref:- https://unix.stackexchange.com/questions/82357/what-do-the-symbols-displayed-by-ls-f-mean Ref:- https://unix.stackexchange.com/questions/82357/what-do-the-symbols-displayed-by-ls-f-mean
 +
 +==== only show filename and modification time ====
 +<code>
 +ls -al | cut -d ' ' -f 6- 
 +</code>
 +
 +Another way (using find):
 +<code>
 +find -maxdepth 1 -type f -printf "%TY %Tb %Td %TH:%TM\t%p\n"
 +</code>
 +
 +To sort the files based on timestamp (reverse chronological order)
 +<code>
 +find -maxdepth 1 -type f -printf "%T+#%TY %Tb %Td %TH:%TM\t%p\n" | sort -rn| cut -d# -f2-
 +</code>
 +
 +The %T+ is used to sort the output properly and gets removed by cut afterwards.
 +
 +Ref:- https://askubuntu.com/a/1044206/574082
  
ls_usage.1658532458.txt.gz · Last modified: 2022/07/22 23:27 by raju