https://github.com/kioubit/chownshift
Shift UIDs,GIDs of directories or files by a specified amount
https://github.com/kioubit/chownshift
chown linux-shell lxc lxc-containers
Last synced: about 1 year ago
JSON representation
Shift UIDs,GIDs of directories or files by a specified amount
- Host: GitHub
- URL: https://github.com/kioubit/chownshift
- Owner: Kioubit
- License: gpl-3.0
- Created: 2022-10-09T12:30:50.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-09T15:12:44.000Z (over 3 years ago)
- Last Synced: 2025-01-30T21:33:54.435Z (over 1 year ago)
- Topics: chown, linux-shell, lxc, lxc-containers
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ChownShift
## Shift UIDs,GIDs of directories or files by a specified amount
### Features
* Optional recursion mode
* Supports hardlinks, symlinks without following them
* Preserves file modes/permissions by default (including setuid)
### Example
# ls -la
drwxr-xr-x 2 user user 4096 Oct 9 15:08 .
drwxr-xr-x 3 user user 4096 Oct 9 15:16 ..
-rw-r--r-- 1 2000 2000 0 Oct 9 15:08 testfile
drwxr-xr-x 2 2000 2000 4096 Oct 9 15:08 testdirectory
# chownshift -1 . --recursive # Shift UIDs and GIDs by -1
# ls -la
drwxr-xr-x 2 user user 4096 Oct 9 15:08 .
drwxr-xr-x 3 user user 4096 Oct 9 15:16 ..
-rw-r--r-- 1 1999 1999 0 Oct 9 15:08 testfile
drwxr-xr-x 2 1999 1999 4096 Oct 9 15:08 testdirectory
### Usage
Usage: chownshift [Optional Arguments]
Mandatory Arguments:
: A positive or negative integer denoting the amount of UIDs and GIDs the files in path are to be shifted by
: The target path to a file or directory
Optional Arguments:
--recursive Recurse though the path provided
--verbose Verbose output
--nopermissions Do not preserve permissions
--dry-run Simulate only
--help Show this message
Exit codes: 0 - Success, 1 - Error, 2 - Argument error