Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

what does // mean in Linux path?

Posted on 2006-06-21
5
Medium Priority
?
1,186 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 600 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 600 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 800 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn different types of Android Layout and some basics of an Android App.
Simple Linear Regression
Progress

610 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