LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-03-2004, 06:23 AM   #1
manikanth04
LQ Newbie
 
Registered: Feb 2004
Posts: 1

Rep: Reputation: 0
how to delete file created as cat > --vp


any one please tell me

how to delete a file created as #cat > --vp

the file being created is '--vp'

thank you
 
Old 10-03-2004, 06:44 AM   #2
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
I'm not sure ...

./rm --help

says
Quote:
To remove a file whose name starts with a `-', for example `-foo',
use one of these commands:
rm -- -foo

rm ./-foo
maybe thats what you want?
 
Old 10-03-2004, 06:51 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
There are several ways of doing this:

- 'Special' file is: /home/user/--vp
- You are in /home/user

$ rm ../user/--vp

This wil not work if the file is in the root (/) dir.

The following will always work (although it's a bit more work):

1) find the inode that belongs to the special file.
2) use find and the found inode number

$ ls -laqi
195129 -rw-r----- 1 user users 0 Oct 3 13:48 --vp
195073 drwx------ 4 user users 4096 Oct 3 13:48 .
32513 drwx------ 34 user users 4096 Oct 3 13:13 ..

The bold entry is the inode number you are looking for

$ find -inum 195129 -ok rm {} \;

If you don't like the < rm ... ./--vp > ? safety net, change -ok with -exec.

The above option is failsafe.

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
trying to redirect text to a file to cat at later point. says file doesn't exist. dr_zayus69 Programming 1 10-02-2005 08:10 AM
Delete partition created by YAST trying to install SUSE 9.2 giuliano1 Linux - Newbie 1 05-03-2005 11:14 PM
If I delete files are new ones created?? BajaNick Linux - Software 1 07-06-2004 11:07 PM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM
delete fle #a.c# created by emacs herambshembekar Linux - Newbie 4 02-28-2002 11:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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