The power of find command in Linux – advanced.

2010-05-24 2 min read Linux

Generally whoever uses Linux, would know about the find command. Find the man page <a href="http://amit.themafia.info/phpMan.php?parameter=find&mode=man" target="_blank">here.

There are also lots of blogs, tutorials and other articles on find command on the web, so why write another one. Because it&#8217;s worth every word spent on it πŸ™‚
find is a very powerful command, let&#8217;s see how (options for find command from man page and usage):

–depth β€” Process each directory&#8217;s contents before the directory itself.
–maxdepth β€” Descend at most <span style="text-decoration: underline;">levels (a non-negative integer) levels of directories below the command line arguments.
–xdev β€” Don&#8217;t descend directories on other filesystems.
–executable β€” Matches files which are executable and directories which are searchable (in a file name resolution sense).
This takes into account access control lists and other permissions artefacts which the -perm test ignores.
–iname β€” Like -name, but the match is case insensitive.
–nogroup β€” No group corresponds to file&#8217;s numeric group ID.
–nouser β€” No user corresponds to file&#8217;s numeric user ID.
–fls <span style="text-decoration: underline;">file β€” True; like -ls but write to <span style="text-decoration: underline;">file like -fprint.
–ok <span style="text-decoration: underline;">command β€” Like -exec but ask the user first (on the standard input);
–print0 β€” True; print the full file name on the standard output, followed by a null character
(instead of the newline character that -print uses).
–printf <span style="text-decoration: underline;">format β€” True; print <span style="text-decoration: underline;">format on the standard output, interpreting &#8217;&#8217; escapes and &#8217;%&#8217; directives.

Continue reading

Advanced Sed Substitution Examples

2010-04-11 1 min read Bash Linux

This article is part of the on-going Unix Sed Tips and Tricks series. In our previous sed articles we learned β€” sed printing, sed deletion, sed substitute , sed file write, and sed multiple commands. In this article, let us review some interesting workarounds with the β€œs” substitute command in sed with several practical examples. I. […]

Read More: <a href="http://www.thegeekstuff.com/2009/10/unix-sed-tutorial-advanced-sed-substitution-examples/">Unix Sed Tutorial: Advanced Sed Substitution Examples

URL: <a href="http://feedproxy.google.com/~r/TheGeekStuff/~3/uN-cE6UOvfA/">http://feedproxy.google.com/~r/TheGeekStuff/~3/uN-cE6UOvfA/<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.slumpedoverkeyboarddead.com/2009/08/06/vim-video-tutorial/">VIM video tutorial (slumpedoverkeyboarddead.com) <li class="zemanta-article-ul-li"><a href="http://www.slumpedoverkeyboarddead.com/2009/08/22/turn-vim-or-emacs-into-and-ide-with-exuberant-ctags/">Turn Vim or Emacs Into and IDE With Exuberant-Ctags (slumpedoverkeyboarddead.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/0d68ebaf-6fc5-419a-a31c-7d31bc55ab3f/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e8.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">

Continue reading