LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-08-2008, 11:37 AM   #1
alenD
Member
 
Registered: Jul 2005
Posts: 69

Rep: Reputation: 15
tar question


when i use
tar cvzf mytar.tgz mydir
as as a user i get
tar: mytar.tgz: Cannot open: Permission denied

when i do the same as root it works fine
when, as a user, i enter mydir and do
tar cvzf mytar.tgz *
everything works fine again

i changed the permissions of mydir but the problem seems to be somewhere else. .. but cannot figure out where?

thnx
 
Old 10-08-2008, 11:51 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,633

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by alenD View Post
when i use
tar cvzf mytar.tgz mydir
as as a user i get
tar: mytar.tgz: Cannot open: Permission denied

when i do the same as root it works fine
when, as a user, i enter mydir and do
tar cvzf mytar.tgz *
everything works fine again

i changed the permissions of mydir but the problem seems to be somewhere else. .. but cannot figure out where?

thnx
The permissions on the directory you're in allow read, but not write. When you go into the mydir directory, you've obviously got write permissions.

Either chown the upper-level directory to be owned by you, or chmod it to allow writing by your user ID's group.
 
Old 10-08-2008, 11:57 AM   #3
linuxman8786
Member
 
Registered: Sep 2008
Posts: 43

Rep: Reputation: 15
Quote:
Originally Posted by TB0ne View Post
The permissions on the directory you're in allow read, but not write. When you go into the mydir directory, you've obviously got write permissions.

Either chown the upper-level directory to be owned by you, or chmod it to allow writing by your user ID's group.
you try to you super root, like sudo in ubuntu

Last edited by Tinkster; 10-30-2010 at 03:49 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
tar.gz question <---NOOOOOB QUESTION jairo Linux - Software 4 02-17-2003 05:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration