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:
This will find all files in the path "." which are older than 10*24hrs (10 days). This will find any type of file.
You don't need this command often and there are other ways to test output but if you want to be sure if your router and ethernet card are working this is one way.
For Solaris to obtain the same as:
date+%s like in linux
Outputs the PID of any given file run from a command line... Hope it helps!
Count on a specific port (80) - FreeBSD friendly.
-i sets the source file
-f and -acodec both set the output to be raw audio, PCM signed 16-bit little endian
find ip address in all files in /etc directory. can be used to find any string in any directory really
dumpfile is a CSV file, which its 1st field is a phone number in format CC+10 digits
Empty lines are deleted, before the output in format "prefix,ocurrences"
Creates a PDF file where each page will be a layer from de original TIFF file.
You can apply many other filters and transformations.
convert multi_layer.tif -page a4 -compress jpg multi_page.pdf
To set the page size
convert multi_layer.tif -crop 590x790+20+30 -compress jpg multi_page.pdf
To include only a portion of the image (discard first horizontal 20 pixels and first vertical 30 pixels, include the next 590 horizontal and 790 vertical pixels)
convert multi_layer.tif -delete 1,3,5-10 -compress jpg multi_page.pdf
Discard mentioned layers
adding users to groups on OS X is not a straightforward process, you need to use the new in built in Directory Service command line utility...
Let's supose some moron used some m$ shit to commit to a later svnsynced repo. On a svn sync all his message logs cause a svnsync: Error setting property 'log': this commands finds all its contributions and fix all his commit logs
since awk was already there one can use it instead of the 2 greps. might not be faster, but fast enough
this is the much easier zsh equivalent ...
This command will enable dns spoofing through ettercap. The etter.dns config file must be set. The -i parameter defines the interface, e.g. eth0, eth1, wlan0...
ettercap -h for more info
Credit goes to xhabie-crew