Skip to content

Script to reassign ownership of files in target directory to that of the current user/group that ran the script.

License

Notifications You must be signed in to change notification settings

ryanpaixao/reassign-ownership

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reassign-ownership

Script to reassign ownership of files in target directory to that of the current user/group that ran the script.

Before:

ls -l Before

During:

While script is running

After:

ls -l After

Instructions

  1. Clone the repository locally to your machine.

    • Open up terminal
    • Go to desired directory e.g. cd ~\myNewDirectory
    • Enter in git clone https://github.com/ryanpaixao/iphoto-dirtree-to-flat-tree
  2. Go into newly cloned repository's directory

    • Enter in cd ./iphoto-dirtree-to-flat-tree
  3. Run the ownership_changer.sh script

    • Enter in ./ownership_changer.sh
      • A prompt will appear asking if you want go ahead and make the changes.
    • Enter in y
      • A prompt will appear asking you to enter in your root password
    • Enter in your root password

Example

  • If the user is "DeeUser", and group is "DeeGroup"
  • And the files in /home/DeeUser/Pictures belong to 'root' user and group
  • Enter in ./ownership_changer.sh /home/DeeUser/Pictures
  • The files will then belong to user "DeeUser" and group "DeeGroup" as well as have 644 permissions

About

Script to reassign ownership of files in target directory to that of the current user/group that ran the script.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages