Last active
August 5, 2021 04:39
-
-
Save kenng/2248129aa72a1071d4aa6bc4188a5651 to your computer and use it in GitHub Desktop.
linux productive command line
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 characters
#!/bin/bash | |
##### 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; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment