Skip to content

Commit 3b36050

Browse files
authored
process commands
using top, ps, kill....
1 parent 716a3be commit 3b36050

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,29 @@ Regular expressions.
634634
we can run the `command with number 10` by typing `!10`.
635635
- to not save typed commands on the history, we type a space before typing the command name.
636636

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+
637660
## Network linux commands
638661
- `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.
639662
- `ping`: used to cchechk the establishement of the connection and also the speed of that connection, `ping www.google.fr`.

0 commit comments

Comments
 (0)