Skip to content

turulomio/recpermissions

Repository files navigation

Recpermissions PyPI - Downloads Tests

Recpermissions is a Python script to change Linux permissions and ownership in one step. It can delete empty directories when necessary.

This script doesn't work on Windows.

Usage

recpermissions

Recursively changes the ownership and permissions for all files and directories within a given absolute path.

recpermissions --user <user> --group <group> --files <PERM> --directories <PERM> <absolute_path>

Arguments:

  • --user <user>: The new owner for the files and directories.
  • --group <group>: The new group for the files and directories.
  • --files <PERM>: The octal permissions to set for all files (e.g., 644).
  • --directories <PERM>: The octal permissions to set for all directories (e.g., 755).
  • <absolute_path>: The absolute path to the directory to process.

remove-empty-dirs

Recursively finds and deletes empty directories within a given path.

remove-empty-dirs [--pretend] <absolute_path>

Arguments:

  • --pretend: If used, the script will only list the empty directories that would be deleted, without actually deleting them.
  • <absolute_path>: The absolute path to the directory to scan for empty subdirectories.

About

Script to change permissions and owner recursivily from current directory

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages