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:
This alias finds identical lines in a file (or pipe) and prints a sorted count of them (the name "sucs" descends from the first letters of the commands). The first example shows the number of logins of users; the one who logged in most often comes last. The second example extracts web client IP addresses from a log file, then pipes the result through the "sucs" alias to find out which clients are performing the most accesses. Or pipe the first column of ps(1) output through "sucs" to see how many processes your users are running.
This will create a permanent alias to colorize the search pattern in your grep output
Makes it easy to add keys to new ppa sources entries in apt sources.list
Now to add the key for the chromium-daily ppa:
Just find out the daemon with $ netstat -atulpe. Then type in his name and he gets the SIGTERM.
If you're addicted to command-line solutions of ordinary actions or if you just want to set your volume from bed via mobile phone SSH, you can set this alias and use it as
for setting volume on 50% gain
Works only with ALSA, tested on Ubuntu 8.10. Give me some info about your experience.
TIP: Try aslo command "mute" to toggle mute/unmute sound. But I don't know if this works on all distros.
list what applications using what ports
these are some aliases you can use in bashrc to shorten the amount of typing needed to use apt-get, also can be used as reference if you can't remember alot of commands or command parameter variations,etc...
Please comment with more apt-get aliases if I missed any, thx
alias for editing .bashrc and sourcing it with a quick command, very useful for quickly adding and modifying alias' and functions in bashrc, create lots of alias from commandlinefu very quickly, use nano vim or any other edit if you want, very useful if you have a barcode scanner and you want to run commands quickly with barcodes
When you have to manage lot of servers, it's boring to type ssh root@myhost for each connection. Now you can type juste "s someting" and you are connected.
You can too add bash_completion script to complet with tab the name of your servers. This will be the next tips from me ;)
Reads in the ~/.Xdefaults lexicographically sorted with, instead of replacing, the current contents of the specified properties.
This is the alias command that I discussed in my prior release which you can add to your ~/.bashrc.
This command asks for the station name and then connects to somafm, Great for those who have linux home entertainment boxes and ssh enabled on them, just for the CLI fiends out there ( I know I'm one of them ;)
You can find future releases of this and many more scripts at the teachings of master denzuko - denzuko.co.cc.
A short way to give us relevant report in a moment done about quantities on disk usage, memory and swap in our Linux Systems.
typing history it's a long way but typing only h it's my way it works in whatever distro or OSes or shells that you use, you know, only for easyness :)
This is a simple command, but extremely useful. It's a quick way to search the file names in the current directory for a substring. Normally people use "ls *term*" but that requires the stars and is not case insensitive. Color (for both ls and grep) is an added bonus.
Add this to .bashrc, then you can quickly create backups from files on current directory, but it only backups files on current directory.
useful when changing config files, coding something or just trying something stupid.
rot13 maps a..mn..z (A..MN..Z) to n..za..m (n..za..m) and so does this alias.
create a short alias for 'ls' with multi-column (-C), file type syntax additions (slashes after directories, @ for symlinks, etc... (-F), long format (-l), including hidden directories (all ./, ../, .svn, etc) (-a), show file-system blocks actually in use (-s), human readable file sizes (-h)
I got really tired of having tree always show me tons of .svn and .git stuff that I don't care about. With this alias, "tree" uses pretty colors, snazzy line graphics, and ignores any source control and package mumbojumbo. (Customize the *.*.package glob, of course.)
parses the output of ifconfig to show only the configured ip address (in this case from interface eth0).
the regexp is quick'n'dirty im sure it can be done in a better way.
--> this alias does not show your "internet ip" when you're in a nat-environment