Hi All of Unix/Linux professional
Q.Why soft link file not open by cat command. Ihave make
following symbolic link but when i open with #cat
linkfilename it does not oped please see the following code
and try to answer.
# ln -s file1 ~/mydir/filea
[root@dhcppc0 ~]# cd mydir
[root@dhcppc0 mydir]# ls -l
total 4
lrwxrwxrwx 1 root root 5 2010-04-04 09:04 filea -> file1
[root@dhcppc0 mydir]# cat filea
cat: filea: No such file or directory

Answers were Sorted based on User's Feedback



Hi All of Unix/Linux professional Q.Why soft link file not open by cat command. Ihave make followi..

Answer / kristofw

the problem arises because you did not provide path
information to the target file. ln will create the link
pointing to a file1 in the same directory as the link
itself. If you do add path information to the target, it
will work :

# ln -s ~/file1 ~/mydir/filea

Is This Answer Correct ?    8 Yes 1 No

Hi All of Unix/Linux professional Q.Why soft link file not open by cat command. Ihave make followi..

Answer / nikhil maggu

Hi,
First of all a soft link is not an actual file it refers a
link to the original file at different location.
and cat shows the content of a file having data, info etc.

But "ln" never saves any info it just a reference of
original file to a different location

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More Linux Commands Interview Questions

What is tty name?

0 Answers  


in unix how to change old name to new name

7 Answers   Google,


Why is it called bash?

0 Answers  


How do you do nslookup?

0 Answers  


What does comm do and how to use it?

0 Answers  


Any one example of uninteruptable sleeping process?

2 Answers   Satyam,


How do I know my linux shell version?

0 Answers  


Explain the ‘ls’ command in linux

0 Answers  


What is the export command used for?

0 Answers  


I have my default runlevel is init5 now i have configured to init 3,now i wanna run my system in init3 process without reboot the system .How will you do for this scenario?

6 Answers   Span Systems,


What can you type at a command line to determine which shell you are using?

6 Answers   Tech Mahindra,


What the command used for search file or files for specific text?

0 Answers  


Categories