Introduction to Linux Command Line
A concise reference guide for developers and students.
Published 2025 | Open Knowledge Series
Overview
The Linux command line is a powerful interface for interacting with your operating system. Unlike
graphical interfaces, the terminal gives you direct control over system operations, file
management, and program execution.
Basic Navigation
Use 'ls' to list files, 'cd' to change directories, and 'pwd' to print the working directory. These three
commands form the foundation of terminal navigation.
Examples:
ls -la # list all files with details
cd /home/user # change to specific directory
pwd # show current path
File Operations
Files can be created, moved, copied, and deleted using simple commands:
touch [Link] # create empty file
cp src dst # copy file
mv old new # move/rename file
rm [Link] # delete file
mkdir newdir # create directory
Text Processing
Linux provides powerful text tools:
cat [Link] # display file contents
grep 'pattern' # search for text
sed 's/old/new/' # find and replace
awk '{print $1}' # process columns
sort [Link] # sort lines
Permissions
File permissions control who can read, write, or execute files. Use 'chmod' to modify permissions
and 'chown' to change ownership.
chmod 755 [Link] # rwxr-xr-x
chown user:group file
Processes
Manage running programs with:
ps aux # list all processes
top # interactive process viewer
kill PID # terminate a process
bg / fg # background/foreground jobs