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

ShellCheck all the bash/sh script under a specific directory excluding version control
This is a commodity one-liner that uses ShellCheck to assure some quality on bash and sh scripts under a specific directory. It ignores the files in .git directory. Just substitute "./.git/*" with "./.svn/*" for older and booring centralized version control. Just substitute ShellCheck with "rm" if your scripts are crap and you want to get rid of them :)

Comma insertions
Insert a comma where necessary when counting large numbers. I needed to separate huge amounts of packets and after 12+ hours of looking in a terminal, I wanted it in readable form.

Display the human-readable sizes of all files and folders in the current directory with 3 decimal places
To sort the list by file/directory size, insert `sort -n |` before `awk`.

Binary difference of two files
Upload/download newer version of any file with less size and high speed. To remake the new file use $bspatch

Log the current memory statistics frequently to syslog
Uses logger in a while loop to log memory statistics frequently into the local syslog server.

Track flight information from the command line
See the flight information from the CLI Use as a SH file or function, like: `./flight.sh os 336`

Install pip with Proxy
Installs pip packages defining a proxy

stringContains: Determining if a String Contains a Substring

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.

Go up multiple levels of directories quickly and easily.


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: