LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-26-2012, 02:17 AM   #1
cin_
Member
 
Registered: Dec 2010
Posts: 281

Rep: Reputation: 24
rm and mv Functionality


I was doing some goofy command line work that by route of a typo managed to save an accidental file to my computer named for what was supposed to be a parameter to the command: `-n17'.

The problem then was my removal of said file.
Code:
# ls
-n17

# mv '-n17' todel
mv: invalid option -- '17'
Try `mv --help' for more information.

# mv -n17 todel
mv: invalid option -- '17'
Try `mv --help' for more information.

# mv '\-n17' n17
mv: cannot stat `\\-n17': No such file or directory
mv '/-n17' n17
mv: cannot stat `/-n17': No such file or directory

# rm "-n17"
rm: invalid option -- '17'
Try `rm ./-n17' to remove the file `-n17'.
Try `rm --help' for more information.

# rm '-n17'
rm: invalid option -- '17'
Try `rm ./-n17' to remove the file `-n17'.
Try `rm --help' for more information.
What I ended up doing was opening rox and doing it through the GUI.
My question is how to I do this from the command line, and why did it not affect rox?

Last edited by cin_; 04-02-2012 at 12:53 AM. Reason: gramm`err
 
Old 03-26-2012, 02:37 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977
well you have pasted examples right there of how to do it...

Code:
Try `rm ./-n17' to remove the file `-n17'.
not sure what else we're supposed to say. There are other variations of it you could use, "rm \-n17" should work, as should "rm -- -n17"

as for why not rox? becuase rox knows what the filename of the graphical representation is. a command line has to parse out the input you give it and make it make sense. Rox already knows what it's look at.
 
1 members found this post helpful.
Old 03-26-2012, 07:55 PM   #3
cin_
Member
 
Registered: Dec 2010
Posts: 281

Original Poster
Rep: Reputation: 24
Figured

Yeah, I don't know how I overlooked the suggestions... in awe of myself at the moment.

Thanks for the reply.

Indicating current directory:`./'; is the solution for both mv() and rm().

Last edited by cin_; 03-26-2012 at 07:56 PM. Reason: gramm`err
 
Old 03-26-2012, 07:58 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860Reputation: 4860
Just an addition: mv and rm are applications, not functions, so usually they are written without parentheses, which indicate functions. The same is true for rox.
 
  


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
PHP Functionality The Godfather Linux - Server 5 11-25-2010 05:35 AM
I like advanced functionality -- so, Hello! J_ED LinuxQuestions.org Member Intro 1 03-31-2009 06:49 PM
Less functionality in 10.1? powadha SUSE / openSUSE 8 05-27-2006 04:59 PM
nessus and more functionality juanb Linux - Security 1 03-07-2006 07:23 AM
I need MS Access functionality! trey85stang Linux - Software 15 05-25-2004 04:40 PM

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

All times are GMT -5. The time now is 08:04 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration