Commands by Gomex (2) the last day the last week the last month all time sorted by date votes

• 1
for arquivo in ls -1 ; do sed -i '/ErrorLog/a\ \ \ \ \ \ \ \ CustomLog \/var\/log\/apache2\/access_'"$file"'_log combined' /root/site-bak/${file} ; done
· 2010-05-10 14:34:05

• 11
find <directory path> -mtime +365 -and -not -type d -delete
· 2009-05-28 14:14:49

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Check These Out

resolve short urls
since the most url shorteners respond with a header containing the Location: ... this works with most common shorteners

Find the package that installed a command

Simplified video file renaming
I used this when I had a directory of movies from a camera. I wanted to watch a little of each movie, then rename it depending on what was in the movie. This did the trick for me.

Getting ESP and EIP addresses from running processes
'ps' let you specify the format that you want to see on the output.

generate iso

gpg encrypt a file
gpg command to encrypt a file on the command line.

command to change the exif date time of a image

whois filtering the important information

Erase to factory a pendrive, disk or memory card, and watch the progress

escape any command aliases
e.g. if rm is aliased for 'rm -i', you can escape the alias by prepending a backslash: rm [file] # WILL prompt for confirmation per the alias \rm [file] # will NOT prompt for confirmation per the default behavior of the command

Stay in the loop…

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: