LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-15-2004, 12:05 AM   #1
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Rep: Reputation: 30
"cd \" ?


I sometime mistakenly type "cd \" to enter root directory

should be "cd /" opsite of window "cmd"

And a promp ">" comes out. What is it for?
 
Old 09-15-2004, 12:17 AM   #2
PenguinPwrdBox
Member
 
Registered: Oct 2003
Posts: 568

Rep: Reputation: 31
When you enter a command, without parameters, it will (depending on the command) allow you to enter those parameters after entering the command. So, for instance, type "cd" and press enter. You'll get >
Then, type a directory. and press enter. It will show you the contents of that directory the same as cd <dir> would.

It will then allow you to enter as many as you like.

To quit, press CTRL+C
 
Old 09-15-2004, 12:17 AM   #3
realjustin
Member
 
Registered: Aug 2004
Location: /dev/null
Distribution: Slack 10, Debian
Posts: 99

Rep: Reputation: 15
If you do / and hit enter, it continues the command on the next line is all.
 
Old 09-15-2004, 01:17 AM   #4
pippet
Member
 
Registered: May 2004
Posts: 67

Rep: Reputation: 15
if u enter cd on commandline, it will change ur current directory to ur home directory.
 
Old 09-15-2004, 01:52 AM   #5
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
Quote:
Originally posted by PenguinPwrdBox When you enter a command, without parameters, it will (depending on the command) allow you to enter those parameters after[...]
Not quite that. Actually, "cd" without parameters is perfectly valid: it will go to the home-directory.

What's happening here is that \ is used by bash (the shell) to "escape" characters, which means taking from those characters their special meaning, so that they become normal characters.

For bash:
- $ is for introducing a variable, such as $HOME. \$ is simply a "dollar" sign.
- * is for expanding to any number of characters, matched against files in current directory. \* is simply a "star" sign.
- ? is for expanding to one single character, matched against files in current directory. \? is simply a question mark.
- ... and so on...
- And carriage-return is for ending the current command-line. \<CR> is simply a carriage-return character, that is a "blank" (or separator) from the shell's point of view. It just means that you're not done with editing the current command-line.

Yves.
 
Old 09-15-2004, 04:55 AM   #6
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
To further clarify, pressing \ + <return> makes the shell "escape" thus taking the <return> as a character argument to `cd` and waiting for a <return> to complete the argument list (to cd).

Since it escapes to <return>, the shell assumes that you have finished one line and so displays PS2 (which is Prompt string 2 and is usually set to ">").

So it waiting for command completion.

Simply give a <return> and ignore the error (may be something like "^M doesnt exist" ...

HTH.
End
 
Old 09-15-2004, 04:59 AM   #7
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
Also, windoze command "cmd" is an updated version of COMMAND.com which usually lands up in c:\windows\system or some other dangerous folder whereas `cd` (cd without arguments) in Unixes mean change to your home directory.

End
 
Old 09-15-2004, 06:25 AM   #8
PenguinPwrdBox
Member
 
Registered: Oct 2003
Posts: 568

Rep: Reputation: 31
For some reason - I thought we were talking about ls.....

What can I say - it was like 2am when I posted
 
  


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
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 04:40 AM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM

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

All times are GMT -5. The time now is 10:03 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
Open Source Consulting | Domain Registration