Pages tagged with find

I'm still in the process of tagging pages that were migrated from the old site, so for now you're best off using the search engine rather than relying on the tags.

  • Remove old files by date in filename - I have backup scripts that create files with the backup date in their filename, in ISO 8601 format, as generated by date -I, as follows: mirrors.tgz-2015-12-31 This is year-month-day: mirrors.tgz-Y-m-d Every month I want to delete all old backu...
  • Find files containing a pattern - You can find files with grep or find with grep. Using grep grep -riHn [pattern] . This will recursively find all files under the current directory (and it’s subdirectories) that contain the given pattern. The flags are as follows: r recursive...
  • Find and replace - Notes on how to use the find command to find and replace text. Index Delete everything up to the first occurence of a regexp Keep everything between <START> and <END> Find and replace over multiple lines with sed Find and replace ...
  • Find notes - Notes on the Linux find command. Index Find multiple file names Find ignoring a file Find ignoring a file and a directory Find files with particular permissions Find files not owned by a particular user or group Change extension of multip...
  • Find filenames of a certain length - To find files whos filenames have a certain length, you can use various combinations of the ls, egrep and find commands. E.g. find files that have 9 characters followed by .txt: me@pc ~/tmp $ ls ?????????.txt analytics.txt capilinks.txt particles.t...

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top