Solved

Can I extract a tar as special user?

Posted on 2008-10-17
4
310 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 250 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 250 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
awk sed 8 102
android secure ftp 3 70
awk file 6 98
Why would ubuntu server 16.04 compress so many small access.log.gz files? 4 33
This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

740 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