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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-04-2001, 06:27 PM
|
#1
|
LQ Newbie
Registered: Jun 2001
Posts: 1
Rep:
|
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]
|
|
|
06-05-2001, 12:28 AM
|
#2
|
Moderator
Registered: May 2001
Posts: 29,417
|
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 '{}' \;
|
|
|
06-05-2001, 02:06 PM
|
#3
|
Member
Registered: Apr 2001
Location: Canada
Distribution: RH 7.0,
Posts: 89
Rep:
|
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?
|
|
|
06-05-2001, 04:27 PM
|
#4
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
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...
|
|
|
All times are GMT -5. The time now is 12:39 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|