LinuxQuestions.org
Review your favorite Linux distribution.
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 06-14-2015, 07:12 PM   #1
jzoudavy
Member
 
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

Rep: Reputation: Disabled
why can't I remove my own files


hi experts

quick question here:
I created a file under tmp as test. but when I tried to remove it, I couldn't. I get permission not permitted. Is it because tmp is owned by root and therefore I have to be root to do it?

Thanks

Code:
test@test-virtual-machine:/tmp$ who
test     pts/8        2015-06-14 20:01 (192.168.15.1)

test@test-virtual-machine:/tmp$ ls -lart

-rw-rw-r--  1 test test 2480 Jun 14 20:05 appendit

test@test-virtual-machine:/tmp$ rm appendit
rm: cannot remove ‘appendit’: Operation not permitted
 
Old 06-14-2015, 07:52 PM   #2
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
Quote:
I have to be root to do it?
Correct.
 
Old 06-14-2015, 08:29 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
You should be able to delete that - sounds like the /tmp wasn't set up correctly with the restricted deletion flag (aka sticky bit).
Have you moved /tmp ?.
 
Old 06-14-2015, 09:07 PM   #4
ceyx
Member
 
Registered: May 2009
Location: Fort Langley BC
Distribution: Kubuntu,Free BSD,OSX,Windows
Posts: 342

Rep: Reputation: 59
I stand corrected.

Last edited by ceyx; 06-14-2015 at 09:26 PM.
 
Old 06-15-2015, 12:26 AM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Though the file has rw permissions for your user and you can edit it but deleting requires correct permission of the directory containing it. Your /tmp should have rwx permissions for your user.

The usual permission for /tmp is '1777'.

Set it with:

Code:
chmod 1777 /tmp
 
Old 06-15-2015, 02:22 AM   #6
rpittala
Member
 
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 102
Blog Entries: 1

Rep: Reputation: Disabled
try using the super user privileges
Quote:
sudo su
and try deleting it
 
  


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
[SOLVED] remove readme files from a large group of *.zip files with a command line function thealmightyos Linux - General 1 08-14-2014 04:24 PM
How to overwrite existing files by using tar command (Remove extra files) Kalibo Linux - Newbie 9 12-26-2013 12:42 AM
remove device and associated files tombo465 Linux - Newbie 5 10-06-2008 10:41 PM
Cannot remove files poin04 Linux - Newbie 15 05-16-2008 02:58 AM
remove ~ from all files and folders BoraX Linux - General 1 10-25-2006 07:58 PM

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

All times are GMT -5. The time now is 02:52 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