Skip to document
This is a Premium Document. Some documents on Studocu are Premium. Upgrade to Premium to unlock it.

KC H2 - Assignment 2 of prof Fluture. Familiarization of linux commands

Assignment 2 of prof Fluture. Familiarization of linux commands
Course

Operating Systems Principles (CSCI 340)

16 Documents
Students shared 16 documents in this course
Academic year: 2021/2022
Uploaded by:
0followers
11Uploads
2upvotes

Comments

Please sign in or register to post comments.

Preview text

Lecturer: Dr. Simina Fluture

Name: Bhim K C Homework # 2 Unix A. Standard Directories and Files

Directory: contains the names of files and/or sub-directories. Standard directories contain some special files.

Root Directory (/) The root directory is the top of the file system. It is the master cabinet that contains all folders and files.

  1. Get a listing of your root directory. (use, cd and ls –l)

/bin The binary directory: contains executable files and most Unix commands. 2. Go to /bin directory. (use cd /bin)

  1. List its contents.

  2. List 6 commands that you recognize. 6 Commands that I recognize. i- mkdir: Create a directory ii- ls: List the content of the directory iii- mv: Move a file from one directory to another. iv- pwd: Print the path of working directory v- chmod: Allow to change the permissions on a file vi- rmdir: Remove empty directories

/dev Device directory. 5. Get a listing of the device directory. Do you recognize any device?

Lecturer: Dr. Simina Fluture

/etc Contains commands and files for system administration. Usually, a user is not allowed to change these files. 6. Go to /etc directory.

  1. Do a long listing; Mention a few files that you have already heard about.

  2. What is the most used permission? What does it mean? (Read about permissions in Unix Handout) The most used permissions are read, write, execute. These permissions are represented by three sets of characters, in total of nine characters.

rwx-rwx-rwx

r - read, w – write, x – execute.

First three characters represent read, write and execute for user, second three characters are for group and last three are for others.

  1. Using cat, check the passwd file or similar; look for yourself in the file.

/lib Contains a collection of related files for a given language in a single file called an archive.

/tmp Contains temporary files.

Lecturer: Dr. Simina Fluture

  1. Change the current shell to a tcsh.

  2. Check your new shell. The change will not be listed until the next login.

  3. Use the ps (process status – gives a list of running processes). What do you observe?

Shell Environment variables Bourne, Korn shell C shell CDPATH cdpath alias names for directories accessed with cd ENV path along which Unix looks to find config. files PS1 prompt shell prompt that appears in the command line PWD cwd name of current directory HOME home the name of the user’s home directory when the user logs TERM type of console terminal being used

D. Processes

Check the Unix Handout and go over the section about Processes -section 17.

The action of each shell, the mechanism of how it executes commands and programs, how it handles the command and program I/O and how it is programmed, are affected by the settings of certain environment variables.

  1. Learn about the ps command using man (type man ps)

Lecturer: Dr. Simina Fluture

  1. Give a list of possible states together with their significance. Identify your login shell.

  2. Type ps –l and explain the significance of: F, S, UID, PID, PPID, C, PRI, NI, ADDR, SZ, WCHAN, TTY, TIME, CMD fields.

  3. Use the top command to monitor the CPU activity in real time. It displays the status of the first 15 of the most CPU-intensive tasks on the system as well as the CPU activity. To stop the execution of top, enter <ctrl-C>.

Lecturer: Dr. Simina Fluture Child exits.

The parent will print I am the parent, and my id is... Next, the parent sleeps for 30 seconds.

Since the child ends first, and the parent didn’t do wait (), the child will be for a while in the zombie state. Run the parent in the background, so you can use the top command and identify the zombie, before the parent terminates.

Note: even if the parent terminates, the child is still a zombie. However, the init process reaps the zombies frequently.

Was this document helpful?
This is a Premium Document. Some documents on Studocu are Premium. Upgrade to Premium to unlock it.

KC H2 - Assignment 2 of prof Fluture. Familiarization of linux commands

Course: Operating Systems Principles (CSCI 340)

16 Documents
Students shared 16 documents in this course
Was this document helpful?

This is a preview

Do you want full access? Go Premium and unlock all 7 pages
  • Access to all documents

  • Get Unlimited Downloads

  • Improve your grades

Upload

Share your documents to unlock

Already Premium?
Cs 340
Lecturer: Dr. Simina Fluture
Name: Bhim K C
Homework # 2 Unix
A. Standard Directories and Files
Directory: contains the names of files and/or sub-directories. Standard directories contain some special
files.
Root Directory (/)
The root directory is the top of the file system. It is the master cabinet that contains all folders and files.
1. Get a listing of your root directory. (use, cd and ls –l)
/bin
The binary directory: contains executable files and most Unix commands.
2. Go to /bin directory. (use cd /bin)
3. List its contents.
4. List 6 commands that you recognize.
6 Commands that I recognize.
i- mkdir: Create a directory
ii- ls: List the content of the directory
iii- mv: Move a file from one directory to another.
iv- pwd: Print the path of working directory
v- chmod: Allow to change the permissions on a file
vi- rmdir: Remove empty directories
/dev
Device directory.
5. Get a listing of the device directory. Do you recognize any device?

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.