Linux Command Line Basics
Original educational reference document
Introduction
The Linux command line provides a powerful way to navigate files, inspect processes,
manage software, and automate repetitive tasks.
Navigation
pwd prints the current directory. ls lists directory contents. cd changes directories. Use
absolute paths when you need an unambiguous location.
Files and Directories
mkdir creates directories. touch creates an empty file. cp copies files. mv moves or
renames them. rm removes files. Use rm carefully because command-line deletion may
bypass a graphical trash folder.
Viewing Files
cat prints a file. less allows paged viewing. head shows the beginning of a file, while tail
shows the end. grep searches text for matching patterns.
Permissions
Linux permissions control reading, writing, and execution for the owner, group, and
others. chmod changes permissions, while chown changes ownership.
Processes
ps displays processes. top provides a live process view. kill can send a signal to a
process when you have the necessary permissions.
Package Management
Package commands depend on the distribution. For example, Arch Linux commonly
uses pacman, while Debian-based systems commonly use apt.