Showing posts with label permissions. Show all posts
Showing posts with label permissions. Show all posts

Thursday, June 11, 2026

Change permissions with find command example.

 Basic Example: Find and chmod
To find and delete all .log files in the current directory and its subdirectories, use this command: [1, 2, 3]
bash
find .  -exec chmod 777 {} \;
Use code with caution.
Understanding the Syntax Breakdown
  • find .: Starts the search in the current directory.
  • options follow
  • -type f: Restricts the search specifically to files, ignoring folders.
  • -name "*.log": Matches files with a .log extension.
  • -exec: Tells find to run a command on every match.
  • chmod 777: The external command you want to run.
  • {}: A placeholder that find dynamically replaces with the filename of each match.
  • \;: Terminates the -exec sequence. The backslash escapes the semicolon so your shell does not process it first.

Thursday, June 5, 2025

Sunday, November 3, 2019

Find directories of certain (744) permissions and change them to 755




For some reason some directories are set to 744 permission from when saved from some systems. 

They need to be 755 for the system to properly back them up.

This will change the permissions with a chmod after showing them.
find . -type d -perm 744 -print -exec ls -ld {} \;

find . -type d -perm 744 -exec chmod 755 {} \;

Nice page of examples of chmod is here

https://www.tecmint.com/35-practical-examples-of-linux-find-command/

--30--