Skip to content

Latest commit

 

History

History
37 lines (34 loc) · 3.42 KB

File metadata and controls

37 lines (34 loc) · 3.42 KB

Chapter 5: Process, Job, & Session Control

Move from a casual user to a power user. Learn to manage running tasks, keep scripts alive in the background, and customize your shell session for maximum efficiency and control.

Command Explanation
ps aux Lists all running processes associated with your user with details.
kill <PID> Terminates a process gracefully using its Process ID (PID).
kill -9 <PID> Forcibly kills a stubborn or frozen process.
pkill <process_name> Kills a process based on its name instead of its PID.
pgrep <process_name> Searches for a process by name and prints its PID.
jobs Displays tasks running in the background of your current session.
Ctrl+Z Suspends the current foreground process and moves it to the background.
bg Resumes a suspended job and keeps it running in the background.
fg %<job_number> Brings a background job to the foreground, making it interactive.
command & Appending & to any command starts it directly in the background.
disown Detaches a background job from the current session so it won't be killed on exit.
termux-wake-lock Prevents the device from entering deep sleep, essential for servers.
termux-wake-unlock Releases the wake lock, allowing the device to sleep normally.
termux-reload-settings Applies changes from ~/.termux/termux.properties without a restart.
termux-info Displays important diagnostic information about your Termux installation.
env Prints a list of all environment variables.
export VAR="value" Sets an environment variable for the current session.
unset VAR Deletes an environment variable.
alias shortcut='long command' Creates a custom command shortcut.
unalias shortcut Removes a previously created alias.
source <file> Executes commands from a file in the current shell.
history Displays a list of the commands you've recently used.
uptime Shows how long the system has been running and load averages.
dmesg Prints messages from the kernel ring buffer, for hardware diagnostics.
nohup <command> & Runs a command that ignores the hangup signal, keeping it alive after exit.
htop Provides an interactive view of processes and resource usage (pkg install htop).

< Previous | Home | Next >