Change ownership of files and directories with Perl script

I came across this method of changing the ownership of files when working on a DataStage startup/shutdown script and changing the permissions on the logfiles the script creates. So I wrote a simple script that takes a username from input and a file name or multiple names from input and changes the owner and group of that directory. Also, I’m using Perl 3.x

Portable between Linux and Windows, or atleast should be. Not tested in Windows…

Linux, Perl Scripts, Tutorials/Whitepapers, Windows

One comment to Change ownership of files and directories with Perl script

  • triz

    By the way… usage is simple. “./chowner.pl” or perl -e chowner.pl then the script asks for user and then file or files… even directories.

    Reply

Leave a Reply

Comment
Name*
Mail*
Website*