Download presentation
Presentation is loading. Please wait.
Published byCaitlin Chandler Modified over 9 years ago
1
EMT 2390L Lecture 5 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts
2
Outline Ownership Change Mode Changing Identities Processes Environment Variables
3
Ownership Files permissions are divided in three levels: owner, group, everybody o ls -l id command is used to find out information about your identity o id
5
Change Mode chmod - change the mode or permissions of a file or directory Permissions represented using octal notation o > foo.txt o ls -l foo.txt o chmod 600 foo.txt o ls -l foo.txt o chmod 777 foo.txt o ls -l foo.txt
6
Changing Identities su command allows you to log in as another user o su – o su – username sudo command allows you to execute commands as a different user, usually a superuser in a controlled way o sudo chown command is used to change the owner of a file passwd command is used to change the password
7
Processes When the system starts, the kernel executes the init program init runs several shell scripts that start the services When a program launch another program, these are know as parent process and child process respectively. Each process is assigned a process ID (PID) ps – command used to view a snapshot of the processes o ps o ps x top – command used to view process dynamically o top
8
Controlling a Process Execute the following commands o xlogo o Ctrl + C o xlogo & o ps o jobs o fg %1 o Ctrl + Z o ps (Check the PID of xlogo) o kill PID (where PID is the Process ID of xlogo) o xlogo & o kiallall xlogo
9
Commands pstree – command used to display the processes parent/children relationship o pstree vmstat – outputs a snapshot of system resource usage including memory and disk o vmstat printenv – displays a list of the environment variables o printenv o printenv USER o printenv | grep USER o echo $USER
10
Important Environment Variables (cont.)
11
Important Environment Variables
12
Modifying the Environment Locate the configuration files that needs to be modify such as.bash_profile,.bashrc or.profile Create a backup Use a text editor, make the changes, and save them Use the command source followed by the name of the file you just changed to activate the changes o source.profile
13
Assignments Check the class OpenLab site for new Labs Check Blackboard for new Quizzes Midterm Review
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.