O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2.1. find options

There are many options or expressions you can use with find, and each option is prefixed with a hyphen ‘-’. Let’s first go over the main options before we do any examples.

-name Find files by filename.
-perm Find files with different access or permission bits on a file.
-prune Use this option to stop find hitting the current dirrectory name specified; however, if you use the -depth option, then prune is ignored.
-user Find files by user ownership.
-group Find files that are a member of a certain group.
-mtime -n +n Find files that were accessed or modified less ‘-’ than or more ‘+’ than x days ago. There is also an atime and ctime option with find, but they all do practically the same thing, so we’ll just look at mtime.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required