Solved

what does // mean in Linux path?

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

733 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