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

remove execute bit only from files. recursively

Count all files in directories recursively with find
Counts the files present in the different directories recursively. One only has to change maxdepth to have further insight in the directory hierarchy. Found at unix.stackexchange.com: http://unix.stackexchange.com/questions/4105/how-do-i-count-all-the-files-recursively-through-directories

uniq without pre-sorting
Reads stdin, and outputs each line only once - without sorting ahead of time. This does use more memory than your system's sort utility.

Go (cd) directly into a new temp folder
This command create a new temp directory using mktemp (to avoid collisions) and change the current working directory to the created directory.

Show your current network interface in use

Show the command line for a PID, converting nulls to spaces and a newline
If you cat the file, all the parts of the command line are bunched up. If you use tr to convert the nulls to spaces, you're still left without a newline unless you add another step. This command does everything for you.

Remove all the files except abc in the directory
This is for zsh with extended globbing.

Read funny developer comments in the Linux source tree
These are way better than fortune(6).

Download entire commandlinefu archive to single file
'jot' does not come with most *nix distros, so we need to use seq to make it work. This version tested good on Fedora 11.

Changes a User Password via command line without promt
Used to change a password via a winscp faux shell


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: