✍️
Notes.md
  • Table of contents
  • React.Js
    • React Hooks
    • Old :- React : Using Classes
  • Blockchain
    • Solidity
    • Custom ERC20 token
    • Contract
  • Tools and Tech
    • Docker
    • Git version Control
  • Java
    • Data & Data Types
    • IO in Java
    • Data Structures
      • Array in Java
      • Collections in Java
      • Map in Java
      • Enums in Java
      • Linked List in Java
      • List in Java
      • Queues & Stacks
      • Set in Java
      • TreeSet and TreeMap
    • Object Oriented Programming
      • Object Class Methods and Constructor
      • Immutable Class & Objects
      • Constructors
      • Visibility
      • Generics
    • Threads in Java
    • Useful Stuff Java
      • Lambda & Stream
    • Keywords in Java
      • Annotations
      • Comparators
      • Packages in Java
    • Miscellaneous
    • Articles to refer to
  • Golang
    • Competitive Programming in Go
    • Testing simple web server
    • Learning Go : Part 1
    • Maps vs slices
    • Golang Garbage Collector 101
    • Things Golang do differently
    • Go Things
  • Linux
    • Shell programming
    • Linux Commands Part 1 - 4
    • Linux Commands Part 5 - 8
    • Linux Commands Part 9 - 10
  • Software Design
    • Solid Design
    • OOPS
    • Design Patterns
      • Creational Design Pattern
        • Builder DP
        • Factory DP
        • Singleton DP
      • Adapter DP
      • Bridge DP
      • Iterator DP
      • State DP
      • Strategy DP
      • Behavioral Design Pattern
        • Observer DP
      • Structural Design Pattern
        • Facade DP
  • Cloud
    • Google Cloud Platform
      • GCP Core Infrastructure
      • Cloud Networking
  • Spring Boot
    • Spring Basics
      • Spring Beans
      • Important Annotations
      • Important Spring Things
      • Maven Things
      • Spring A.O.P
    • Spring Boot Controller
      • Response Entity Exception Handling
    • Spring Things
    • Spring MVC
    • Spring Data
      • Redis
      • Spring Data JPA
      • JDBC
    • Apache Camel
  • Miscellaneous
    • Troubleshooting and Debugging
Powered by GitBook
On this page
  • chown and chgrp
  • Processes

Was this helpful?

  1. Linux

Linux Commands Part 9 - 10

PreviousLinux Commands Part 5 - 8NextSoftware Design

Last updated 2 years ago

Was this helpful?

Tags: linux-com-book

  • User accounts are defined in the /etc/passwd file

  • groups are defined in the /etc/group file

chown and chgrp

  • chown : to change the file ownership

  • chgrp : to change the group

d|rwx|rwx|rwx

  • d : directory

  • 1st block for user

  • 2nd block for group (of user)

  • 3rd block for other

chmod u=rwx test.sh
chmod g=rwx test.sh
chmod o=rwx test.sh
chmod go-wx test.sh
chmod 744 test.sh

numbering system : read = 4 write = 2 exec = 1

Processes

  • When a system starts up, the kernel initiates a few of its own activities as processes and launches a program called init

  • init, in turn, runs a series of shell scripts (located in /etc) called init scripts

  • The fact that a program can launch other programs is expressed in the process scheme as a parent process producing a child process

# to look at process 
ps 

# to show all process regardless of terminal
ps x

# output 
PID TTY      STAT   TIME COMMAND
   1876 ?        Ss     0:02 /usr/lib/systemd/systemd --user
   1881 ?        S      0:00 (sd-pam)
   1895 ?        Ss     0:12 /usr/bin/appimagelauncherd
   1902 ?        Sl     0:00 /usr/bin/gnome-keyring-daemon --daemon
   1915 tty2     Ssl+   0:00 /usr/libexec/gdm-wayland-session /usr/
   1917 ?        Ss     0:00 /usr/bin/dbus-broker-launch --scope us
   1920 ?        S      0:02 dbus-broker --log 4 --controller 9 --m
   1923 tty2     Sl+    0:00 /usr/libexec/gnome-session-binary
   1982 ?        Ssl    0:00 /usr/libexec/gnome-session-ctl --monit
   1983 ?        Ssl    0:00 /usr/libexec/uresourced --user
   1986 ?        Ssl    0:00 /usr/libexec/gnome-session-binary --sy
   1990 ?        Ssl    0:00 /usr/libexec/gvfsd

# for a detailed look
ps aux

# output
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.0  0.2 173328 17748 ?        Ss   16:29   0:01 /usr/lib/systemd/systemd
root           2  0.0  0.0      0     0 ?        S    16:29   0:00 [kthreadd]
root           3  0.0  0.0      0     0 ?        I<   16:29   0:00 [rcu_gp]
root           4  0.0  0.0      0     0 ?        I<   16:29   0:00 [rcu_par_gp]
root           5  0.0  0.0      0     0 ?        I<   16:29   0:00 [netns]
root           7  0.0  0.0      0     0 ?        I<   16:29   0:00 [kworker/0:0H-events_highpri]
root           9  0.0  0.0      0     0 ?        I<   16:29   0:00 [kworker/0:1H-events_highpri]
root          10  0.0  0.0      0     0 ?        I<   16:29   0:00 [mm_percpu_wq]
root          11  0.0  0.0      0     0 ?        I    16:29   0:06 [kworker/u32:1-blkcg_punt_bio]
root          12  0.0  0.0      0     0 ?        I    16:29   0:00 [rcu_tasks_kthread]
root          13  0.0  0.0      0     0 ?        I    16:29   0:00 [rcu_tasks_rude_kthread]
root          14  0.0  0.0      0     0 ?        I    16:29   0:00 [rcu_tasks_trace_kthread]
root          15  0.0  0.0      0     0 ?        S    16:29   0:00 [ksoftirqd/0]

Information shown by top

  • to kill a process : kill -signal [PID]

file types
permission attributes
chmod permission symbolic notation
chmod notation example
file permission in octal
process state diagram
top field information
top field information
process signals
process signals part 2
process signals part 3