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:
similar to perl chop()
Simply displays your current working directory. Helps when you are buried deep in /etc or some other obscure place.
If somehow if you get more than 1 same name rpm package install, then it cannot be removed by using simple rpm -e as it gives you more than one rpm matches error. The --matches will help to remove all the same name rpm packages.
Once Enabled this command enables a trail of all processes on the system. As the name suggested auditing for Solaris machines.
BSM creates a number of files in the /etc/security directory.
due to bug can not comment
add |sh when you agree the list, I often use that method to prevent typos in dangerous or long operations
Use this command to see logs update in real time
Telnet will make a tcp connection to a remote ip/port to test connectivity. If it times out, it's not reaching the host (maybe the firewall is blocking it). If connection is refused, it's reaching the host, but either the service is not listening on that port, or it's locked.
U have to make key exchange in order to avoid continuous password prompt.
while [ 1 -ne 6 ]; do
pid=`ps -ef | grep -v "grep" | grep "trans_gzdy" | cut -c10-17`
ps gv $pid | head -2
check changes of RSS.
arguably better than using the driver interface. lots of potentially cool stuff to be done w/ the dcop client.
Handy for those times you need to paste a file path in an IDE or some other app.
sudo apt-get install xclip
Then, for convenience, alias xclip to 'xclip -selection c' so you can just do something like realpath . | xclip
If you want to display a dialog (using xdialog/kdialog/zenity) you
need to make sure that you have a valid X session. Checks for
the existence of the DISPLAY variable.
nmap accepts a wide variety of addressing notation, multiple targets/ranges, etc.
e.g. if rm is aliased for 'rm -i', you can escape the alias by prepending a backslash:
rm [file] # WILL prompt for confirmation per the alias
\rm [file] # will NOT prompt for confirmation per the default behavior of the command
Change the -p argument for the port number. See "man nmap" for different ways to specify address ranges.
Just run the command, type your password, and that's the last time you need to enter your password for that server.
This assumes that the server supports publickey authentication. Also, the permissions on your home dir are 755, and the permissions on your .ssh dir are 700 (local and remote).
If you come from a DOS background and accidentally use DOS commands often, this and others like it can be helpful. Add to your .bash_profile, or wherever you keep such things.