Command line questions

Discussion in 'A+' started by mikehende, Jun 28, 2006.

  1. Baba O'Riley

    Baba O'Riley Gigabyte Poster

    1,760
    23
    99
    To expand on what Freddy said, the first \ in
    Code:
    cd \
    represents the root directory, ie. c:\. If you were currently in the root, both
    Code:
    cd\my images 
    and
    Code:
    cd my images
    would give the same result.
    Code:
    cd\my images 
    is equivalent to
    Code:
    cd c:\my images
    , so if you were, for example, in your "my documents" directory and typed
    Code:
    cd\my images
    , it will take you to c:\my images. However if, while in "my documents", you typed
    Code:
    cd my images 
    the command would be looking for c:\documents and settings\username\my documents\my images so it would either go there or report an error if the directory does not exist.
     
    Certifications: A+, Network+
    WIP: 70-270
  2. mikehende

    mikehende Kilobyte Poster

    265
    0
    19
    Navigating around the directories, everything is working including using the quotations but only when I try to use a space instead of the \ when giving the CD command that this does not work so what's wrong here?
     
  3. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    You need to copy and paste several of your failed attempts into a text file and either quote it here or attach it to your post so we can see what you are trying to do. Trying to tell you why something didn't work when we can't see what happened is next to impossible.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  4. Baba O'Riley

    Baba O'Riley Gigabyte Poster

    1,760
    23
    99
    No, no, no. You cannot replace a \ with a space. The only thing you can do with the cd command is omit a space.
    Hence
    Code:
    cd\ 
    is the same as
    Code:
    cd \
    [EDIT] But only there, you cannot omit a space in a directory name. Eg, you cannot use
    Code:
    cd documentsandsettings 
    instead of
    Code:
    cd documents and settings
    [FURTHER EDIT]Neither can you use
    Code:
    cddocuments and settings
     
    Certifications: A+, Network+
    WIP: 70-270
  5. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    I would highly recommend the same thing that d-Faktor did earlier in this thread. Get used to using the double quotes. You'll need in other Windows OS's and you will find it far less confusing to get compentent at doing things one way until you get used to navigating the command line. Also, since cd is probably the only command that will work without the quotes getting used to working them is a good thing.

    KISS is good advice for every newbie and for most of the rest of us too. No sense in confusing yourself as to when thing will and will not work. Stick to one format and your learning curve will be much easier.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  6. mikehende

    mikehende Kilobyte Poster

    265
    0
    19
    These words by MM

    "The CD command allows you to use a space instead of a backslash"

    is what is throwing me here. I can switch to any folder on my pc using cd\ so is MM wrong here or am I misunderstanding what he's saying?
     
  7. d-Faktor
    Honorary Member

    d-Faktor R.I.P - gone but never forgotten.

    810
    0
    39
    no, with all due respect, i think you haven't been reading what we have been saying.
     
  8. Mr.Cheeks

    Mr.Cheeks 1st ever Gold Member! Gold Member

    5,373
    89
    190
    Mike - I have MM 5th Edition here, im assuming you have the same one, that means there were 4 editions before that, with either errors or stuff to be added, if there is anything wrong, then it should come out in the next edition (not now cuz the next one is 2006 objectives), plus i think you should re-read this thread, from start to end, its telling you a story and remember always KISS
     
  9. Sparky
    Highly Decorated Member Award 500 Likes Award

    Sparky Zettabyte Poster Moderator

    10,718
    543
    364
    Just fire up Windows Explorer and have a few beers! It’s much easier! :biggrin

    Seriously though, perhaps you could post some of the text you are typing, I think it would help. Remember it does make a difference where you have navigated to from the command line when executing the next command. 8)
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) MS-900 AZ-900 Security+ Network+ A+
    WIP: Microsoft Certs
  10. mikehende

    mikehende Kilobyte Poster

    265
    0
    19
    I don't mean at all to make light of what anyone here is trying to tell me just so you guys know but I am caught between reading what's in the book and what you all are trying to explain to me, since I don't think that what you guys are telling me and what MM is saying here regarding this issue is identical then my only option is to choose so I will "KISS" as you all have recommended and VERY unwillingly :D let go of MM's words and go with what is working and move on from there. I will go re-read this entire thread from the beginning and then my next question will concern moving up the levels. Thanks.
     
  11. mikehende

    mikehende Kilobyte Poster

    265
    0
    19
    BTW, just out of curiousity, where/how did the word "KISS" come into play here? Is it abbreviated for something?
     
  12. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,878
    181
    256
    Mike it's a principle which should be applied to all forms of studying and troubleshooting.

    Keep it simple stupid :biggrin
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  13. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,624
    117
    224
    As I said before - on this MM is misleading.

    IMHO it would help if you took MM off his pedestal and said that for this he has ****ed it up.

    In general the space char and the \ char are not equivalent. MM is misleading when he suggest that they are.

    *All* commands should be followed by a space, if only for reliability!

    So CD \my images references a 'my images' directory in the root.
    CD my images references a 'my images' directory in the folder/directory you happen to be in.

    Not the same thing.

    This is actualy wrong. "The CD command allows you to omit the space in certain cases." would be a more accurate statement.

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  14. mikehende

    mikehende Kilobyte Poster

    265
    0
    19
    Well Bluerinse, that just about made my day :D lol, I needed that, thanks!!

    Yes, Harry, MM had me going out of my freakin mind today trying to figure out what he meant by that, I will go get some z's now to regroup/refresh and pick up tomorow where I left off, suggest you guys get some rest too to deal with myself and this topic :biggrin , really appreciate the help and the patience EVERYONE!!
     
  15. riaz.hasan

    riaz.hasan Kilobyte Poster

    289
    0
    38
    i think its just saying that u can do without \ u dont need it, u can just say cd windows and it will go to the windows directory rather than writing cd \windows.
     
    Certifications: Degree, A+, HDA, MCP(270 finally!!)
    WIP: MCDST, MCSA2k3
  16. Baba O'Riley

    Baba O'Riley Gigabyte Poster

    1,760
    23
    99
    Wrong again, please read the thread Riaz. cd windows and cd \windows are two different commands. The only way they would produce the same results would be if you were currently in the root (c:\).
     
    Certifications: A+, Network+
    WIP: 70-270
  17. riaz.hasan

    riaz.hasan Kilobyte Poster

    289
    0
    38
    yeah true, thanx Baba
     
    Certifications: Degree, A+, HDA, MCP(270 finally!!)
    WIP: MCDST, MCSA2k3
  18. mikehende

    mikehende Kilobyte Poster

    265
    0
    19
    Ok guys, back on the ball, this > is confusing me, what is it for and when should it be used?
     
  19. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    The > symbol is what is called a "redirector". Normally the output of a cmd command will be written to the cmd shell, i.e. the output of the command will be written to your screen. The > redirector will direct the output of the command to some a file or some other place. The most common place being a file.

    Thus the command "dir C:\Windows > directory_of_windows.txt" will not be written to your computer monitor where you can see it, but instead to the text file named directory_of_windows.txt created in the directory you were in when you ran the command.

    Thus if you were in C:\Documents and Settings\ffreeloader when you executed the command the file directory_of_windows.txt would be created in that directory.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  20. mikehende

    mikehende Kilobyte Poster

    265
    0
    19
    I only see this symbol when changing directories so is this what you mean by "redirector", that it is used to point to a change in directories?
     

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.