GithubHelp home page GithubHelp logo

kioubit / chownshift Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 16 KB

Shift UIDs,GIDs of directories or files by a specified amount

License: GNU General Public License v3.0

Go 85.76% Makefile 14.24%
chown linux-shell lxc lxc-containers

chownshift's Introduction

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 <difference> <path> [Optional Arguments]
Mandatory Arguments:
<difference>: A positive or negative integer denoting the amount of UIDs and GIDs the files in path are to be shifted by
<path>: 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

chownshift's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.