LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-14-2010, 04:27 PM   #1
axel_2078
LQ Newbie
 
Registered: Jun 2010
Location: Fairview Heights, IL
Distribution: Fedora
Posts: 8

Rep: Reputation: 0
question concerning command syntax


I'm currently studying for my Linux+ test and I'm getting conflicting information regarding the rm -rf command. Yes, I know this a dangerous command, but my question is in regard to how the command functions. In one book I'm studying it says that rm -rf / home/myfolder (there's a space in there) will delete the entire root directory because there is a space between the root and home directory. It says that if there is a spacing such as this, it will ignore anything after the space, so in this case, it would delete the root directory and stop, not that there would be anything left anyway. Then in another book I have, it says that if you did a rm -rf folderName / (with the intention of adding the trailing slash to indicate it is a directory and not a folder) it will delete everything in folderName (assuming it's a child directory of your pwd) and then CONTINUE on and delete the root directory. Now, those two statements contradict each other. When you remove a directory, does the command line ignore anything after a space or not?
 
Old 07-14-2010, 04:58 PM   #2
lieutdan13
LQ Newbie
 
Registered: Jul 2005
Location: Akron, OH
Distribution: Ubuntu
Posts: 3

Rep: Reputation: 0
In either case, "/" and "home/myfolder" or "folderName" are passed to rm as two different parameters. So rm will remove the root directory and the "folderName" directory if it exists in your pwd (which it won't anyway because it will have been removed using the first argument. I 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command syntax question for grep kaplan71 Linux - Software 4 07-16-2008 03:13 PM
ls command syntax Freestone Linux - General 5 03-20-2007 07:37 PM
Simple question about command syntax ping/log ping results ohalnet Linux - Networking 1 07-25-2006 05:46 AM
command syntax Jeebizz Slackware 1 04-14-2005 11:55 PM
Command Syntax BittaBrotha Linux From Scratch 4 08-15-2002 01:36 PM

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

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