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

create shortcut keys in bash

SSH connection through host in the middle
Unreachable_host is unavailable from local network, but it's available from reachable_host's network. This command creates a connection to unreachable_host through "hidden" connection to reachable_host.

Find usb device
I often use it to find recently added ou removed device, or using find in /dev, or anything similar. Just run the command, plug the device, and wait to see him and only him

AWK command to extract log files between dates

Know which version dpkg/apt considers more recent
Compares two versions with dpkg. It is not always obvious what version dpkg/apt will consider to be more recent. Operators include the following : * These treat an empty version as earlier than any version: lt le eq ne ge gt. * These treat an empty version as later than any version: lt-nl le-nl ge-nl gt-nl. * These are provided only for compatibility with control file syntax: < > >. This command doesn't output anything. It only returns with status 0 or 1, hence the echo "y" || echo "n" to get an output.

Takes and displays screenshot of Android phone over adb.
Dependencies on phone: adb access, screencap command, base64 command. Dependencies on computer: adb, sed, base64, display (from imagemagick, but can substitute other image viewer which reads from stdin). This should work around adb stupidies (i.e. that it replaces \n with \r\n) with base64.

Show a passive popup in KDE
Display a passive popup during seconds. Additionnaly, --title can be used to set the title of the popup. This is a nice way to communicate with a desktop user of a machine you have an SSH access on : DISPLAY=:0 sudo -u $user -H kdialog --passivepopup "Hello you" 10 --title "cli IM"

Find running binary executables that were not installed using dpkg
This helped me find a botnet that had made into my system. Of course, this is not a foolproof or guarantied way to find all of them or even most of them. But it helped me find it.

Leap year calculation

Find Out My Linux Distribution Name and Version
Another way of do it in debian like distros, don't know if works for others


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: