130 likes | 307 Vues
Using Linux Commands. Lab 3. Checking system activity. To list running processes and monitoring system usage: a option ask to show process of all users who are associated with your current terminal
E N D
Using Linux Commands Lab 3
Checking system activity • To list running processes and monitoring system usage: • a option ask to show process of all users who are associated with your current terminal • u option asks that user names be shown , as well as other information such as the time process started and CPU usage. • VSZ (virtual set size) size of image process(in kilobytes). • RSS(resident set size) size of program in memory.
Checking system activity • To see and monitor all the processes running on the system : use spacebar to page through , and q to end the list
Checking system activity • To stop any process by PID i.e. to kill process • To stop all process except your shell
Exiting the shell • To exit the shell • To logout the system
Using the Shell in LinuxCommands Syntax • Options: could be added to the commands to change their behavior(-a , -la , --help) • Argument: is an extra piece of information(ex.: a file name) • Environment variables : where the shell stores information that may be useful to the user’s shell session.(ex.: $HOME) • Meta characters: that have special meaning to the shell • (>) used to direct the output of a command to a file. • ( | ) pipe the output to another command.
Getting Help with Using the Shell • Use the help command )help command ) • Use --help with the command(date --help) • Use theman command
Understanding file permission • Why • Keep users from accessing other users’ private files • To protect important system files • permissions bits rwx rwx rwx Owner’s| Group | Others r = read w = write x = execute
Change permission on a file For r, w, x octal value is 4,2,1 respectively owner(u) group(g) other(o) all(a)rwxrwxrwx owner(u) group(g) other(o) all(a)---------
Creating files and directories • Go to your home directory. Type cd. • Make sure that you got to your home directory, type pwd • Create a new directory called test in your home directory: • Check the permissions of the directory by typing: • Suppose that you want to prevent everyone else from using or viewing the files in this directory: • Make the test directory your current directory :