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:
gentoo only or gentoo-like linux distributions.
-T = traceroute
-V = verbose
--tr-stop = exit when target is reached
-n = don't do reverse lookups (faster)
-2 = udp
-p 53 = destination port 53 (dns), change to your needs
Useful when trying to debug a network with complex routing rules and/or multiple gateways.
Gives stereo, 16bit, 44.1kHz (default in Ubuntu/Medibuntu ffmpeg).
-aq 2 = 220-250kbit/s VBR, lower number is better quality. 2 or 3 should be good for most people. If you want the best mp3 q you should remove -aq and use -ab 320k to get 320kbit/s, but that is probably overkill for most .flv videos.
A universal way to configure your web browser. Note, you'll also need to set "x-scheme-handler/https" and "text/html" for https links and html files, respectively.
'yum deplist XXX' provides a list of packages that XXX depends on.
This command provides a list of packages that depend upon XXX (package reverse dependencies)
NMON Data collector , DQME
log on to appma569 as root
nmon -f -T -^ -s 15 -c 12
The AWK part of the code will "collate" the fields from 2nd to Nth field (this is to handle any svn directories that may have spaces in them - typical when working with code that is interchangeably used with windows environment - for example, documentation teams) - the output is passed to "ls -ld" - the -d option to ls will tell ls to handle directories itself, rather than do ls on the directory. The '-p' option is just for pretty printing directories, links and executables (for added readability).
Finally, the entire "constructed" command will be passed onto sh for shell execution.
This is priceless for discovering otherwise invisible characters in files. Like, for example, that stray Control-M at the end of the initial hash bang line in your script, which causes it to generate a mysterious error even though it looks fine.
('od' is the last word, of course, but for many purposes it's much harder to read.)
Create subtitle file heading.ssa with just one entry for the entire video duration. Command line sets that entry's text on top of the video as text watermark. If text is an URL works nice for sending people back to your site from a YouTube clip. Output file is lossless encoded and suitable for further processing. Subtitle file can be a URL so it's saved remotely.
not my cmd... found on the web
geoip from maxmind
try to get the small utility via:
apt-get install geoip
More readable version of factorial calculation using standard desktop calculator instead of bc.
gpg -o- foo.tgz.gpg | tar zxvf -
This one has a better performance, as it is a one pass count with awk. For this script it might not matter, but for others it is a good optiomization.
"find ./ ..." could be replaced with "find $PWD ..." to display absolute path instead of relative path.
Pass the files path to finfo(), can be unix path, dos path, relative or absolute. The file is converted into an absolute nix path, then checked to see if it is in-fact a regular/existing file. Then converted into an absolute windows path and sent to "wmic". Then magic, you have windows file details right in the terminal. Uses: cygwin, cygpath, sed, and awk. Needs Windows WMI "wmic.exe" to be operational. The output is corrected for easy...
finfo "/cygdrive/c/Program Files/notepad.exe"