Skip to main content

Posts

Showing posts from July, 2017

File permissions

Linux permissions are basically split into two areas. These are: • File ownership • File access permissions Every file has an owner. This is usually the user who created the file, although this can be changed.Users can also be classed into groups, so similar users can be grouped together. The other element is the access permissions for the file. These are split into three areas: • Who can read (view) the file ( r) • Who can write to the file (w) • Who can run the file (this only applies to files that can be run) (x) Let’s look an example. Open a console and do a directory listing by typing: ls -al at the command line.  This is simply a directory listing, but lets look at one line as an example: -rw-r r   1   jono    jono    1701    Jul 13 15:23   test.txt A lot of information is given. Reading the information from left to right, this is what it means: -           File type indicator (- means normal file) rw-r r File permissions jono   Owner jono  

Commands Related to Processes

To see currently running process  ps $ps List the process using most CPU Top , htop $top To stop any process by PID i.e. to kill process kill    {PID} $kill  1012 To stop processes by name i.e. to kill process killall   {Process-name} pkill xkill $killall httpd To get information about all running process ps -ag $ps -ag To stop all process except your shell kill 0 $kill 0 For background processing (With &, use to put particular command and program in background) linux-command  & $ls / -R | wc -l & To display the owner of the processes along with the processes    ps aux $ps aux To see if a particular process is running or not. For this purpose you have to use ps command in combination with the grep command ps ax | grep  process-U-want-to see For e.g. you want to see whether Apache web s