How will you specify the location of the files

Assignment Help Operating System
Reference no: EM131021607

Assignment -1

Purpose: To create links and test their properties.

NOTE: These instructions reflect the user interface in version 12.04LTS of Ubuntu.

1. Boot your Ubuntu system and open three command shells. In one of the shells, change your user identity to the root identity. In another, change your user identity to one of the alternate user identities you created during Week 1. Verify that you have a directory named CourseNotes in your home directory. Make sure that the permissions on the directories will not interfere with our experiments by setting the permissions on CourseNotes and Desktop to 777. Open a browser window.

NOTE: You will do most of your work with the shell recognizing you as your primary student identity.

2. Download the files named assign04_sample1.txt and assign04_sample2.txt and save them in CourseNotes. (NOTE: Your browser may save the files in your home directory by default; you can either change the save location or move the files with an mv command after they are downloaded.)

3. Use the cd command to move into the CourseNotes directory. Use the chmod command to change the permissions on the two lecture files. Change the permissions on one of them to allow all three categories of user to read and write. On the other, change the permissions so that only the owner can read and write to the file, leaving no permissions to the other two categories.

4. Get a listing of the lecture files which will provide information about permissions, file sizes, and inodes.
(try this command: ls -il). Write that information on the blanks below:
Permissions File Sizes Inodes

file 1: ____________ ____________ ____________

file 2: ____________ ____________ ____________

5. Use the cd command to move to your Desktop directory. (Try this command: cd ../Desktop).

6. Create one hard link (in the Desktop directory) for each of the two files located in the CourseNotes directory. To name your links, use the base name you used for the original files, but give them the file extension hlnk. Consider the following questions: What options will you give the ln commands? How will you specify the location of the files, since you are not in the same directory? (Instruction #5 should give you a hint.)

7. Get a listing of the links which will provide information about permissions, file sizes, and inodes.
Write that information on the blanks below:
Permissions File Sizes Inodes

file 1: ____________ ____________ ____________

file 2: ____________ ____________ ____________

8. Now create a symbolic link (in the Desktop directory) for each of the files in your CourseNotes directory. Use the same base names again, but this time use the extension slnk.

9. Get a listing of the links which will provide information about permissions, file sizes, and inodes.
Write that information on the blanks below:
Permissions File Sizes Inodes

file 1: ____________ ____________ ____________

file 2: ____________ ____________ ____________

10. Minimize all of your windows and study your screen Desktop. Do you see the links there?

11. Bring up your other two command shells, the ones which recognize you as different users. In each of those, move to the Desktop directory of your primary student user. (cd /home/userid/Desktop)

12. In each of the windows, try to read and edit all four of the links. Notice that the root user is able to do anything; this should reinforce the permissions topic that was discussed last week.

The operating system is enforcing some kind of permissions - are they the permissions defined by the link, or the ones defined by the files located in CourseNotes?

13. Using the window that recognizes you under your primary student identity, make sure you are in your Desktop directory. Create a new link to a non-existent file:

ln -s ../CourseNotes/lecture0x.txt lecture0x.slnk
Get a long listing of the directory. Describe the appearance of your link:

____________________________________________________________

14. Edit your broken link:
vi lecture0x.slnk

Type some information about your three favorite colors, explaining why you like them. Exit vi and obtain a listing of the directory. Describe the appearance of your link now:

Assignment -2

Purpose: To gain experience starting, viewing, and administering processes.

NOTE: These instructions reflect the user interface in version 12.04LTS of Ubuntu.

1. Boot your system and log in. Open a command shell and a web browser.

2. Create a new directory named bin in your home directory.

3. Using your web browser, navigate to the web site specified by your instructor and download the scripts named schedule.sh, sleeper.sh, and zombie.sh. (You will not use the schedule.sh script for this lab, but you will need it in the future.) Save them in your bin directory. Use the chmod command to give read, write, and execute permissions on each of those files to all three categories of user.

4. Type ~/bin/sleeper.sh at the command prompt. (What is the ~ doing?) This causes the command shell to execute (run) the instructions you placed in the file. Record the results

____________________________________________________________

____________________________________________________________

Re-run the script and IMMEDIATELY try to run the ls command. Does the ls command
run right away? Why not?

____________________________________________________________

5. Navigate to your ~/bin directory, where the scripts are located. Try these two commands:
sleeper.sh
./sleeper.sh

Do both commands work?
____________

What is the meaning of the ./ in the second command?
____________

View your search PATH - is ~/bin included in it?
____________

6. Run sleeper.sh again - this time in the background. (Place an & after the command.) Once again, run an ls command immediately. Notice that now the command executes right away.

7. Run sleeper.sh in the background again, and while it is running enter the jobs command. Find the process ID for sleeper.sh using the ps -a command. (NOTE: If you are not quick enough in running these commands, you may have to do the exercise again.)
____________

8. Re-run sleeper in the background. As soon as the command prompt reappears, use the <UPARROW> key to go back to the previous command, then start another process by pressing the <ENTER> key. Repeat until the first sleeper.sh process terminates. How many were you able to start?
____________

9. Open a new terminal window, and in that window execute the top command. Leave it running.

10. Run zombie.sh in the FOREground. Watch your top window for at least 20 seconds. How much CPU time is being occupied by the script?
____________

11. In the window which is now locked by the zombie.sh process, type <CTRL>c.

12. Run sleeper.sh in the foreground, but this time use <CTRL>z immediately. This will stop the process and move it into the background.

13. Type the ps -a command and get the process IDs associated with your sleeper process. You should find TWO of them - one should be given the name sleep, while the other will be identified either as sleeper.sh or as bash. The latter process is the parent process; on some Linux distributions that process is identified by the name of the script, while on others it is identified using the name of the shell invoked by the script. The other process, which should be identified with the name sleep, is a child process started by the script.

What are their process IDs?
____________ ____________

Try using the kill command on the process named sleep (use the PID number as the argument). Then run the ps -a command. Do you see any change?
____________

Now use the kill -9 command on that same process, then run the ps -a command. Describe what you see:
____________________________________________________________

Now use the kill -9 command on the parent process, and run the ps -a command. Describe what you see:
____________________________________________________________

14. Run zombie.sh in the background, then use the ps -a command to obtain the PID of your zombie.sh.

15. In your top window type the letter 'k', then enter the PID of your zombie.sh process. Use a signal of 9, when you are prompted. Observe the way the process disappears from the top window.

16. Shut down top by typing a 'q' in that window.

What are the differences between Windows shortcuts and UNIX symbolic links? Are there any? Please be sure to cite your sources to support your position.

Attachment:- OS.rar

Verified Expert

This assignment has three files assign04, 05 and discussion. Assignment 04 is discussed about file permission in ubuntu, assignment 5 discussed about symbolic link command and discussion assignment is has one question which is explained about difference between windows short cuts and symbolic links in ubuntu. All questions are answered with question and answer.

Reference no: EM131021607

Questions Cloud

Why would a company agree to such a payment : Recently a company AAA acquired another company BBB. On acquisition, the CEO was let go and he received $20 million dollars. The $20 million was not a severance pay. What was it? Why would a company agree to such a payment?
Argument for keeping the statutory corporate tax rate : Make a good argument for keeping the statutory corporate tax rate in the United States the highest in the world and make a counter argument.
How might they benefit u.s. consumers : What does the Justice Department mean by "substantial and credible efficiencies," and how might they benefit U.S. consumers? Why would a merger between two large airlines not be "likely to substantially lessen competition"?
The process of developing target ratios for your firm : You would like to borrow money three years from now to build a new building. In preparation for applying for that loan, you are in the process of developing target ratios for your firm. Which set of ratios represents the best target mix considering t..
How will you specify the location of the files : What options will you give the ln commands? How will you specify the location of the files, since you are not in the same directory?
What is minimum number of colors required for given graph : What is the minimum number of colors required for the following graph so that the adjacent regions with a common boundary other than a point are to have different colors?
A money management guide for students : Conclude with one paragraph stating what you are going to do to change for the better at this time in regards to your finances.
Common stock-what is the market-to-book ratio : The common stock of The Burger Hut is selling for $16.25 a share. The company has earnings per share of $0.42 and a book value per share of $9.28. What is the market-to-book ratio?
What is the common-size percentage for the net income : Foreign Travel Services has net income of $48,400, total assets of $219,000, total equity of $154,800, and total sales of $311,700. What is the common-size percentage for the net income?

Reviews

Write a Review

Operating System Questions & Answers

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd