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:
Like this you can continue a suspended job without blocking again your terminal
Show If Someone Is Connected To The Android Device On And Get Their IP Address
Given a bunch of files with "wrong" date naming, it renames them in a "good" format.
Everytime You Run Bash It Will Run And Send The Command To Background In A Loop Forever. This Is Useful In Android To Avoid Getting Discconnected While Using ADB Or Other Services Like SSH By Being Inactive For Long Periods Of Time. In My Case I Get Bash Full Suport Only Through ADB And Also A Decent Python Interpreter Using Python For Android.
Before you use this command you want to replace everything after the "https:" with the url of the video which you want to download. This string and it's switches will use "youtube-dl" to download the Youtube url into the directory/folder where it is called from. It will output the video using the same name as Youtube uses.
World Cup Live Score of the ongoing match.
Alternative to have the live score with the match statistics:
watch -n10 --no-title "w3m http://www.livescore.com/ |awk '/live [0-9H]+[^ ]/,/red cards/'"
Useful if you don't have at hand the ability to automatically create a booklet, but still want to.
F is the number of pages to print. It *must* be a multiple of 4; append extra blank pages if needed.
In evince, these are the steps to print it, adapted from https://help.gnome.org/users/evince/stable/duplex-npage.html.en :
1) Click File ▸ Print.
2) Choose the General tab.
Under Range, choose Pages.
Type the numbers of the pages in this order (this is what this one-liner does for you):
n, 1, 2, n-1, n-2, 3, 4, n-3, n-4, 5, 6, n-5, n-6, 7, 8, n-7, n-8, 9, 10, n-9, n-10, 11, 12, n-11...
...until you have typed n-number of pages.
3) Choose the Page Setup tab.
- Assuming a duplex printer:
Under Layout, in the Two-side menu, select Short Edge (Flip).
- If you can only print on one side, you have to print twice, one for the odd pages and one for the even pages.
In the Pages per side option, select 2.
In the Page ordering menu, select Left to right.
4) Click Print.
for i rang(10) = length of the password
random.choice("abcdefghijklmnopqrstuvwxyz...") = char allowed into the password
Thanks Python/Django FAQ's.
translate some text
Change lang from ru to something else.
Generate a truly random password using noise from your microphone to seed the RNG. This will spit out 12 password with 12 characters each, but you can save this into a bash script and replace 'pwgen -ys 12 12' with 'pwgen $@' so you can pass any paramters to pwgen as you would normally do.
This is like using cat to see the contents of several small files at once, but using 'more' to add a header to each one.
Tunneling an SSH session through TOR for anonymity.
Using openbsd's netcat.
Tested on Ubuntu 14.04
This also works with any proxy type: http, socks4 and socks5
For http proxy, replace -X 5 with -X connect
For socks4 proxy, replace -X 5 with -X 4 (DNS leak may occur)
Proxy host defined after -x
Replace -x localhost:9050 with proxy server of your choice
capture only ping echo requests with tcpdump
What's wrong with this?
Chronometer using the bc calculator.
Client ~$ ncat --ssl localhost 9876
Change localhost to the correct ip address.
Use case insensitive regex to match files ending in popular video format extensions and calculate their total time. (traverses all files recursively starting from the current directory)
Pressing a key will now repeat normally, instead of bringing up the accent/more options menu.