Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can I extract a tar as special user?

Posted on 2008-10-17
4
Medium Priority
?
316 Views
Last Modified: 2013-12-16
My special username is:
user123

My special password is:
password123

This is how I extract files from a tar:
tar xf tar.tar

When I am logged in as "foo" how can I extract the files from a tar as user123 so they are owned by user123?

0
Comment
Question by:hankknight
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
zerodollars earned 1000 total points
ID: 22743541
use the 'su' command.

type 'man su' to get the help manual up and it will give you all the available info on it.
0
 
LVL 9

Assisted Solution

by:michofreiha
michofreiha earned 1000 total points
ID: 22743627
use sudo su and extract the file
0
 
LVL 16

Author Comment

by:hankknight
ID: 22743816
Could you please be more specific?

I am doing this from PHP so I have only one line to do it in:

<?php  shell_exec('tar xf tar.tar'); ?>
0
 
LVL 16

Author Comment

by:hankknight
ID: 22744053
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question