LinuxQuestions.org
Visit Jeremy's Blog.
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 10-07-2008, 02:25 PM   #1
erick.szekely
LQ Newbie
 
Registered: Oct 2008
Distribution: fedora 9, ubuntu
Posts: 3

Rep: Reputation: 0
echo hello > -f (how do i delete it)


how do i delete a file when it was created like this,
my instructor had us create it and now we have to delete it
 
Old 10-07-2008, 02:29 PM   #2
Total-MAdMaN
Member
 
Registered: May 2008
Distribution: Gentoo
Posts: 306

Rep: Reputation: 34
Asking for help with schoolwork isn't allowed.
 
Old 10-07-2008, 02:40 PM   #3
erick.szekely
LQ Newbie
 
Registered: Oct 2008
Distribution: fedora 9, ubuntu
Posts: 3

Original Poster
Rep: Reputation: 0
its not school work
the test is over and now i want to know how to do it
 
Old 10-07-2008, 02:55 PM   #4
Total-MAdMaN
Member
 
Registered: May 2008
Distribution: Gentoo
Posts: 306

Rep: Reputation: 34
Why not ask your teacher?
 
Old 10-07-2008, 04:36 PM   #5
fberbert
LQ Newbie
 
Registered: May 2004
Location: Brazil
Distribution: Debian
Posts: 7

Rep: Reputation: 0
Try:

rm -- -f

The trick is the "--" after the rm command.
 
Old 10-08-2008, 10:06 AM   #6
cygnal
LQ Newbie
 
Registered: May 2007
Distribution: Slackware/Debian
Posts: 26

Rep: Reputation: 15
You can do:
Code:
rm -- -f
(as stated above) or
Code:
rm "-f"
or
Code:
rm \-f
In the first case, the '--' tells the initial command, rm, that there are no more switches for it and what follows is a file name.

In the second, you're using simple double-quote enclosure of the file name.

In the last, you're using the backslash character to escape the special meaning of the '-' so that the shell sees it as just a printable character with no special significance.
 
Old 10-08-2008, 10:44 AM   #7
erick.szekely
LQ Newbie
 
Registered: Oct 2008
Distribution: fedora 9, ubuntu
Posts: 3

Original Poster
Rep: Reputation: 0
thanks so very much!!
 
  


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
Cannot delete expired principal from kerberos system, how delete principals in kerber sarajevo Linux - Security 0 10-19-2007 11:23 AM
ls | echo, I got blank, why can't echo take the 2nd seat in a pipeline? elinuxqs Linux - Newbie 6 11-24-2006 08:25 AM
BASH: How to NOT echo to screen with "if echo $x | grep ".*"; then" eur0dad Programming 9 07-27-2006 02:14 PM
Kphone echo (echo echo) scabies Linux - Software 0 10-18-2004 02:59 PM
Echo /devPrinting doesn't work, echo /usb/lp0 works, Testpage works, Printing doesn't Hegemon Linux - General 3 08-15-2002 01:13 PM

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

All times are GMT -5. The time now is 12:19 AM.

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