commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
Automatically drops mount points that have non-numeric sizes (e.g. /proc). Tested in bash on Linux and AIX.
Find mac address only from drivers, without using ifconfig.
Similarly for last wake time:
sysctl -a | grep waketime
basic find implementation for systems that don't actually have find, like an android console without busybox installed.
The other commands were good, but they included packages that were installed and then removed.
This command only shows packages that are currently installed, sorts smallest to largest, and formats the sizes to be human readable.
This shows all process (-e) and threads (-L) in full format (-F)
first grep all href images then sed the url part then wget
I use this with alias:
alias lsl="ls -1F | grep @$ | sed 's/@//' | column"
Limitation: This will also list files that happen to have an @ at the end of the filename.
I use this with alias:
alias lsl="ls -1F | grep @ | sed 's/@//' | column"
grep по ps aux
Goto phase 2 to clobber the interrupt that is problematic.
Deprecated due to a change in the site design: see alternatives.
Do the unlock KDE screen saver locked session with lightdm display manager used in Kubuntu 12.10 +
Translate strings from non-german to german (and vice versa) using LEO. Put it in your ~/.bashrc.
To support languages other than english, change the lang variable:
lang=ch # chinese
lang=en # english
lang=es # spanish
lang=fr # french
lang=it # italian
lang=pl # polish
lang=pt # portuguese
lang=ru # russian
The other language will always be german!
This will catch most separators in the section of the email:
plus + (added for gmail)
... and the basic dash '-' of host names.
This command will help you to get Ip address origin of city and country.
I will be happy if someone can shrink the sed command
This has saved me many times while debugging timeout issues to "too many open files" issues. A high number of the order of thousand, indicates that somewhere connection is not being closed properly.
Required : information_schema
** Only replace the "DB-NAME" and "PREFIX" with your DB-name and wildcard prefix match.
** Also replace with your own username and password for mysql server.
This command uses the information_schema to wildcard match tables that we donot need from a database and than pipes the remaining tables out through "xargs" command to the mysqldump utility which than dumps those remaining tables into a sql dump file.