I need to use the tar command to unpack a .tar.gz file and I need to do it from root but when the files unpack I want them to be owned by a specific user, not the root user. Can someone give me a hand?. I found the man pages confusing.
Jump to Post
The easiest is probably to use
chownto change the owner of the directory after you've extracted it. And you can use
chmodtoo to remove some permissions for group and others too.
Let's say you have the file
my_archive.tar.gzwhich contains a top-level directory called
my_folder, and the user …
All 4 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.