• edited by
6,302 views
10 10 votes

A student wishes to create symbolic links in a computer system running Unix. Three text files named $``\text{file 1}", ``\text{file 2}"$ and $``\text{file 3}"$ exist in her current working directory, and the student has read and write permissions for all three files. Assume that $\text{file 1}$ contains information about her hobbies, $\text{file 2}$ contains information about her friends and $\text{file 3}$ contains information about her courses. The student executes the following sequence of commands from her current working directory

ln -s file 1 file 2
ln -s file 2 file 3

Which of the following types of information would be lost from her file system?

  1. Hobbies
  2. Friends
  3. Courses
  1. I and II only
  2. II and III only
  3. II only
  4. I and III only

2 Answers

Best answer
15 15 votes

Correct option: B

As ln -s is a symbolic link. In this case

File$3 \Rightarrow$ File$2 \Rightarrow$ File$1 \Rightarrow$ Hobbies (actual data).

So File$2$ and File$3$ contents are lost.

• edited by
8 8 votes
Combining it all :

ln -s arg1 arg2 => creates a symbolic link
if both arg1 & arg2 are file names, agr2 becomes a link and points to file arg1
Here,
ln -s file1 file2 => file2 is now a link name that points to file1.
ln -s file2 file3 => ambiguity -> file2 is the name for a link as well as a file, link is prioritized over file so file2 is no more a filename. file3 becomes a link pointing to link file2(pointer to another pointer)

Hence all point to file1 & data of file2 & file3 are lost.
Answer:
Position:
Show:

Related questions

7 7 votes
2 2 answers
4.9k
4.9k views
Ishrat Jahan asked Nov 3, 2014
4,920 views
The shell commandfind -name passwd -printis executed in /etc directory of a computer system running Unix. Which of the following shell commands will give the same informa...
1 1 vote
1 1 answer
2.5k
2.5k views
Ishrat Jahan asked Oct 30, 2014
2,538 views
The contents of the text file t1 txt containing four lines are as follows :a1 b1a2 b2a3 b2a4 b1The contents of the text file t2 txt containing...
27 27 votes
3 answers 3 answers
10.8k
10.8k views
Ishrat Jahan asked Nov 3, 2014
10,827 views
Suppose that two parties $A$ and $B$ wish to setup a common secret key (D-H key) between themselves using the Diffie-Hellman key exchange technique. They agree on $7$ as ...
0 0 votes
0 0 answers
822
822 views
Misbah Ghaya asked Nov 30, 2016
822 views
Provide short answers to the following questions:Consider the following sequence of UNIX commands:grep main a.c b.c c.c grepout & wc < grepout & rm grepout &Why is this ...