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

Smart renaming
Use 'mmv' for mass renames. The globbing syntax is intuitive.

Create A Continuous Yahoo! News Ticker For The Terminal
This creates a permanent stock ticker in the terminal. it has scrolling action and refreshes when each cycle is done to get the latest news.

An alarm clock using xmms2 and at
Nice little alarm clock to wake you up on time (hopefully). You can also do 'echo "vlc path/to/song" | at 6:00

find available cpu frequencies on FreeBSD
Once you know the available frequencies for your CPU, they can be used to do things like set minimum CPU frequency for powerd so that it doesn't ramp down too slow on a server : /etc/sysctl.conf or /boot/loader.conf: debug.cpufreq.lowest=DESIRED FREQ HERE or at terminal sysctl debug.cpufreq.lowest=DESIRED FREQ HERE

apt-get via sudo
An apt-get wrapper function which will run the command via sudo, but will run it normally if you're only downloading source files. This was a bit of an excuse to show off the framework of $ cmd && echo true || echo false ...but as you can see, you must be careful about what is in the "true" block to make sure it executes without error, otherwise the "false" block will be executed. To allow the apt-get return code to pass through, you need to use a more normal if/else block: $ apt-get () { if [ "$1" = source ]; then command apt-get "$@"; else sudo apt-get "$@"; fi }

Two command output
Summarize established connections after netstat output. Using tee and /dev/stderr you can send one command output to terminal before executing wc so you can summarize at the bottom of the output.

Prints any IP out of a file

Detect illegal access to kernel space, potentially useful for Meltdown detection
Based on capsule8 agent examples, not rigorously tested

Find size in kilobyte of files that are deleted but still in use and therefore consumes diskspace

Update a tarball
This will update the tarball, adding files that have changed since the last update. This assumes that the tarball is in the same directory as the files being archived. N.B. This command can't be used on compressed tarballs. N.B. This will add the updated files to the tarball, so that the tarball will have two versions of each file. This will make the tarball larger, but doesn't have any other significant effect.


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: