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

Print the IP address and the Mac address in the same line
Print the IP address and the Mac address in the same line

sort list of email addresses by domain.tld
email random list can be created here: https://www.randomlists.com/email-addresses

Reboot without being root
For more, See: https://github.com/noureddin/bash-scripts/blob/master/user_scripts/userpower

High resolution video screen recording
$ gorecord foo.mp4 I've tried all of the screen recorders available for Linux and this is easily the best. xvidcap segfaults; VNC is too much hassle. There are alternatives of this command already here that I am just too lazy to reply to. Messing with the frames per second option, -r, 25 seems to be the best. Any lower and the video will look like a flipbook, if it records at all - -r 10 won't - any faster is the same, oddly enough. Edit: CLF doesn't like my long command to add audio, so here it is in the description. $ goaddaudio() ${ $if [ $# != 3 ]; then $ echo 'goaddaudio < audio > < src video > < dst video >' $ return $ fi $ $ f=goaddaudio$RANDOM $ ffmpeg -i "$2" &> $f $ d=$( grep Duration $f | awk '{print $2}' | tr -d ',' ) && $ rm $f && $ ffmpeg -i "$1" -i "$2" -r 25 -ab 192k -ar 44100 -sameq -t $d "$3" $}

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Create Solid Archive (best compression) with 7z
Creates a solid archive with the highest possible compression (Ultra). Advantage of 7z is that it will use all the processor cores to create the archive. (Ok. at least version 9.04 does)

Start a terminal with three open tabs
If you launch gnome-terminal manually, you can start with three open tabs

Download all images from a 4chan thread
Useful for ripping wallpaper from 4chan.org/wg

Resets a terminal that has been messed up by binary input

convert single digit to double digits
Uses 'rename' to pad zeros in front of first existing number in each filename. The "--" is not required, but it will prevent errors on filenames which start with "-". You can change the "2d" to any number you want, equaling the total numeric output: aka, 4d = ????, 8d = ????????, etc. I setup a handful of handy functions to this effect (because I couldn't figure out how to insert a var for the value) in the form of 'padnum?', such as: padnum5 () { /usr/bin/rename 's/\d+/sprintf("%05d",$&)/e' -- $@ } Which would change a file "foo-1.txt" to "foo-00001.txt"


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: