Other process commands
bg: A job control command that resumes suspended jobs while keeping them running in the background
Syntax:
bg [ job ]
For example:
bg %19
fg: It continues a stopped job by running it in the foreground.
Syntax:
fg [ %job_id ]
For example
fg 19
top: This command is used to show all the running processes within the working environment of Linux.
Syntax:
top
nice: It starts a new process (job) and assigns it a priority (nice) value at the same time.
Syntax:
nice [-nice value]
nice value ranges from -20 to 19, where -20 is of the highest priority.
renice : To change the priority of an already running process renice is used.
Syntax:
renice [-nice value] [process id]
df: It shows the amount of available disk space being used by file systems
Syntax:
df
Output:
Filesystem 1K-blocks Used Available Use% Mounted on /dev/loop0 18761008 15246876 2554440 86% / none 4 0 4 0% /sys/fs/cgroup udev 493812 4 493808 1% /dev tmpfs 100672 1364 99308 2% /run none 5120 0 5120 0% /run/lock none 503352 1764 501588 1% /run/shm none 102400 20 102380 1% /run/user /dev/sda3 174766076 164417964 10348112 95% /host
free: It shows the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel
Syntax:
free
Output:
total used free shared buffers cached Mem: 1006708 935872 70836 0 148244 346656 -/+ buffers/cache: 440972 565736 Swap: 262140 130084 132056
Processes in Linux/Unix
A program/command when executed, a special instance is provided by the system to the process. This instance consists of all the services/resources that may be utilized by the process under execution.
- Whenever a command is issued in Unix/Linux, it creates/starts a new process. For example, pwd when issued which is used to list the current directory location the user is in, a process starts.
- Through a 5 digit ID number Unix/Linux keeps an account of the processes, this number is called process ID or PID. Each process in the system has a unique PID.
- Used up pid’s can be used in again for a newer process since all the possible combinations are used.
- At any point of time, no two processes with the same pid exist in the system because it is the pid that Unix uses to track each process.