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:
You want bash to keep running the command until it is successful (until the exit code is 0). Give a dummy command, which sets the exit code to 1 then keep running your command until it exits cleanly
Instead of dumping the entire query to the screen, it will use 'less -S' to handle pagination. This means you can move back and forward through the result set, and instead of wrapping rows at screen boundaries, the table will extend off the screen, and can be scrolled left and right with arrow keys.
1. Get name of task by task=$(basename "$(pwd)")
2. Check whether "$task.c" exists as a file
3. open "$task.c", "$task.in", "task.out" in vim with such layout.
| | $task.in |
| | |
| | $task.out |
| | |
This is a bit hacky, but if you're setting up a bunch of new LUNs, it can save a bunch of time. Also check out sfdisk. The fdisk will fail if, for example, a partition table already exists.
* Make a FIFO file named replypipe
* listen on 1234
* pass the request to unix socket
* unix socket will reply to replypipe
* replypipe will write reply to the client
From a saved page of google search results, split out all of the links for the results. Useful for creating apache rewrite rules from.
Use this to make a launcher for Java apps ( .jar files ) such as with jdownloader
joins multiple lines to create single line with comma separated values. for example if we have an email addresses one per line (copy&paste from spreadsheet) it will oputput one line with comman separated addresses to put it to email client.
This is helpful if you connect to several networks with different subnets such as 192 networks, 10 networks, etc. Cuts first three octets of ip from ifconfig command and runs nmap ping scan on that subnet.
Replace wlan0 with your interface. Assumes class c network, if class b use: cut -d "." -f 1-2 and change nmap command accordingly.
This shows a list of channels from seeon.tv website to watch shows and movies
Very useful for finding the largest files and subdirectories at any given point. Any user can run it from current location just when need to know their largest files and subtdirectories from a certain point down as well.
This will change the ownership of /../../somedirectory as well as all its subdirectories so they will be be owned by user2 - typically used when a directory is owned by root:root
Puts words on new lines, removing additional newlines.
Converts all ogg files to mp3 files in the current directory.
Open Port Check
I'm sure almost everybody knows this by now. This command will pull the password for the admin login of any plesk machine.
mencoder mf://filemask -mf
option availble for mf :
* w=value : the width of the output, by d?fault : autodetected
* h=value : height of the output, by default : autodetected
* fps=value : framerate of the output, by default : 25
* type=value : file format type input , avaible: jpeg, png, tga, sgi
Without the -dump option the header is displayed in lynx. You can also use w3m, the command then is
w3m -dump_head http://www.example.com/
This is a dirty raw way to simply list ELF objects in a folder.
The output is ready to be parsed i.e to the stripper or what else needs a path to an ELF object.
The -d flag sets the lifetime of a metric and defaults to 0 hence why old metrics continue to be graphed in the dashboard. Submitting a dummy value and short lifetime ensures that the metric is removed from the dashboard.
This is a bit of a hack, but it will get your fwguid which is needed sometimes when using your iPod.