Useful to detect number of tabs in an empty line, DOS newline (carriage return + newline). A tool that can help you understand why your parsing is not working. Show Sample Output
man -t manpagename gives a postscript version of said man page. You then pipe it to ls, and assuming you have cups set up, it prints in your default printer. Show Sample Output
The file .my.cnf located at user's home directory is used for mysql login. If this file exists, then
mysql -uYOURUSERNAME -pYOURPASSWORD database -e 'SOME SQL COMMAND'
can be replaced with
mysql database -e 'SOME SQL COMMAND'
It saves you from typing!
This is valid for mysqladmin and mysqldump commands as well.
Show Sample Output
I needed to get a feel for how "old" different websites were, based on their directories. Show Sample Output
Xsane produces PDFs that are too large - particularly multipage PDFs. This command compresses them. If you do not use A4, remove the -sPAPERSIZE flag.
I recently found myself with a filesystem I couldn't write to and a bunch of files I had to get the hell out of dodge, preferably not one at a time. This command makes it possible to pack a bunch of files into a single archive and write it to a remote server.
host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments or options are given, host prints a short summary of its command line arguments and options. Show Sample Output
bc is a wonderful calculator. Just type bc at the command line and have at it. Ctrl+D (or type quit) will get you out. This usage is just scratching the surface: bc can handle a mini scripting language, complete with variable, statements, loop, conditional statements and more. Do a man page on it to find out. Show Sample Output
Short and sweet command. This command is also useful for other information such as what IP address a particular user logged in from, how long had they been logged in, what shell do they use.
bvi is your vi for binary editing. If your system does not have it, you can get it from http://bvi.sourceforge.net/
tested in csh on solaris.
hello
Sometimes you want to know the summary of the sizes of directories without seeing the details in their subdirectories. Especially if it is going to just scroll off the screen. This one liner summarizes the disk usage of any number of directories in a directory without giving all the details of whats happening underneath. Show Sample Output
Run this in your music folder, or give the path directly after "find". The sed pattern filters away the basename. Show Sample Output
That will capture 200 seconds of video at fullscreen 1680x1050 resolution, but scaled down 25 percent, with 15 frames per second. http://fusioncast.blogspot.com/2007/09/infobyte-how-i-record-my-desktop.html
Be aware of using the --password argument as it will appear your password in plain text on the screen. You may use -p argument instead, it will prompt you to enter you password in hidden mode.
explanation: grep -- displays process ids -v -- negates the matching, displays all but what is specified in the other options -u -- specifies the user to display, or in this case negate The process loops through all PIDs that are found by pgrep, then orders a forced kill to the processes in numerical order, effectively killing the parent processes first including the shells in use which will force the users to logout. Tested on Slackware Linux 12.2 and Slackware-current
Say you need to ping every 5th IP address on your network .. this will give you a way of doing that.
jot can also do counting ... like
jot 4
1
2
3
4
download from http://oreilly.com/catalog/upt2/examples/#jot or fins athena-jot in rpm format
Show Sample Output
Handy if all you have is a console session or tty. Show Sample Output
Depending on the network setup, you may not get the hostname. Show Sample Output
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.
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: