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.
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:
Very similar as doing "wget http://example.com/mytarball|tar xzv", this one involves the "tee" command between both, which will simultaneously write the tarball and copy it to stdout. So this command will locally save the tarball and extract it - both at the same time while it downloads.
1.- Enter into the playlist path.
2.- Run the command.
3.- Playlists created!
I couldn't find this on the site and it's a useful switch. Great for large files.
If you have to deal with MS Sharepoint which is (rarely, let's hope) used in e.g. certain corporate environments).
This uses Cntlm.
For single files, just use cURL -- its NTLM authentication works quite well.
# /etc/cntlm.conf:
# Username account
# Domain domain
# Password ############
# Proxy 10.20.30.40 (IP of the sharepoint site)
# NoProxy *
# Listen 3128
In this example, where the users gpg keyring has a password, the user will be interactively prompted for the keyring password.
If the keyring has no password, same as above, sans the prompt. Suitable for cron jobs.
~/.gnupg/passwd/http-auth.gpg is the encrypted http auth password, for this particular wget use case.
This approach has many use cases.
example bash functions:
function http_auth_pass() { gpg2 --decrypt ~/.gnupg/passwd/http-auth.gpg 2>/dev/null; }
function decrypt_pass() { gpg2 --decrypt ~/.gnupg/passwd/"$1" 2>/dev/null; }
This command should be copy-pasted in Windows, but very similar one will work on Linux.
It uses wget and sed.
Tries to avoid the fragile nature of scrapers by looking for user-input in the output as opposed to markup or headers on the web site.
Like i said, i havent test it yet, all becouse my internet its soo slow, if you try and works please share, also be nice to do it using the direct url link.
This will take the packages matching a given `apt-cache search` query (a collection of AND'd words or regexps) and tell you how popular they are. This is particularly nice for those times you have to figure out which solution to use for e.g. a PDF reader or a VNC client.
Substitute "ubuntu.com" for "debian.org" if you want this to use Ubuntu's data instead. Everything else will work perfectly.
you may want &hl=en for &hl=es for the language
you may want imgsz=xxlarge for imgsz=large or whatever filter
you may want q=apples or whatever
Doesn't depend on curl and doesn't use thumbnails as wallpaper (which has the unfortunate effect of only allowing imgur links)
I used to use the Firefox "View page info" feature a lot to determine how stale the web page I was looking at was. Now that I use mostly Chrome I miss that feature, so here is a command line alternative using wget. The -S says to display the server response, the --spider says to not download any files/pages, just fetch the header. The output goes to stderr, so to grep it you use 2>&1 to combine the stderr stream with stdout, the pipe that to grep for Last-Modified.
You can use curl instead if you have it installed, like this:
curl --head -s http://osswin.sourceforge.net | grep Mod
A simple script for download all the MegaTokyo strips from the first to the last one
Grabs the current weather in your area (or their best guess of your area). Change the query to your zip code/location (e.g. google.com/search?q=weather+jakarta,+india) to get weather somewhere else. change google.com to google.ca or google.co.uk for metric.