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

delete files containing matching text
-r recursively -Z zero byte after each file name instead of the usual newline -l only filenames

rename all files with "?" char in name
replace all "?" characters in filename to underscore

Make sure your script runs with a minimum Bash version
If you use new features of a certain Bash version in your shell script, make sure that it actually runs with the required version.

camelcase to underscore
For mac users !

Make directories for and mount all iso files in a folder

check open ports without netstat or lsof

Mac OS-X-> copy and paste things to and from the clipboard from the shell
Copies whatever is piped to the pbcopy command to the clipboard. pbpaste ... well pastes whats on the clipboard.

Push your present working directory to a stack that you can pop later
If are a Bash user and you are in a directory and need to go else where for a while but don't want to lose where you were, use pushd instead of cd. cd /home/complicated/path/.I/dont/want/to/forget pushd /tmp cd thing/in/tmp popd (returns you to /home/complicated/path/.I/dont/want/to/forget)

Rename files in batch

create dir tree
create tree of dir's in one command


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: