Commands using find (1,252)

What's this?

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.

Share Your Commands


Check These Out

Mac osx friendly version of this terminal typing command at 200ms per key

Create a new file

Convert clipboard HTML content to markdown (for github, trello, etc)
I always wanted to be able to copy formatted HTML, like from emails, on trello cards or READMEs... but the formatting is always wrong... But from this two links: * https://jeremywsherman.com/blog/2012/02/08/pasting-html-into-markdown/ * http://stackoverflow.com/questions/3261379/getting-html-source-or-rich-text-from-the-x-clipboard For instance, to to copy an formatted email to a trello card, just: 1. Select the email body 2. run: xclip -selection clipboard -o -t text/html | pandoc -f html -t markdown_github - | xclip -i -t text/plain 3. Paste in your trello card 4. Profit! 8-)

Rename files in batch

Get absolut path to your bash-script
Another way of doing it that's a bit clearer. I'm a fan of readable code.

Colorize svn stat
Use color escape sequences and sed to colorize the output of svn stat -u. Colors: http://www.faqs.org/docs/abs/HTML/colorizing.html svn stat characters: http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.ref.svn.c.status GNU Extensions for Escapes in Regular Expressions: http://www.gnu.org/software/sed/manual/html_node/Escapes.html

list block devices
Shows all block devices in a tree with descruptions of what they are.

If (and only if) the variable is not set, prompt users and give them a default option already filled in.
The read command reads input and puts it into a variable. With -i you set an initial value. In this case I used a known environment variable.

Search for a string inside all files in the current directory

Check ps output to see if file is running, if not start it
This comes in handy if you have daemons/programs that have potential issues and stop/disappear, etc., can be run in cron to ensure that a program remains up no matter what. Be advised though, if a program did core out, you'd likely want to know why (gdb) so use with caution on production machines.


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: