Uses xargs to call the second grep with the first grep's results as arguments
Unless you have files that include 'svn' in them, this should provide enough information to be useful. If you need to be certain, add the leading dot in the search pattern
Substitute that 724349691704 with an UPC of a CD you have at hand, and (hopefully) this oneliner should return the $Artist - $Title, querying discogs.com. Yes, I know, all that head/tail/grep crap can be improved with a single sed command, feel free to send "patches" :D Enjoy! Show Sample Output
Deletes capistrano-style release directories (except that there are dashes between the YYYY-MM-DD) Show Sample Output
Same as 7272 but that one was too dangerous so i added -P to prompt users to continue or cancel Note the double space: "...^ii␣␣linux-image-2..." Like 5813, but fixes two bugs: [1]This leaves the meta-packages 'linux-headers-generic' and 'linux-image-generic' alone so that automatic upgrades work correctly in the future. [2]Kernels newer than the currently running one are left alone (this can happen if you didn't reboot after installing a new kernel).
chrome only lets you export in html format, with a lot of table junk, this command will just export the titles of the links and the links without all that extra junk Show Sample Output
There's nothing particularly novel about this combination of find, grep, and wc, I'm just putting it here in case I want it again. Show Sample Output
fileName /path/to/file.ext
quivalent to
basename /path/to/file.ext
Show Sample Output
This will recursively go through every file under the current directory showing all lines containing "TODO" as well as 10 lines after it. The output will be marked with line numbers to make it easier to find where the TODO is in the actual file.
calls grep on all non-binary files returned by find on its current working directory Show Sample Output
needs grep what supports '--recursive' Show Sample Output
simple table
On wired connections set 'eth0' instead of 'wlan0'
Open Port Check
Function that searchs a process by its name and shows in the terminal. * Shows the Header for reference * Hides the process 'grep' from the list * Case sensitive Show Sample Output
Replace "en1" with your network interface (on OS X, usually en0, en1, eth0, etc..) Show Sample Output
Greps located files for an expression.
Example greps all LaTeX files for 'foo':
locate *.tex | xargs grep foo
To avoid searching thousands of files with grep it could be usefull to test first how much files are returned by locate:
locate -c *.tex
grep's -c outputs how may matches there are for a given file as "file:N", cut takes the N's and awk does the sum. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.
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: