Question

In: Computer Science

Doing the work on Linux in Putty: You are to create a hard link to one...

Doing the work on Linux in Putty:

You are to create a hard link to one of your existing files on someone else's directory (or vice versa). In other words, you know that you can link a file within your own directories, but you can also have a link to one of your files on other areas of the unix system as long as you have permissions to write to that directory (in this case, your partner).

Create a subdirectory called temp where you can place this temporary link. Remember that you do not link a file to another file. You create a hard link to an existing file. So, user A has file1 that he/she wants to give access to user B. User B has to open certain directory permissions, for this to happen, then User A can create the link on user B directory (user A NEVER goes to user B directories typing cd), but if permissions are opened correctly all the commands will be done from user A directory without shell error messages such as “can not access..”.

We cannot get the ln part to work. How do you share the hard link with the other user???

Solutions

Expert Solution

Please find the answer for the given question.

Hard link:

Hard link is a copy of the selected file. Hence this accesses the data available from the original file.
If the original selected file is removed or deleted, then the hard link pointing to the original file will still have the data of the source/original file.

Syntax for creating hard links:

ln  [source filename] [destination link file name] 

Note: LInk name can be absolete path also

Sample Output:

#following four commands are used to crate temporary directory by another user and he/she has given full permission
#so that the others users can create hard links with out "cd" to their directory.

USERLOGO@linux-server$ mkdir TEMP
USERLOGO@linux-server$ ls -ld TEMP
drwxrwxr-x 2 USERLOGO USERLOGO 4096 Oct 17 13:02 TEMP
USERLOGO@linux-server$ chmod 777 TEMP

#following commands explains how we are creatning the hard links.

USER>echo "HI" >file1
USER>cat file1
HI
USER>

USER>ls -l file1
-rw-rw-r-- 1 jhon jhon 3 Oct 17 13:03 file1
USER>

USER>ln file1 /home/USERLOGO/TEMP/file1-hardlink

USER>cat /home/USERLOGO/TEMP/file1-hardlink
HI
USER>ls -l /home/USERLOGO/TEMP/file1-hardlink
-rw-rw-r-- 2 jhon jhon 3 Oct 17 13:03 /home/USERLOGO/TEMP/file1-hardlink
USER>

Screen Shot:


Related Solutions

You are to create a hard link to one of your existing files on someone else's...
You are to create a hard link to one of your existing files on someone else's directory (or vice versa). In other words, you know that you can link a file within your own directories, but you can also have a link to one of your files on other areas of the unix system as long as you have permissions to write to that directory (in this case, your partner). Create a subdirectory called temp where you can place this...
unix/Linux Create a tar command using the man command and the link referred to in To...
unix/Linux Create a tar command using the man command and the link referred to in To Practice and Explore: Text File Utilities #9. Preliminaries Use the man pages to learn more about tar Review the links referred to in To Practice and Explore: Text File Utilities #9 to see examples of using tar command Perform Use tar "to stuff" three files and then "unstuff" them into a new directory. Include the -v option. Task ll to show the original 3...
how to create a script file on puTTy script pp1.txt
how to create a script file on puTTy script pp1.txt
What would these commands look like in Kali Linux? In Kali Linux: a) Create a user...
What would these commands look like in Kali Linux? In Kali Linux: a) Create a user (username= YOUR-FIRSTNAME). b) Create a file (filename=test) and use chmod command to add the write permission for Others. c) Use setfacl to remove write permission to YOUR-FIRSTNAME user. Use getfacl to check the file's permissions. d) Remove YOUR-FIRSTNAME user. Deliverable(Screenshots from each section if possible please)
One of your audit clients approaches you about doing some additional work for the company. Some...
One of your audit clients approaches you about doing some additional work for the company. Some of the things that the client needs your firm’s help with include: Financial projections that includes the acquisition of a failing company. Preparation of forecasted financial statements for a bank loan. You are excited to be able to present this new opportunity to the partners of the firm, but there are several factors the firm must consider. Assume your firm decides to provide these...
Create a C program that has a sequence of at least 8 linux commands you would...
Create a C program that has a sequence of at least 8 linux commands you would execute to display what each command does. Explain what each command is doing and show the output of them.
In this assignment you will use pointers and structures to create Single and double link list....
In this assignment you will use pointers and structures to create Single and double link list. Write a menu driven program with the menu options: 1. Insert in Linked List       1. Insert in Single linked list              1. Insert at front(head)              2. Insert at Index              3. Insert at end(tail)       2. Insert in double linked list              1. Insert at front(head)              2. Insert at Index              3. Insert at end(tail) 2. Print       1. Print linked...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a file “/home/alice/foo”, which is owned by an ordinary user Alice. You need to give a permission to read a this file to an ordinary user Bob, but no one else (of course, you as superuser will be able to read it too). Explain how you will do it. Note: You do not have to provide specific commands, just a short description will suffice. [Limitations...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a...
[Linux permissions] Suppose that you are a superuser on a Linux system, and there is a file “/home/alice/foo”, which is owned by an ordinary user Alice. You need to give a permission to read a this file to an ordinary user Bob, but no one else (of course, you as superuser will be able to read it too). Explain how you will do it. Note: You do not have to provide specific commands, just a short description will suffice.
**Need to use awk command in putty (should be a ONE LINE COMMAND) Write the command...
**Need to use awk command in putty (should be a ONE LINE COMMAND) Write the command that would find all lines that have an email address and place a label email = before the line in the file longfile output will multiple lines similar to this one : using a good awk command the output would be something like this email = From: "Linder, Jann/WDC" <[email protected]> email = To: Mr Arlington Hewes <[email protected]> email = > From: Mr Arlington Hewes...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT