Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save FrancoStino/76e79f4d48b07430fae003a26ade37b5 to your computer and use it in GitHub Desktop.
Save FrancoStino/76e79f4d48b07430fae003a26ade37b5 to your computer and use it in GitHub Desktop.
Using the find command to locate files owned by a specific group and changing ownership and permissions.

Change Ownership and Permissions for Files in a Directory

Preview:
sudo find /path/to/directory -group 100999 -exec chown davide:davide {} \; -exec chmod 775 {} \; ; echo "Operazione completata!"
Associated Context
Type Code Snippet ( .js )
Associated Tags sudo command Directory management Command line interface User interaction File creation Shell scripting Dev tools Data retrieval Error handling Output display
💡 Smart Description Using the find command to locate files owned by a specific group and changing ownership and permissions.
This code snippet searches for a directory named "Operazione completata" in the specified group, then copies and chmods it to 775. The executable is executed with an error message indicating that something went wrong.
🔎 Suggested Searches How to create a directory using sudo command in bash?
How to use shell script to find and execute files on Windows?
Using exec function to run commands when running an executable or executing it?
What is the purpose of operating system for working with windows?
How to add /path/to/directory() call after deleting data
Related Links https://www.geeksforgeeks.org/
https://www.geeksforgeeks.org/javascript-variables/
https://www.geeksforgeeks.org/javascript/
https://code.visualstudio.com/docs/editor/userdefinedsnippets#_creating-your-own-snippets
https://create-react-app.dev/docs/adding-custom-environment-variables/
https://learn.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings
Related People Davide Ladisa
Sensitive Information No Sensitive Information Detected
Shareable Link https://davideladisa.pieces.cloud/?p=4afd4e8a90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment