You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -634,6 +634,29 @@ Regular expressions.
634
634
we can run the `command with number 10` by typing `!10`.
635
635
- to not save typed commands on the history, we type a space before typing the command name.
636
636
637
+
## Process control commands
638
+
639
+
### background/foreground mode
640
+
- run a process in background mode: `man ls &`, the man program will run in the background mode, we can also send a process to bakground by typing `ctrl+z` when it is in a running mode.
641
+
- to see how many jobs we have (background running process): `jobs`
642
+
- to return a background process to the foreground: `fg` without parameters, automatically the job with `+` sign will be brought to the background, we can also pass the identifier of a process.
643
+
644
+
### ps command:
645
+
-`ps -e`: print all running processes.
646
+
-`ps -f`: print all running processes with full details.
647
+
-`ps -aef | grep ls`: to get info about a specific process.
648
+
-`ps -p 1`: to get info about a process based on a given PID.
649
+
-`ps -u zaki`: to get info about a process based on a given UID.
650
+
651
+
### top command:
652
+
-`top` command will display the complete active process, cpu and memory information, `shift+p` will order the output based on cpu usage, `shift+m` will order based on memory usage, `c` to print the absolute path of the process, `k` to kill a process.
653
+
-`top -u zaki`: print only processes owned by a given user.
654
+
655
+
### kill command:
656
+
-`kill 1245` kill the process with the pid 1234, you should be able to kill a process only if youa are the owner of that process.
657
+
-`kill -9 5678`: forcing to kill the process with sigkill signal.
658
+
-`killall vim`: killing all the vim process.
659
+
637
660
## Network linux commands
638
661
-`hostname`: to print the name of the host, with `-d` option it prints the domain name which the machine belongs to, with `-f` option, it prints the fully qualified domaine name, with -`i`, it prints the ip address of the machine.
639
662
-`ping`: used to cchechk the establishement of the connection and also the speed of that connection, `ping www.google.fr`.
0 commit comments