Thursday, November 25th, 2010 at
8:30 am
Are you new here? Subscribe to my RSS feed. Thanks for visiting!
Here’s a quick tip on how to replace all spaces with a dot in vim:
:%s/[ \t]/./
And here’s how to remove all trailing spaces at the end of each line:
:%s/\s\+$//
Have any more vim quick tips? Let’s hear them in the comments.
Popularity: 1% [?]
Tuesday, November 23rd, 2010 at
4:52 pm
Here’s a quick command line tip to find files older than 5 days, and execute an action on those files:
find /home/foo/* -mtime +5 -exec echo {} > oldfiles.txt \;
&& mail -s "files older than 5 days" foo@foogazi.com < oldfiles.txt
This command searches for files that are older than 5 days, and sends the output to oldfiles.txt, then an email is sent to foo@foogazi.com with a list of the old files.
Alternatively, you could search for files older than 5 days, then delete them using this command:
find /home/foo/* -mtime +5 -exec rm {} \;
Popularity: 1% [?]