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

multiline data block parse and CSV data extraction with perl
extract data in multiline blocks of data with perl pattern matching loop

Import SQL into MySQL with a progress meter
This uses PV to monitor the progress of the MySQL import and displays it though Zenity. You could also do this pv ~/database.sql | mysql -u root -pPASSWORD -D database_name and get a display in the CLI that looks like this 2.19MB 0:00:06 [ 160kB/s] [> ] 5% ETA 0:01:40 My Nautalus script using this command is here http://www.daniweb.com/forums/post1253285.html#post1253285

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"

Create a mirror of a local folder, on a remote server
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22) (all files & folders on destination server/folder will be deleted)

This will take the last two commands from bash_history and open your editor with the commands on separated lines

Rename all files in lower case
rename is a really powerfull to, as its name suggests, rename files

List all bash shortcuts
This command shows the various shortcuts that can be use in bash, including Ctrl+L, Ctrl+R, etc... You can translate "\C-y" to Ctrl+y, for example.

list block devices
Shows all block devices in a tree with descruptions of what they are.

zsh suffix to inform you about long command ending
make, find and a lot of other programs can take a lot of time. And can do not. Supppose you write a long, complicated command and wonder if it will be done in 3 seconds or 20 minutes. Just add "R" (without quotes) suffix to it and you can do other things: zsh will inform you when you can see the results. You can replace zenity with other X Window dialogs program.

Show all available colors on your terminal.
Using perl and tput, show all the colors with numbers that your actual $TERM can handle. If want to remove the numbers at beginning of new line, it should be something like this: $perl -E 'say `tput setb $_`," "x `tput cols`, `tput sgr0` for 0 .. (`tput colors` - 1)'


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: