LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 07-26-2006, 02: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, 02:32 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,703
Blog Entries: 8

Rep: Reputation: 1616Reputation: 1616Reputation: 1616Reputation: 1616Reputation: 1616Reputation: 1616Reputation: 1616Reputation: 1616Reputation: 1616Reputation: 1616Reputation: 1616
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 06:16 PM.

Main Menu
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
Open Source Consulting | Domain Registration