Question

Unix/Linux The purpose of this lab is to practice the commands to manage and organize files...

Unix/Linux

The purpose of this lab is to practice the commands to manage and organize files and directories:

How would one go about this? Thanks.

Task 1: Preliminaries:
1)
If you have not already done so, create a directory called bin under your HOME directory.
2) If you have not already made a copy (using ftp) of the file called famous.dat from the Assignment#1, do that now.
3) Make bin the active/working directory.

Task 2: Perform all of the following steps from the bin directory:
1) Copy the famous.dat file (from assignment 1) from your home directory into the this (bin) directory and call itfamous.data. (Hint: use ../ )
2) Create a directory called datafiles under this (bin) directory.
3) Make a copy of famous.data into the datafiles directory but use the name famous.backup
4) Make a hard link file called famous.hard into the datafiles directory, that links to famous.data
5) Make a symbolic/soft link file called famous.soft into the datafiles directory, that links to famous.data.Note: the soft link source needs to be an absolute path, as does the destination, since the destination is in a different directory.

Task 3: Submit Assignment 2 by turning in only the output and the commands below.

All commands must be entered from your bin directory.

a) Run the command to print your current working directory so I see the complete path of just that...the directory youare working from.

b) Use the following command to display both the current directory and the datafiles directory and inode values using the options for long (letter l) and inode (letter i):
ls -li . datafiles
(This shows an equal inode value for the hard link as well as the soft link reference: ->)

c) Use the following command to display the datafiles directory using the options lower and capital letter L:
ls -lL datafiles
(This will show the soft link de-referenced)

d) Use metacharacters and the ls -lL command (with lower and upper case L) to list all filenames under thedatafiles directory that contain a dot '.' with the letter 'f' or 'u' anywhere after the dot.

e) Use metacharacters and a single ls -lL command (with lower and upper case L) to list all file names that contain a dot '.' followed by a lower case letter, then end with the letter 't' or 'r' as the second from last character. And these files should be from your current directory as well as any directory under the current directory that contains the letters "data".
For example: data1/a.pqrs would be a match, but dabta.Dtu and datafiles/.soft do not match.
Hint: use two command arguments, one for the current directory, and one for directories the contain 'data'.

Sample Output (NOTE: details such as owner/inode/date will be different)

a) Here is sample output running commands on hills (your output will show your hills user ID):
/students/rpa/bin

b)
[rpa@hills bin]$ ls -li . datafiles
.:
total 4
12198464 drwx------ 2 rpa b20003 4096 Sep 5 15:01 datafiles
12198472 -rwx------ 2 rpa b20003 2401 Sep 5 14:25 famous.data

datafiles:
total 8
12198467 -rwx------ 1 rpa b20003 2401 Sep 5 14:15 famous.backup
12198472 -rwx------ 2 rpa b20003 2401 Sep 5 14:25 famous.hard
12198384 lrwxrwxrwx 1 rpa b20003   33 Sep 5 15:01 famous.soft -> /students/rpa/bin/famous.data

c)

-rwx------ 1 rpa b20003 2401 Sep 5 14:15 famous.backup
-rwx------ 2 rpa b20003 2401 Sep 5 14:25 famous.hard
-rwx------ 2 rpa b20003 2401 Sep 5 14:25 famous.soft

d)

-rwx------ 1 rpa b20003 2401 Sep 5 14:15 datafiles/famous.backup
-rwx------ 2 rpa b20003 2401 Sep 5 14:25 datafiles/famous.soft

e)

-rwx------ 2 rpa b20003 2401 Sep 5 14:25 datafiles/famous.hard
-rwx------ 2 rpal b20003 2401 Sep 5 14:25 famous.data

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Task 1: Preliminaries:

Task 2:
********

We are allowed to do only 4 exercise out of any given.

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)

Add a comment
Know the answer?
Add Answer to:
Unix/Linux The purpose of this lab is to practice the commands to manage and organize files...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please answer the following questions because I am not understanding it Description Investigate UNIX/Linux Files Systems...

    Please answer the following questions because I am not understanding it Description Investigate UNIX/Linux Files Systems by answering the questions below Requirements  Save the recorded information in an ASCII file named “prog2.txt”. The file, “prog2.txt”, must be located in the directory: $HOME/itec400/homework  Make sure the permissions on “prog2.txt” are set to 705.  Solutions to problems below may require research on the web  Record the questions below and the answers in “prog2.txt”. 1. What is the purpose...

  • Revision Question 3 on Linux. Please explain the shell script commands in the context of post...

    Revision Question 3 on Linux. Please explain the shell script commands in the context of post execution. You have just logged in and have a directory called "novel" in your home directory containing the following files: chapter1.docx chapter2.docx chapter3.docx draft.pdf save where "save" is itself a directory and contains the files Attributes.txt draft.pdf.1 draft.pdf.2 draft.pdf.3 indexA.txt indexB.txt list1.txt list2.txt a) Describe the results you would expect when executing the following shell commands: i) ls novel/save/*A* ii) ls novel/*r[23]* iii) rmdir...

  • Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell...

    Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell variables, and .profile script file, echo SHELL, HOME, PATH, MAIL and TERM are predefined shell variables. You can use the value of a shell variable in a shell command putting $ in front of it. For example, to display the value of the HOME directory of the user, specify $HOME in the echo command like echo $HOME. Do not give just the value of...

  • Post-Lab 2: GNU and UNIX commands Keywords: • Sort • head tail • Pipe (D •...

    Post-Lab 2: GNU and UNIX commands Keywords: • Sort • head tail • Pipe (D • Redirection ) • alias • Wildcards • Metacharcters . sed utility Find • tar 1. Create a directory called Dirl and if the creation was successful, change the current working directory to be Dirl. 2. Extract lines 3-5 from a file, first using head to get the first 5 lines then tail to get the last 2 lines . With pipes . With redirection...

  • do numbers 4-8 4. Given any directory, use the Is command to display: • all files...

    do numbers 4-8 4. Given any directory, use the Is command to display: • all files and sub-directories starting with the letter "D" (note do not list anything in any sub-directory) • its immediate sub-directories (sub-directories only, and no other ordinary files) its immediate hidden sub-directories only - take a screenshot (#3-3) that clearly shows the command and the result. 5. Assume that the following files are in the working directory: $ ls intro notesb ref2 section 1 section3 section4b...

  • [1] How can you change the inode associated with a regular file? Specifically, what commands can...

    [1] How can you change the inode associated with a regular file? Specifically, what commands can you run that will result in a file that has exactly the same name as before but has a different inode? Please give the commands and explain what each does. [1] Does a "hole" in a UNIX file affect its logical size? What about its physical size? Explain briefly. [1] To setup key-based login using ssh, what file do you have to create or...

  • 19. UNIX/Linux normally include two editors: vi and (choose the single best answer). 20. You can...

    19. UNIX/Linux normally include two editors: vi and (choose the single best answer). 20. You can use thecommand to create empty a create b. make c touch d mu 21. Which command can be used to leave vi temporarily to access the command line? 22 If you execute the contents of filel are sorted and the results are stored in file2. a sort file1 -ofile2 b. sort file1 >file2 c sort filel -d file2 d sort filel filez field or...

  • Please help with this linux lab. Please include screenshots as I keep getting errors when I...

    Please help with this linux lab. Please include screenshots as I keep getting errors when I attempt this lab. Thank you in advance Example 1 Enter the system root directory cd / pwd [this command prints working directory] Here is how to go back to your home directory: cd ~ pwd Example 2 Use the Change directory command cd /labs/lab1/ohio inside the ohio folder use the Touch command to create a file called ohiostate.txt /labs/lab1/ohio/touch ohiostate.txt Use the pwd and...

  • 1) Write a Unix command that will display the message below using echo and the value...

    1) Write a Unix command that will display the message below using echo and the value of your environment variable instead of the sample student login /students/astud01 My home directory is /students/astude01 2) Write a Unix command to display your login and the system date with both commands on one line (the output may be on separate lines) SAMPLE OUTPUT (details will differ): cconner Tue Jul 7 15:38:44 PDT 2015 3) 1.Write a Unix command that will redirect (>) the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT