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-04-2001, 06:27 PM   #1
Vexris
LQ Newbie
 
Registered: Jun 2001
Posts: 1

Rep: Reputation: 0

Hello all,

Was wondering how a I create a file with the name of -rf and then delete it with out deleting a directory or any other files

thanks for the help


[Edited by Vexris on 06-04-2001 at 07:30 PM]
 
Old 06-05-2001, 12:28 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
quote it.
to delete it use rm ./-rf

if a filename gets -REALLY- messy:
ls -i (get inode number)
find . -inum (inode number) -ok rm '{}' \;
 
Old 06-05-2001, 02:06 PM   #3
prowzen
Member
 
Registered: Apr 2001
Location: Canada
Distribution: RH 7.0,
Posts: 89

Rep: Reputation: 15
Hey unSpawn,
Could you please explain what all these funky symbols mean? Iam clear about find . -inum (inode number) -ok. But what does the rm '{}'\; do?
Isn't there a command that would return a filename from the inum so that we can do a getFileNameFromInode(inum) | rm which is a little bit more intuitive?
 
Old 06-05-2001, 04:27 PM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
The braces {} will be expanded into the file name that gets matched by find. They are ' ' quoted to try to stop the shell from using/expanding them. Use 'man find' for more details.

HTH

Jamie...
 
  


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
Create header file for existing .c file hk_michael Programming 5 02-25-2005 05:26 PM
Why can I not create a file? aroundtuit Linux - Newbie 14 09-07-2004 08:36 PM
create a new file biiiep Programming 1 04-23-2004 02:44 PM
Create file using 'touch ./tmp.$$', file tmp.3941 is created, why? huangyanfeng Linux - General 1 04-13-2004 03:36 AM
How can I create a .db file? nuzzy Linux - Software 0 07-31-2003 10:04 AM

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

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