Solved

what does // mean in Linux path?

Posted on 2006-06-21
5
1,182 Views
Last Modified: 2008-01-09
Hi,

what does "mkdir /home/test/util//" do other than mkdir util/?

The complete command in Linux is:
mkdir -p /home/jess/rg-4.1.7/rg/build.CENTAUR/pkg/include/util//
&& ln -sfn /home/jess/rg-4.1.7/rg/pkg/util/test_lang.c /home/jess/rg-4.1.7/rg/build.CENTAUR/pkg/include/util//test_lang.c

Thank you in advance,
Jessica
0
Comment
Question by:sctccomm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 8

Expert Comment

by:Autogard
ID: 16953912
The extra slashes should not be a problem at all in Linux.  it will just treat it as just one slash.

e.g.

"mkdir ~/something2//////" just creates "something2"
0
 
LVL 8

Expert Comment

by:Autogard
ID: 16953941
Also, in certain protocols two forward slashes can mean a network location, but that doesn't apply in your example.
0
 
LVL 8

Assisted Solution

by:Autogard
Autogard earned 150 total points
ID: 16954009
So:

mkdir -p /home/jess/rg-4.1.7/rg/build.CENTAUR/pkg/include/util//
&& ln -sfn /home/jess/rg-4.1.7/rg/pkg/util/test_lang.c /home/jess/rg-4.1.7/rg/build.CENTAUR/pkg/include/util//test_lang.c

should be the same as:

mkdir -p /home/jess/rg-4.1.7/rg/build.CENTAUR/pkg/include/util/
&& ln -sfn /home/jess/rg-4.1.7/rg/pkg/util/test_lang.c /home/jess/rg-4.1.7/rg/build.CENTAUR/pkg/include/util/test_lang.c

or even:

mkdir -p /home/jess/rg-4.1.7/rg/build.CENTAUR/pkg/include/util//////////
&& ln -sfn /home/jess/rg-4.1.7/rg/pkg/util/test_lang.c /home/jess/rg-4.1.7/rg/build.CENTAUR/pkg/include/util//////////////test_lang.c

for that matter.  Give it a try.
0
 
LVL 7

Assisted Solution

by:NetExpert
NetExpert earned 150 total points
ID: 16954066
It's the same thing, a double slashes // is considered the same as single / when use in dir path/name.
0
 
LVL 7

Accepted Solution

by:
aib_42 earned 200 total points
ID: 16954420
The double directory seperators are a common off-by-1 mistake. Shell scripts that take, say, the name of a directory name and do something with it often append a trailing seperator:
rm $1/file.ext
del %1\file.ext

But not always; some of them want it to be supplied in the argument:
rm $1file.ext
del %1file.ext

So the best practice for a user is to put a trailing slash anyway, since it will work in both cases (as superfluous seperators are simply ignored.)
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question