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

Tar - Compress by excluding folders
If you give tar a list of filenames, it will not add the directories, so if you don't care about directory ownership or permissions, you can save some space. Tar will create directories as necessary when extracting. This command is limited by the maximum supported size of the argument list, so if you are trying to tar up the whole OS for instance, you may just get "Argument list too long".

Show your local ipv4 IP
To show ipv6 instead, use [[ -6 ]] instead of [[ -4 ]] $ip -o -6 a s | awk -F'[ /]+' '$2!~/lo/{print $4}' To show only the IP of a specific interface, in case you get more than one result: $ip -o -4 a s eth0 | awk -F'[ /]+' '$2!~/lo/{print $4}' $ip -o -4 a s wlan0 | awk -F'[ /]+' '$2!~/lo/{print $4}'

Ping sweep without NMAP
Waits for all pings to complete and returns ip with mac address

Install pip with Proxy
Installs pip packages defining a proxy

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Print all git repos from a user
in case you could afford installing jq

Find the package that installed a command

Matrix Style
Unlike other alternatives, this command only relies on bash builtins and should also work on windows platforms with the bash executable. Sparseness corresponds to the number 128 and can be adjusted. To print all possible digits instead of only 0 and 1 replace RANDOM%2 by RANDOM%10 or RANDOM%16 to add letters [A-F].

Capture FTP Credentials and Commands

Print permanent subtitles on a video
It prints myvideo.srt subtitle files in myvideo.avi, saving it in myvideo_subtitled.avi


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: