Using awk with ‘ls -l’ linux command

Some creative ways to use awk with ls -l command. Find all files for a certain month:  ls -l | awk ‘$6==”Sep”{print}’ Find all files with a size greater than:  ls -l | awk ‘$5>1009{print}’ [user1@jibsheet data]$ ls -l | awk ‘$6==”Sep”{print}’ -rw-rw-r– 1 user1 datausr 54255 Sep 9 12:34 alex_Y2021_M09_D09_H12.txt -rw-r–r– 1 user1 datausr 54255 Sep 17 01:33 alex_Y2021_M09_D17_H01.txt […]

ls -l – sort files by number in file name or extention

Use sort.  Use -n for numeric and -t for field separator.   then k for the field.   [user1@jibsheet ~]$ ll $HOME/tidal* -rw-rw-r– 1 user1 user1 545 Oct 13 10:02 /home/user1/tidal_out.txt -rw-rw-r– 1 user1 user1 545 Oct 13 10:02 /home/user1/tidal_out.txt.1 -rw-rw-r– 1 user1 user1 564 Oct 12 22:39 /home/user1/tidal_out.txt.10 -rw-rw-r– 1 user1 user1 546 Oct 13 08:02 /home/user1/tidal_out.txt.2 -rw-rw-r– 1 user1 […]