Skip to content

Instantly share code, notes, and snippets.

@phpdave
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpdave/efe4a47e560041946d9d to your computer and use it in GitHub Desktop.
Save phpdave/efe4a47e560041946d9d to your computer and use it in GitHub Desktop.
Nifty Linux commands
#To find all files modified in the last 24 hours (last full day) in a particular specific directory and its sub-directories:
find /directory_path -mtime -1 -ls
#Send this to me in an email -- SECURITY WARNING your sending file and directory structure over insecure email
find ./ -mtime -1 -ls | mail -s subject user@gmail.com
#attempt at conditional sending
[[ -n `find ./ -mtime -1 -ls` ]] && { find ./ -mtime -1 -ls | mail -s subject user@gmail.com;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment