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

download file1 file2 file3 file4 .... file 100

convert video to gif by ffmpeg and imagemagick
you can use any common video format. if you don't need to change the size of gif output, just remove `-vf scale=320:-1` btw, 320:-1 means width is 320px and height would be set automatically

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Recursive Line Count
We use `-not -name ".*"` for the reason we must omit hidden files (which unnecessary). We can only show up total lines like this: $ find * -type f -not -name ".*" | xargs wc -l | tail -1

Convert IP octets to HEX with no dots.
Converts IP octets to hex using printf command. Useful for generating pxeboot aliases in the pxelinux.cfg folder.

List of services sorted by boot order in Redhat-based systems

export iPad App list to txt file
This will generate the same output without changing the current directory, and filepath will be relative to the current directory. Note: it will (still) fail if your iTunes library is in a non-standard location.

Check if a command is available in your system
Usefull to detect if a commad that your script relies upon is properly installed in your box, you can use it as a function function is_program_installed() { type "$1" >/dev/null } Invoke it and check the execution code is_program_installed "dialog" if [ ! $? -eq 0 ]; then echo "dialog is not installed" exit 1 fi

Boooted as EFI/UEFI or BIOS

Remind yourself to leave in 15 minutes
If you spend most of your time in front of the terminal, leave is a useful reminder. Leave can have absolute form: leave 1555 reminds you to leave at 3:55PM


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: