ln -s fail to create a symbolic to directory
I tried to create a symbolic link of Books Directory to the Home
#in the Document Directory to the Home Diretory.
ln -s Books/ ~/Books
but it create a file rather than a directory
What's the problem with my usage of ln?
symbolic-link
add a comment |
I tried to create a symbolic link of Books Directory to the Home
#in the Document Directory to the Home Diretory.
ln -s Books/ ~/Books
but it create a file rather than a directory
What's the problem with my usage of ln?
symbolic-link
ln -s /home/username/Documents/Books /home/username/Books
– heynnema
2 hours ago
add a comment |
I tried to create a symbolic link of Books Directory to the Home
#in the Document Directory to the Home Diretory.
ln -s Books/ ~/Books
but it create a file rather than a directory
What's the problem with my usage of ln?
symbolic-link
I tried to create a symbolic link of Books Directory to the Home
#in the Document Directory to the Home Diretory.
ln -s Books/ ~/Books
but it create a file rather than a directory
What's the problem with my usage of ln?
symbolic-link
symbolic-link
asked 2 hours ago
AliceAlice
417110
417110
ln -s /home/username/Documents/Books /home/username/Books
– heynnema
2 hours ago
add a comment |
ln -s /home/username/Documents/Books /home/username/Books
– heynnema
2 hours ago
ln -s /home/username/Documents/Books /home/username/Books
– heynnema
2 hours ago
ln -s /home/username/Documents/Books /home/username/Books
– heynnema
2 hours ago
add a comment |
2 Answers
2
active
oldest
votes
This looks like 3rd form according to documentation:
ln [OPTION]... TARGET... DIRECTORY (3rd form)
...
In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.
So it reads as "create link to a directory Books
(which is in your current working directory) and put that link in specified directory ~/Books
". Of course, if Books/
doesn't exist in current working directory - you'll have a symlink pointing to itself, which will result in too many symlink levels error
[ adminx:Fri Feb 22 01:57:21 UTC 2019 ]$ ln -s asdfasdf foobarbaz/
[ adminx:Fri Feb 22 01:57:33 UTC 2019 ]$ ls foobarbaz/
asdfasdf file.txt thing
[ adminx:Fri Feb 22 01:57:37 UTC 2019 ]$ ls -l foobarbaz/
total 0
lrwxrwxrwx 1 adminx adminx 8 Feb 22 01:57 asdfasdf -> asdfasdf
-rw-rw-r-- 1 adminx adminx 0 Feb 22 01:56 file.txt
lrwxrwxrwx 1 adminx adminx 5 Feb 22 01:56 thing -> thing
[ adminx:Fri Feb 22 02:02:29 UTC 2019 ]$ cd foobarbaz/thing
bash: cd: foobarbaz/thing: Too many levels of symbolic links
Now, I would suggest using first form with -T
flag:
adminx:Fri Feb 22 02:05:01 UTC 2019 ]$ ln -s -T ~/Documents dock_link
[ adminx:Fri Feb 22 02:05:08 UTC 2019 ]$ ls -l dock_link
lrwxrwxrwx 1 adminx adminx 22 Feb 22 02:05 dock_link -> /home/adminx/Documents
[ adminx:Fri Feb 22 02:05:16 UTC 2019 ]$
add a comment |
It seems like you created a broken link. Books/
is in ~/Documents
, so you need to specify that, either with a relative path:
ln -s Documents/Books ~/Books
or an absolute path:
ln -s ~/Documents/Books ~/Books
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120262%2fln-s-fail-to-create-a-symbolic-to-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
This looks like 3rd form according to documentation:
ln [OPTION]... TARGET... DIRECTORY (3rd form)
...
In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.
So it reads as "create link to a directory Books
(which is in your current working directory) and put that link in specified directory ~/Books
". Of course, if Books/
doesn't exist in current working directory - you'll have a symlink pointing to itself, which will result in too many symlink levels error
[ adminx:Fri Feb 22 01:57:21 UTC 2019 ]$ ln -s asdfasdf foobarbaz/
[ adminx:Fri Feb 22 01:57:33 UTC 2019 ]$ ls foobarbaz/
asdfasdf file.txt thing
[ adminx:Fri Feb 22 01:57:37 UTC 2019 ]$ ls -l foobarbaz/
total 0
lrwxrwxrwx 1 adminx adminx 8 Feb 22 01:57 asdfasdf -> asdfasdf
-rw-rw-r-- 1 adminx adminx 0 Feb 22 01:56 file.txt
lrwxrwxrwx 1 adminx adminx 5 Feb 22 01:56 thing -> thing
[ adminx:Fri Feb 22 02:02:29 UTC 2019 ]$ cd foobarbaz/thing
bash: cd: foobarbaz/thing: Too many levels of symbolic links
Now, I would suggest using first form with -T
flag:
adminx:Fri Feb 22 02:05:01 UTC 2019 ]$ ln -s -T ~/Documents dock_link
[ adminx:Fri Feb 22 02:05:08 UTC 2019 ]$ ls -l dock_link
lrwxrwxrwx 1 adminx adminx 22 Feb 22 02:05 dock_link -> /home/adminx/Documents
[ adminx:Fri Feb 22 02:05:16 UTC 2019 ]$
add a comment |
This looks like 3rd form according to documentation:
ln [OPTION]... TARGET... DIRECTORY (3rd form)
...
In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.
So it reads as "create link to a directory Books
(which is in your current working directory) and put that link in specified directory ~/Books
". Of course, if Books/
doesn't exist in current working directory - you'll have a symlink pointing to itself, which will result in too many symlink levels error
[ adminx:Fri Feb 22 01:57:21 UTC 2019 ]$ ln -s asdfasdf foobarbaz/
[ adminx:Fri Feb 22 01:57:33 UTC 2019 ]$ ls foobarbaz/
asdfasdf file.txt thing
[ adminx:Fri Feb 22 01:57:37 UTC 2019 ]$ ls -l foobarbaz/
total 0
lrwxrwxrwx 1 adminx adminx 8 Feb 22 01:57 asdfasdf -> asdfasdf
-rw-rw-r-- 1 adminx adminx 0 Feb 22 01:56 file.txt
lrwxrwxrwx 1 adminx adminx 5 Feb 22 01:56 thing -> thing
[ adminx:Fri Feb 22 02:02:29 UTC 2019 ]$ cd foobarbaz/thing
bash: cd: foobarbaz/thing: Too many levels of symbolic links
Now, I would suggest using first form with -T
flag:
adminx:Fri Feb 22 02:05:01 UTC 2019 ]$ ln -s -T ~/Documents dock_link
[ adminx:Fri Feb 22 02:05:08 UTC 2019 ]$ ls -l dock_link
lrwxrwxrwx 1 adminx adminx 22 Feb 22 02:05 dock_link -> /home/adminx/Documents
[ adminx:Fri Feb 22 02:05:16 UTC 2019 ]$
add a comment |
This looks like 3rd form according to documentation:
ln [OPTION]... TARGET... DIRECTORY (3rd form)
...
In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.
So it reads as "create link to a directory Books
(which is in your current working directory) and put that link in specified directory ~/Books
". Of course, if Books/
doesn't exist in current working directory - you'll have a symlink pointing to itself, which will result in too many symlink levels error
[ adminx:Fri Feb 22 01:57:21 UTC 2019 ]$ ln -s asdfasdf foobarbaz/
[ adminx:Fri Feb 22 01:57:33 UTC 2019 ]$ ls foobarbaz/
asdfasdf file.txt thing
[ adminx:Fri Feb 22 01:57:37 UTC 2019 ]$ ls -l foobarbaz/
total 0
lrwxrwxrwx 1 adminx adminx 8 Feb 22 01:57 asdfasdf -> asdfasdf
-rw-rw-r-- 1 adminx adminx 0 Feb 22 01:56 file.txt
lrwxrwxrwx 1 adminx adminx 5 Feb 22 01:56 thing -> thing
[ adminx:Fri Feb 22 02:02:29 UTC 2019 ]$ cd foobarbaz/thing
bash: cd: foobarbaz/thing: Too many levels of symbolic links
Now, I would suggest using first form with -T
flag:
adminx:Fri Feb 22 02:05:01 UTC 2019 ]$ ln -s -T ~/Documents dock_link
[ adminx:Fri Feb 22 02:05:08 UTC 2019 ]$ ls -l dock_link
lrwxrwxrwx 1 adminx adminx 22 Feb 22 02:05 dock_link -> /home/adminx/Documents
[ adminx:Fri Feb 22 02:05:16 UTC 2019 ]$
This looks like 3rd form according to documentation:
ln [OPTION]... TARGET... DIRECTORY (3rd form)
...
In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.
So it reads as "create link to a directory Books
(which is in your current working directory) and put that link in specified directory ~/Books
". Of course, if Books/
doesn't exist in current working directory - you'll have a symlink pointing to itself, which will result in too many symlink levels error
[ adminx:Fri Feb 22 01:57:21 UTC 2019 ]$ ln -s asdfasdf foobarbaz/
[ adminx:Fri Feb 22 01:57:33 UTC 2019 ]$ ls foobarbaz/
asdfasdf file.txt thing
[ adminx:Fri Feb 22 01:57:37 UTC 2019 ]$ ls -l foobarbaz/
total 0
lrwxrwxrwx 1 adminx adminx 8 Feb 22 01:57 asdfasdf -> asdfasdf
-rw-rw-r-- 1 adminx adminx 0 Feb 22 01:56 file.txt
lrwxrwxrwx 1 adminx adminx 5 Feb 22 01:56 thing -> thing
[ adminx:Fri Feb 22 02:02:29 UTC 2019 ]$ cd foobarbaz/thing
bash: cd: foobarbaz/thing: Too many levels of symbolic links
Now, I would suggest using first form with -T
flag:
adminx:Fri Feb 22 02:05:01 UTC 2019 ]$ ln -s -T ~/Documents dock_link
[ adminx:Fri Feb 22 02:05:08 UTC 2019 ]$ ls -l dock_link
lrwxrwxrwx 1 adminx adminx 22 Feb 22 02:05 dock_link -> /home/adminx/Documents
[ adminx:Fri Feb 22 02:05:16 UTC 2019 ]$
answered 51 mins ago
Sergiy KolodyazhnyySergiy Kolodyazhnyy
72.8k9152316
72.8k9152316
add a comment |
add a comment |
It seems like you created a broken link. Books/
is in ~/Documents
, so you need to specify that, either with a relative path:
ln -s Documents/Books ~/Books
or an absolute path:
ln -s ~/Documents/Books ~/Books
add a comment |
It seems like you created a broken link. Books/
is in ~/Documents
, so you need to specify that, either with a relative path:
ln -s Documents/Books ~/Books
or an absolute path:
ln -s ~/Documents/Books ~/Books
add a comment |
It seems like you created a broken link. Books/
is in ~/Documents
, so you need to specify that, either with a relative path:
ln -s Documents/Books ~/Books
or an absolute path:
ln -s ~/Documents/Books ~/Books
It seems like you created a broken link. Books/
is in ~/Documents
, so you need to specify that, either with a relative path:
ln -s Documents/Books ~/Books
or an absolute path:
ln -s ~/Documents/Books ~/Books
answered 1 hour ago
wjandreawjandrea
9,24442563
9,24442563
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120262%2fln-s-fail-to-create-a-symbolic-to-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
ln -s /home/username/Documents/Books /home/username/Books
– heynnema
2 hours ago