All commands (14,187)

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.

Share Your Commands


Check These Out

List all groups and the user names that were in each group
"cut" the user names from /etc/passwd and then running a loop over them.

Shows you how many hours of avi video you have.
midentify.sh is part of mplayer, but you might have to locate it on your box.

Clean up poorly named TV shows.
Replace 'SHOWNAME' with the name of the TV show. Add -n to test the command without renaming files. Check the 'sample output'.

Grab mp3 files from your favorite netcasts, mp3blog, or sites that often have good mp3s
This was gotten from http://www.veen.com/jeff/archives/000573.html. The line will grab all the mp3 files on the urls listed in text file sourceurls.txt (one url per line) . A much more complete breakdown of the line can be found at the web site mentioned above.

convert from decimal to hexadecimal
Use the standard calculator bc to convert decimals to hex

Recurse through directories easily
This is a simple case of recursing through all directories, adding the '.bak' extension to every file. Of course, the 'cp $file $file.bak' could be any code you need to apply to your recursion, including tests, other functions, creating variables, doing math, etc. Simple and clean recursion.

Copy a file structure without files
Taken from: http://www.webmasterworld.com/forum40/1310.htm

Pronounce an English word using Dictionary.com
This one uses dictionary.com

Execute a command at a given time
This is an alternative to cron which allows a one-off task to be scheduled for a certain time.

sync svn working copy and remote repository (auto adding new files)
Lists the local files that are not present in the remote repository (lines beginning with ?) and add them.


Stay in the loop…

Follow the Tweets.

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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: