Change your password
- Command for changing the password
passwd [user]
- Lets login as user john and change his passwd
- Login as sudo user and change password of other user
- root user can change password of any user
Change mode
- Syntax
chmod [reference][operator][mode] file ..
- Reference
- u => owner
- g => group
- o => others
- a => all
- Operators
-
- => Add the modes
-
- => Remove the specific modes
- = => The modes specified are made exact
-
- Examples
mkdir -p modtest/{a,b,c}
ls -al modtest/
chmod g=rw modtest/a
ls -al modtest/
umask
- UMask is known as User Mask or it is also called as User file creation Mask.
- This is a base permission or a default permission when a new file or folder is created in linux
touch testfile
mkdir testdir
- The default permissions for file are 644 and for directory are 775
- Lets add following entry into a file
/etc/profile
and add the entryumask 0027
777
027
750
rwxr-x---
- Now observe directory permissions for the newly created directory
Processes
-
A process is basically a program that is executing.
-
Executing the program happens in a sequential
-
To run anything on OS, a process has to be created
-
For any process to run
- A program is loaded into memory and it becomes process. Process has 4 sections
- Stack:
- Stack contains temporary data such as what method/function paramters, return addresses & local
- Heap: This is dynamically allocated memory to process
- Data: Global & static variables
- Text: Program counter, Process registers
- Stack:
- A program is loaded into memory and it becomes process. Process has 4 sections
-
Process LifeCycle
- Start
- Ready
- Running
- Waiting
- Terminated or Exited
-
Lets understand commands which we would examine w.r.t process
- ps: Report the snapshot of current process
- top: Display task
- jobs: List active jobs
- bg: Place the job in the background
- fg: Place the job in the foreground
- kill: Send a signal to a process
- Killall: Kill a process by name
- shutdown: Shutdown or reboot a system
-
Daemon Programs:
- When a linux starts, kernel has to run some activites, so it initiates those activities as process and launches a program called as init
- init runs a series of shell scripts called as init scripts, which start all the system services.
- Many of these services are implemented as daemon programs, Programs that jus run in the background and generally they don’t have UI.