Error to Create symbolic binary link
I want to create a symbolic link for vi to see this program when calling
from console run vim:
ln -s /usr/bin/vi /usr/bin/vim
ln: failure to create symbolic link «/ usr / bin / vim»: The file already exists
how can I do it so I saw it point to vim
linux symlink vi
add a comment |
I want to create a symbolic link for vi to see this program when calling
from console run vim:
ln -s /usr/bin/vi /usr/bin/vim
ln: failure to create symbolic link «/ usr / bin / vim»: The file already exists
how can I do it so I saw it point to vim
linux symlink vi
add a comment |
I want to create a symbolic link for vi to see this program when calling
from console run vim:
ln -s /usr/bin/vi /usr/bin/vim
ln: failure to create symbolic link «/ usr / bin / vim»: The file already exists
how can I do it so I saw it point to vim
linux symlink vi
I want to create a symbolic link for vi to see this program when calling
from console run vim:
ln -s /usr/bin/vi /usr/bin/vim
ln: failure to create symbolic link «/ usr / bin / vim»: The file already exists
how can I do it so I saw it point to vim
linux symlink vi
linux symlink vi
edited 4 hours ago
Rui F Ribeiro
41.6k1483141
41.6k1483141
asked 6 hours ago
ortigaortiga
83
83
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Given your original tag of CentOS, I'll assume that you have an /etc/profile.d/vim.sh
file that sets up an alias:
alias vi >/dev/null 2>&1 || alias vi=vim
If you want to run vi
when you enter vim
, I'd suggest adding to your own ~/.bashrc
:
unalias vi
alias vim=vi
add a comment |
Yes, if you already have /usr/bin/vim
, you cannot have another file of the same name in that directory. However, /usr/bin
is (usually) not the only location checked for executables.
Run echo $PATH
to see the list of directories that is checked, left to right. Hopefully, you'll have locations like /home/(username)/bin
or /usr/local/bin
in there. In that case,
ln -s /usr/bin/vi /usr/local/bin/vim
will override the default vim for all users. (They can still call /usr/bin/vim
to get the original.)
add a comment |
Solution:
You can force to remove the destination file using -f (Test before changing anything!)
ln -sf /usr/bin/vi /usr/bin/vim
Works for me!
Example:
[root@vvek-workstation grep]# ln -ss ./vi ./vim
ln: failed to create symbolic link ‘./vim’: File exists
[root@vvek-workstation grep]# ln -sf ./vi ./vim
[root@vvek-workstation grep]# ls -lart
total 0
drwxr-xr-x. 9 root root 228 Mar 20 15:20 ..
-rw-r--r-- 1 root root 0 Mar 20 16:00 vi
lrwxrwxrwx 1 root root 4 Mar 20 16:00 vim -> ./vi
drwxr-xr-x 2 root root 27 Mar 20 16:00 .
New contributor
and to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
ln -sf /usr/bin/vim /usr/bin/vi perfect but i need to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f507529%2ferror-to-create-symbolic-binary-link%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Given your original tag of CentOS, I'll assume that you have an /etc/profile.d/vim.sh
file that sets up an alias:
alias vi >/dev/null 2>&1 || alias vi=vim
If you want to run vi
when you enter vim
, I'd suggest adding to your own ~/.bashrc
:
unalias vi
alias vim=vi
add a comment |
Given your original tag of CentOS, I'll assume that you have an /etc/profile.d/vim.sh
file that sets up an alias:
alias vi >/dev/null 2>&1 || alias vi=vim
If you want to run vi
when you enter vim
, I'd suggest adding to your own ~/.bashrc
:
unalias vi
alias vim=vi
add a comment |
Given your original tag of CentOS, I'll assume that you have an /etc/profile.d/vim.sh
file that sets up an alias:
alias vi >/dev/null 2>&1 || alias vi=vim
If you want to run vi
when you enter vim
, I'd suggest adding to your own ~/.bashrc
:
unalias vi
alias vim=vi
Given your original tag of CentOS, I'll assume that you have an /etc/profile.d/vim.sh
file that sets up an alias:
alias vi >/dev/null 2>&1 || alias vi=vim
If you want to run vi
when you enter vim
, I'd suggest adding to your own ~/.bashrc
:
unalias vi
alias vim=vi
answered 6 hours ago
Jeff SchallerJeff Schaller
43.8k1161141
43.8k1161141
add a comment |
add a comment |
Yes, if you already have /usr/bin/vim
, you cannot have another file of the same name in that directory. However, /usr/bin
is (usually) not the only location checked for executables.
Run echo $PATH
to see the list of directories that is checked, left to right. Hopefully, you'll have locations like /home/(username)/bin
or /usr/local/bin
in there. In that case,
ln -s /usr/bin/vi /usr/local/bin/vim
will override the default vim for all users. (They can still call /usr/bin/vim
to get the original.)
add a comment |
Yes, if you already have /usr/bin/vim
, you cannot have another file of the same name in that directory. However, /usr/bin
is (usually) not the only location checked for executables.
Run echo $PATH
to see the list of directories that is checked, left to right. Hopefully, you'll have locations like /home/(username)/bin
or /usr/local/bin
in there. In that case,
ln -s /usr/bin/vi /usr/local/bin/vim
will override the default vim for all users. (They can still call /usr/bin/vim
to get the original.)
add a comment |
Yes, if you already have /usr/bin/vim
, you cannot have another file of the same name in that directory. However, /usr/bin
is (usually) not the only location checked for executables.
Run echo $PATH
to see the list of directories that is checked, left to right. Hopefully, you'll have locations like /home/(username)/bin
or /usr/local/bin
in there. In that case,
ln -s /usr/bin/vi /usr/local/bin/vim
will override the default vim for all users. (They can still call /usr/bin/vim
to get the original.)
Yes, if you already have /usr/bin/vim
, you cannot have another file of the same name in that directory. However, /usr/bin
is (usually) not the only location checked for executables.
Run echo $PATH
to see the list of directories that is checked, left to right. Hopefully, you'll have locations like /home/(username)/bin
or /usr/local/bin
in there. In that case,
ln -s /usr/bin/vi /usr/local/bin/vim
will override the default vim for all users. (They can still call /usr/bin/vim
to get the original.)
answered 6 hours ago
Ulrich SchwarzUlrich Schwarz
9,95313047
9,95313047
add a comment |
add a comment |
Solution:
You can force to remove the destination file using -f (Test before changing anything!)
ln -sf /usr/bin/vi /usr/bin/vim
Works for me!
Example:
[root@vvek-workstation grep]# ln -ss ./vi ./vim
ln: failed to create symbolic link ‘./vim’: File exists
[root@vvek-workstation grep]# ln -sf ./vi ./vim
[root@vvek-workstation grep]# ls -lart
total 0
drwxr-xr-x. 9 root root 228 Mar 20 15:20 ..
-rw-r--r-- 1 root root 0 Mar 20 16:00 vi
lrwxrwxrwx 1 root root 4 Mar 20 16:00 vim -> ./vi
drwxr-xr-x 2 root root 27 Mar 20 16:00 .
New contributor
and to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
ln -sf /usr/bin/vim /usr/bin/vi perfect but i need to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
add a comment |
Solution:
You can force to remove the destination file using -f (Test before changing anything!)
ln -sf /usr/bin/vi /usr/bin/vim
Works for me!
Example:
[root@vvek-workstation grep]# ln -ss ./vi ./vim
ln: failed to create symbolic link ‘./vim’: File exists
[root@vvek-workstation grep]# ln -sf ./vi ./vim
[root@vvek-workstation grep]# ls -lart
total 0
drwxr-xr-x. 9 root root 228 Mar 20 15:20 ..
-rw-r--r-- 1 root root 0 Mar 20 16:00 vi
lrwxrwxrwx 1 root root 4 Mar 20 16:00 vim -> ./vi
drwxr-xr-x 2 root root 27 Mar 20 16:00 .
New contributor
and to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
ln -sf /usr/bin/vim /usr/bin/vi perfect but i need to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
add a comment |
Solution:
You can force to remove the destination file using -f (Test before changing anything!)
ln -sf /usr/bin/vi /usr/bin/vim
Works for me!
Example:
[root@vvek-workstation grep]# ln -ss ./vi ./vim
ln: failed to create symbolic link ‘./vim’: File exists
[root@vvek-workstation grep]# ln -sf ./vi ./vim
[root@vvek-workstation grep]# ls -lart
total 0
drwxr-xr-x. 9 root root 228 Mar 20 15:20 ..
-rw-r--r-- 1 root root 0 Mar 20 16:00 vi
lrwxrwxrwx 1 root root 4 Mar 20 16:00 vim -> ./vi
drwxr-xr-x 2 root root 27 Mar 20 16:00 .
New contributor
Solution:
You can force to remove the destination file using -f (Test before changing anything!)
ln -sf /usr/bin/vi /usr/bin/vim
Works for me!
Example:
[root@vvek-workstation grep]# ln -ss ./vi ./vim
ln: failed to create symbolic link ‘./vim’: File exists
[root@vvek-workstation grep]# ln -sf ./vi ./vim
[root@vvek-workstation grep]# ls -lart
total 0
drwxr-xr-x. 9 root root 228 Mar 20 15:20 ..
-rw-r--r-- 1 root root 0 Mar 20 16:00 vi
lrwxrwxrwx 1 root root 4 Mar 20 16:00 vim -> ./vi
drwxr-xr-x 2 root root 27 Mar 20 16:00 .
New contributor
New contributor
answered 6 hours ago
Vivek KanadiyaVivek Kanadiya
1858
1858
New contributor
New contributor
and to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
ln -sf /usr/bin/vim /usr/bin/vi perfect but i need to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
add a comment |
and to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
ln -sf /usr/bin/vim /usr/bin/vi perfect but i need to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
and to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
and to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
ln -sf /usr/bin/vim /usr/bin/vi perfect but i need to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
ln -sf /usr/bin/vim /usr/bin/vi perfect but i need to remove the symbolic link without deleting vim ??
– ortiga
6 hours ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f507529%2ferror-to-create-symbolic-binary-link%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