Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

find and exec Commands

find and exec Commands

A very common command-line need is to locate all the files within a directory and all its subdirectories with a certain attribute and run some command on them. For instance, let’s say I wanted to move all files that end in .txt within my current directory and all the directories below it into the ~/Documents directory. If you wanted to just list all of the files, you would run the following find command:

$ find ./ -name "*.txt"


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint