Lab 4

The chmod command changes the permissions of a file or directory. This means that by typing in a certain number after chmod you can change which users can access certain files on a Linux system. For example 777 allow the file to be read written and executed while inputting 400 will only allow the file to be read. The permissions are represented using octal notation. The permissions of a file can be viewed by putting ls-l and the file name.

chmod

 

The chown command is used to change the owner of a file.

chown

 

The su command allows you to log in as another user you must know the password of the other account you wish to sue or you will be denied access.

su

The sudo command is used to allow commands to be executed by a different user like a super user. A super user is the administrator of the computer this allows the super user (in Linux) to change any file as they please they also dictate what other users have super user rights.

sudo

The passwd command is used to change the password of an account.

passwd

The ps command displays all active processes it also displays the commands PID that identifies the specific process and allows for easier termination of a process.

Screen Shot 2014-11-04 at 10.41.41 PM

The kill command does what its name implies it kills any process that is currently running. In the example below the xlogo & process is activated then the PID for the process is found and the kill command was used to stop that specific process.

kill1 kill2

The printenv command displays a list of the environment variables. The environment variables come form many different places. For example, when your shell starts it usually reads a bunch of initializing scripts that set some environment variables. The specifics of these variables vary from shell to shell.

printen

Leave a Reply

Your email address will not be published. Required fields are marked *