Last active
August 5, 2021 04:39
-
-
Save kenng/2248129aa72a1071d4aa6bc4188a5651 to your computer and use it in GitHub Desktop.
Revisions
-
Ken Ng revised this gist
Aug 5, 2021 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ ##### find the last modified file (exclude folder) # show files sorted by modification time in reverse order alias lsr="ls -ctrla" lsrexec(){ find . -maxdepth 1 -type f -exec ls -ctrA1 "{}" +; } lsrlast(){ lsaexec | tail -n1; } # example to find the last modified file with 'tar' in its name: lsagrep tar lsrgrep(){ lsaexec | grep $1 | tail -n1; } -
Ken Ng created this gist
Aug 5, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ #!/bin/bash ##### find the last modified file (exclude folder) # show files sorted by modification time in reverse order alias lsa="ls -ctrla" lsaexec(){ find . -maxdepth 1 -type f -exec ls -ctrA1 "{}" +; } lsalast(){ lsaexec | tail -n1; } # example to find the last modified file with 'tar' in its name: lsagrep tar lsagrep(){ lsaexec | grep $1 | tail -n1; }