9. Linux Commands. ( su, sudo, ownership change, script, processes ) - Agnivo102/Database_Architect GitHub Wiki

Switch user:

su - root: But you have to know the password of the user.

su agnivo: Only root requires the -

Change ownership:

sudo chown owner-name:owner_group filepath: If you ae not the root user then you would need sudo permission to change ownership. Otherwise you can't do it.

Even though I have given all permission for a group user to enter into the oracle directory they still couldn't enter because they don't have permission to access my home directory. Also because of this I can't access the directory which is owned by me because I don't have permission to access the home directory.

more filename:- Will display the file in a page like format.

Entering a space the next page will show

Script:

Create a file:

Creating directories and files using script:

This scripts can be used on something like when scheduling something like backup. These scripts then will work automatically.

Processes:

ps -ef: Show the running processes.

Kill a process forcefully:

kill -9 process_id: Kill the process forcefully.

top: Show the running tasks

Load avagrae: load is memory used, cpu usage, storage. If the value is higher than 80 then its alarming.

Swap memory: Termpoary ram. assign some space in hard disk as ram (temporary)

Show the current terminal: tty

I have opened an extra terminal. It is showing in processes.

Currently this process is open with the extra terminal. Now lets kill the process forcefully.

Now the process is not running anymore.