![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ksh: difference between $* and $@ | JamesByars | Shell Programming and Scripting | 1 | 12-30-2007 07:08 AM |
| Difference between $* and $@ | saneeshjose | Shell Programming and Scripting | 1 | 01-19-2006 05:03 AM |
| Difference between C and C++ | hytechpro | High Level Programming | 2 | 11-29-2005 06:48 PM |
| difference | rajashekaran | UNIX for Advanced & Expert Users | 1 | 04-22-2002 10:59 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
What's the Difference Between / and //?
Many times over the years, I've noticed that if I accidentally type 'cd //', my bash prompt will display that I am in // instead of /. If I do an ls command, it looks just like I'm in /. So this morning I decided to try and do 'cd ///' all the way up to a full 'cd //////'. None of those attempts did the same thing as //. Knowing that nearly everything in *nix seems to have a real purpose, I suspect // really means something slightly different from /. Are there any long time *nix users who might know the history? I've only been using *nix for ten years and haven't a clue.
|
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
/ is a separator between components of a pathname. Consider /usr/bin/ksh. The leading slash tells you that this is a absolute pathname so you start at root and look for "usr". Then you look in "usr" for "bin". The path known as / is a little special. The leading slash says it's an absolute path so we start at root. And then we're done. With a path like /usr/bin//ksh you have superfluous separators. A path like that is not guaranteed to work so you shouldn't do it. But superfluous separators are easy to ignore and this is commonly done. The path // is a special case of a path with superfluous separators.
Code:
$ cd // $ cd /// $ cd ////// $ cd ///////// $ /usr/bin/pwd / $ |
||||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|