Skip to main content

Linux command: ln - make links between files




Question 1:
You are experimenting with a binary in /tmp/foo.d that expects its configuration file at /etc/foo.conf.
You don’t want to save it there, but use a symbolic link to /tmp/foo.d/foo.conf instead.

Which command would accomplish that?

A. ln -s /tmp/foo.d/foo.conf /etc/foo.conf
B. ln /tmp/foo.d/foo.conf /etc/foo.conf
C. ln -s /etc/foo.conf /tmp/foo.d/foo.conf
D. ln /etc/foo.conf /tmp/foo.d/foo.conf





[Hint]
Có hay không có "-s": Dùng "-s" để tạo soft link hay symbolic link (symlink), khi tạo hard link thì không có "-s).
Thứ tự của original file và symlink file: "Có bột mới gột nên hồ", original file phải có sẵn và phải đứng trước symlink.

Hard link chỉ link đến file và chỉ link đến file nằm trên cùng file system

ln -s <orginal> <symlink>


[Reference]
Learn Linux, 101: Create and change hard and symbolic links

Answer: A



Question 2:
You want to create a hard link to a regular file. What are requirements of the regular file for
the ln command to succeed? (Choose two)

A. The file must exist before you run the ln command.
B. The file must be in the same directory as the new file name.
C. The file must be in the same file system as the new file name.
D. The file must be in a different directory from the new file name.
E. The file must be in a different file system from the new file name.

Answer: A, C



Question 3:

An administrator is trying to make a hard link to an ordinary file but ln returns an error. Which of the following could cause this?

A. The source and the target are on different file systems.
B. The source file is hidden.
C. The source file is read-only.
D. The administrator does not own the source file.
E. The source file is a shell script.

Answer: A



Question 4:

A Linux user wants to create a hard link named file2 in the current directory that points to /usr/var/file. Which of the following commands can be used?

A. ln -h file2 /usr/var/file
B. ln file2 /usr/var/file
C. ln -h /usr/var/file file2
D. ln /usr/var/file file2

Answer: D



Question 5:
A hard link is created so that origfile1 is accessible through linkfile1. The reference to origfile1 is then removed using the rm command. What will happen to linkfile1?

A.The file linkfile1 will be deleted
B. The file linkfile1 will become a "broken link"
C. linkfile1 will still exist
D. Both origfile1 and linkfile1 will still exist

Answer: A

Question 6:
Choose the appropriate missing word.
A ______ link cannot span across different filesystems.

A. hard
B. symbolic

Answer: A

Popular posts from this blog

IBM Domino: How to enable HTTP Request logging in Domino

http://www-01.ibm.com/support/docview.wss?uid=swg21099151 Technote (FAQ) Question How do you enable HTTP request logging when using a Lotus® Domino® Web server? You want a record of all requests sent by Web browsers to the Domino server to use for troubleshooting. Answer Below is a short guide to turning on request logging that provides the basic logging level. More verbose logging can be enabled by following the instructions in  "Overview of HTTP Request Logs" (#7003598) . Important:  HTTP request logging should be used only for troubleshooting specific issues, and usually at the direction of and with assistance from IBM Support. Do not use request logging for other purposes, such as administrative reasons. Because these log files grow in size over time, you should not leave this setting enabled for long periods or you will exhaust the available drive space. To enable logging of HTTP requests for a Domino server for the current HTTP session only, enter the f...

Windows Command: arp - Address Resolution Protocol

Notes from daily work situation. While troubleshooting HSRP, I need to delete arp table on my computer. arp -d * Take a look at other options with arp command: C:\Users\Administrator>arp /? Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol (ARP). ARP -s inet_addr eth_addr [if_addr] ARP -d inet_addr [if_addr] ARP -a [inet_addr] [-N if_addr] [-v] -a Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed. -g Same as -a. -v Displays current ARP entries in verbose mode. All invalid entries and entries on the loop-back interface will be shown. inet_addr Specifies an internet address. -N if_a...

Microsoft Windows Server 2012 R2 Standard Evaluation Product Key

Microsoft Windows Server 2012 R2 Standard Evaluation D2N9P-3P6X9-2R39C-7RTCD-MDVJX DBGBW-NPF86-BJVTX-K3WKJ-MTB6V