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

Bash logger

Load average + API google chart
limite = threshold

Quickly re-execute a recent command in bash
! will expand to the last time you ran , options and all. It's a nicer alternative to ^R for simple cases, and it's quite helpful for those long commands you run every now and then and haven't made aliases or functions for. It's similar to command 3966, in some sense.

Force logout after 24 hours idle
Shell timeout variables (TMOUT) can be very liberal about what is classified as 'activity', like having an editor open. This command string will terminate the login shell for an user with more than a day's idle time.

Remove CR LF from a text file
Remove CR LF (CRLF) from a text file. use man:tr to get more info about removing other characters from a file. and even character to character replacements.

ssh batch jobs: query hundreds of hosts with an ssh command
Need to query hundreds of hosts with an ssh command ? Of course you'll have setup keys on all your remote HOSTs. But in the case a key is not present this command will skip that node, proceeding on to the next. -t: Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine. Also prevents unwanted stty messages being sent to console -q: Quiet mode. -o "BatchMode yes" If set to yes, passphrase/password querying will be disabled. This option is useful in scripts and other batch jobs where no user is present

delete multiple files from git index that have already been deleted from disk
delete multiple files from git index that have already been deleted from disk. this is pretty terrible, I'm looking for a better way. (much better!! http://www.commandlinefu.com/commands/view/1246/git-remove-files-which-have-been-deleted)

list the top 15 folders by decreasing size in MB
list the top 15 folders by decreasing size in MB

Get the 10 biggest files/folders for the current direcotry

list all executables in your path
If run in bash, this will display all executables that are in your current $PATH


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: