Solved

what does // mean in Linux path?

Posted on 2006-06-21
5
1,175 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
This is an explanation of a simple data model to help parse a JSON feed
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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 …

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now