LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-26-2006, 03:25 PM   #1
yuchai
Member
 
Registered: Jan 2005
Location: New York, NY
Distribution: Slackware 13.0
Posts: 56

Rep: Reputation: 15
Removing a file named like a command flag


I messed up on a tar command and ended up with a file named "--exclude=tmp"

When I try to use rm to remove it, it thinks the "--exclude=tmp" is a flag and gives me an error.

Code:
root@livingroom:/home/yuchai/backup/fileserve# ls -al
total 312200
-rw-r--r--  1 root   root   35549184 2006-07-26 15:08 --exclude=tmp
drwxr-xr-x  2 yuchai users       144 2006-07-26 15:15 .
drwxr-xr-x  3 yuchai users        49 2005-10-03 11:38 ..
-rw-r--r--  1 yuchai users   9637939 2005-10-03 13:27 backupetc.tar.gz
-rw-r--r--  1 yuchai users       776 2005-10-06 21:42 fstab
-rw-r--r--  1 yuchai users      1092 2005-10-03 11:38 lilo.conf
-rw-r--r--  1 yuchai users      1143 2005-10-06 21:42 local.conf
-rw-r--r--  1 root   root  274309120 2006-07-26 15:21 root.tar.bz2
-rw-r--r--  1 yuchai users       730 2005-10-03 11:46 smb.conf
-rw-r--r--  1 yuchai users     20140 2005-10-03 11:46 xorg.conf
root@livingroom:/home/yuchai/backup/fileserve# rm --exclude\=tmp
rm: unrecognized option `--exclude=tmp'
Try `rm --help' for more information.
How do I remove this file?
 
Old 07-26-2006, 03:32 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

As stated in the rm manpage:

rm -- --exclude=tmp

or

rm ./--exclude=tmp

Hope this helps.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write command in named pipes sahel Programming 7 12-28-2005 07:05 AM
Flag question of Tar command satimis Linux - General 8 06-28-2005 10:59 AM
Modify named.conf file pkrishna10 Linux - Networking 3 10-22-2004 02:03 PM
named default configuration file computerguy121 Linux - Networking 2 01-03-2003 09:09 AM
DNS and named.local file Breezwell Linux - Networking 0 04-23-2001 08:05 PM


All times are GMT -5. The time now is 04: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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration