0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

find all files or directories and execute one command recursively

Last updated at Posted at 2016-08-10

You can find files or directories and execute one command recursively by the following command.
Please do not forget to the ; at the end of the command.

$ find ./ -type d | f -exec command {} \;

e.g.

  1. find all directories and change their permission

    $ find ./ -type d -exec chmod 750 {} \;

  2. find all files and change the owner and group with apache

    $ find ./ -type f -exec chown apache. {} \;

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?