LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-16-2009, 11:47 AM   #1
wave05
LQ Newbie
 
Registered: May 2009
Posts: 7

Rep: Reputation: 0
Can't Delete File


Hi,

I accidentally created a file with emacs:
-rw-r--r-- 1 ron ntools 6 May 16 11:22 #ipics#

Now I can't delete it or change it with chmod...

How do I kill this thing???
 
Old 05-16-2009, 11:50 AM   #2
jens1245
LQ Newbie
 
Registered: May 2009
Posts: 18

Rep: Reputation: 5
rm /path/to/file/file to remove file
with root permissions

or chown user /path/to/file/file
with root permissions to change owner
 
Old 05-16-2009, 11:58 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Try to escape the first charachter or to embed the whole name in single quotes, otherwise it is interpreted as a comment:
Code:
$ rm '#ipics#'
$ rm \#ipics#
 
Old 05-16-2009, 12:00 PM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
The # indicates a comment and rm will tell you that it is missing an operand; try

Code:
rm \#pics\#
 
Old 05-16-2009, 12:01 PM   #5
wave05
LQ Newbie
 
Registered: May 2009
Posts: 7

Original Poster
Rep: Reputation: 0
SU worked THANKS!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
text match pipe to file then delete from original text file create new dir automatic tr1px Linux - Newbie 6 09-10-2008 10:40 PM
how to delete last number/word of a file and incude file count at the end of the chennaiguy Linux - Newbie 2 02-18-2008 10:08 PM
how to delete a particular file from tar file majalee Linux - Software 2 07-12-2006 05:53 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 03:46 AM
Delete contents of the file, but not file? mikeshn Linux - General 9 05-28-2003 07:47 AM


All times are GMT -5. The time now is 10:38 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration