Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, you didn't say what distribution you're on. So I did a couple of quick tests on Fedora. I can link to files I don't own, nor are they world readable...no problem.
So, I'm left with the thought, are you user1 when you try to do this ln? Do you own, as user1, the folder you're currently in, such that you can do "touch test" and create a file.
I'm using redhat 9.
i am root.
when I am in /etc then "ln -s ls doit" works fine
but the point of a link is to link from somewhere else so
I tried it in "/home/user1" but it gives me that error.
i can say "touch test" and it creates the file no problem
what am i missing?
how can I create a simple symbolic link to another file?
Just what are you trying to do, anyway? It seems like what you really want is an alias, not a symbolic link.
What error are you getting?
If you're trying to type in "doit" and it doesn't find the command, then that's probably because "." is NOT in the user's $PATH. This is a good safety precaution, because it makes it more difficult for someone to insert a fake version of a common command.
I wanted to ask the same thing: what error do you get? Is the link created or not?
Because if the link is created, then another possibility (apart that "." is not in your path) is that /etc/ls doesn't exist. At least, in my system, there is a /bin/ls, but not /etc/ls. Yet the link to /etc/ls can be created, and when I run "ls" it blinks because it is pointing to no-where.
Last edited by enemorales; 03-09-2005 at 10:35 AM.
OK, as enemorales pointed out, this is wrong of course:
ln -s /etc/ls doit
and this is right:
ln -s /bin/ls doit
since "ls" is in the /bin directory
So now I understand ln much better, got things to work.
And yes, the above would be better done with "alias".
I tried it with a directory (which is the purpose of ln as I understand it) and it worked to so this is RESOLVED.
Originally posted by enemorales /etc/ls doesn't exist. At least, in my system, there is a /bin/ls, but not /etc/ls.
At my last job I actually dealt with SCO boxes, you'd be surprised at what is placed in the /etc directory, that's why I took the question at face value instead of asking the person if they were sure that ls was in /etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.