Last active
September 24, 2020 06:30
-
-
Save Manojbhat09/72b0e9145085bbda3b0917f5bbeb3bc6 to your computer and use it in GitHub Desktop.
Basic ubunu bash commands
This file contains 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
# Delete all but the most recent X files in bash | |
ls -tp | grep -v '/$' | tail -n +6 | xargs -I {} rm -- {} | |
# +1 keeps 0 files, +4 keeps top 3 files | |
# https://stackoverflow.com/questions/25785/delete-all-but-the-most-recent-x-files-in-bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment