LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-09-2005, 10:50 AM   #1
learnfast
Member
 
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70

Rep: Reputation: 15
"ln -s ls doit" doesn't work


learning about the "ln" command I tried this but it didn't work:

(in /home/user1)
ln -s /etc/ls doit

but this doesn't work

how can I make a symbolic link in /home/user1 which points to /etc/ls?

thanks
 
Old 03-09-2005, 10:55 AM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
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.
 
Old 03-09-2005, 11:01 AM   #3
learnfast
Member
 
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70

Original Poster
Rep: Reputation: 15
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?

thanks
 
Old 03-09-2005, 11:19 AM   #4
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
Hrm, very odd.

As root, copy/paste

cd /home/user1
ln -s /etc/ls ./doit
ls -l doit

Copy/paste back what you get.
 
Old 03-09-2005, 11:25 AM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,299
Blog Entries: 8

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
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.
 
Old 03-09-2005, 11:33 AM   #6
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 31
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 11:35 AM.
 
Old 03-10-2005, 04:43 AM   #7
learnfast
Member
 
Registered: Mar 2005
Location: berlin
Distribution: Redhat 9, Fedora 3
Posts: 70

Original Poster
Rep: Reputation: 15
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.

Thanks everyone.
 
Old 03-10-2005, 10:24 AM   #8
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
Quote:
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chrooted user: "write" and "talk" don't work. ldp Linux - Software 2 04-12-2005 03:05 AM
"depmod" and "modprobe" commands don't work The1PatO Fedora 7 06-10-2004 01:10 PM
"<" ">" Keyboard keys on Toshiba Satellite 1005-s157 dont work RodCas Linux - Laptop and Netbook 1 05-08-2004 05:22 PM
Why do scripts like "./install" and "./configure" not work for me? engineerwell Linux - Newbie 2 02-05-2004 08:09 AM
<input type="button" disabled="true" > does not work in ns4.7 or 4.9 cybercop12us Programming 2 11-29-2002 09:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration