Check These Out
deletes logs not modified in over [#] days - modify to compress or move, as needed
'-mtime -10' syncs only files newer 10 days (-mtime is just one example, use whatever find expressions you need)
printf %P: File's name with the name of the command line argument under which it was found removed.
this way, you can use any src directory, no need to cd into your src directory first.
using \\0 in printf and a corresponding --from0 in rsync ensures that even filenames with newline characters work (thanks syssyphus for #3808).
both, #1481 and #3808 just work if you either copy the current directory (.) , or the filesystem root (/), otherwise the output from find and the source dir from rsync just don't match. #7685 works with an arbitrary source directory.
In a folder with many files and folders, you want to move all files where the date is >= the file olderFilesNameToMove and
you could save the code between if and fi to a shell script named smiley.sh with the first argument as and then do a smiley.sh to see if the command succeeded. a bit needless but who cares ;)
Create a tgz archive of all the files containing local changes relative to a subversion repository.
Add the '-q' option to only include files under version control:
$svn st -q | cut -c 8- | sed 's/^/\"/;s/$/\"/' | xargs tar -czvf ../backup.tgz
Useful if you are not able to commit yet but want to create a quick backup of your work. Of course if you find yourself needing this it's probably a sign you should be using a branch, patches or distributed version control (git, mercurial, etc..)
Sometimes things break. You can find the most recent errors using a combination of journalctl, along with the classic tools sort and uniq
hypnotizing pendulum
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Search and replace recursively. :-) Shorter and simpler than the others. And allows more terms:
replace old new [old new ...] -- `find -type f`