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.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
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:
Somtime one wants to kill process not by name of executable, but by a parameter name. In such cases killall is not suitable method.
searches through the linux dictionary for the word you're trying to spell (you can use regular expressions, e.g. "< /usr/share/dict/words egrep bro[c]+o[l]+i" )
Really, you deserve whatever happens if you have a whitespace character in a file name, but this has a small safety net. The truly paranoid will use '-i'.
I have this as a file called deletekey in my ~/bin.
Makes life a little easier.
Quicker way to search man pages of command for key word
This should do the same thing and is about 70 chars shorter.
Requires aria2c but could just as easily wget or anything else.
A great way to build up a nice font collection for Gimp without having to waste a lot of time. :-)
If you have lots of subversion working copies in one directory and want to see in which repositories they are stored, this will do the trick. Can be convenient if you need to move to a new subversion server.
This shows you which files are most in need of commenting (one line of output per file)
I created this command to give me a quick overview of how many file types a directory, and all its subdirectories, contains. It works based off file extension, rather than file(1)'s magic output, because it ended up being more accurate and less confusing.
Files that don't have an ext (README) are generally not important for me to want to count, but you're free to customize this fit your needs.
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server. A slightly shorter version.
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server.
This is a slight variation of an existing submission, but uses regular expression to look for files instead. This makes it vastly more versatile, and one can easily verify the files to be kept by running ls | egrep "[REGULAR EXPRESSION]"
Thanks for the submit! My alternative produces summaries only for directories. The original post additionally lists all files in the current directory. Sometimes the files, they just clutter up the output. Once the big directory is located, *then* worry about which file(s) are consuming so much space.
If you want to relocate a package on your own, or you just want to know what those PREIN/UN and POSTIN/UN scripts will do, this will dump out all that detail simply.
You may want to expand the egrep out other verbose flags like CHANGELOGTEXT etc, as your needs require.
It isn't clear, but the formatting around $tag is important: %{$tag} just prints out the first line, while [%{$tag }] iterates thru multi-line output, joining the lines with a space (yes, there's a space between the g and } characters. To break it out for all newlines, use [%{$tag\n}] but the output will be long.
This is aside from rpm2cpio | cpio -ivd to extract the package files.
lists all files that are opened by processess named $processname
egrep 'w.+REG' is to filter out non file listings in lsof, awk to get the filenames, and sort | uniq to remove duplciation
Please install aria2c before you try the above command. On ubuntu the command to install aria2c would be:
sudo aptitude install aria2
This command is jsut for the main IP settings of ndd. if you need ip6 or icmp edit the text within the egrep inclusion area.
Felix001 - www.Fir3net.com