Linux Commands for Cloud and DevOps Engineers

Amal Kuriakose - Aug 21 - - Dev Community

Basic navigation:

# List files and directories
ls

# Change directory
cd

# Print the current working directory
pwd

# Create a directory
mkdir

# Remove a directory
rmdir

# Copy files
cp

# Move or rename files
mv

# Find files based on criteria
find
Enter fullscreen mode Exit fullscreen mode

File management:

# Remove files
rm

# Create file
touch

# Open a file
vi

# View content of a file
cat

# View large text files in the command prompt
more

# Display the first few lines of a file
head

# Display the last few lines of a file
tail

# Live monitoring if a file
tail -f

# Change file permissions
chmod

# Change file ownership
chown
Enter fullscreen mode Exit fullscreen mode

System monitoring and management:

# Display process information
ps

# Show running processes
top

# Display disk space usage
df

# Display disk space usage for files
du

# Display memory usage
free

# find out how long the system is active (running)
uptime

# Terminate a process
kill
Enter fullscreen mode Exit fullscreen mode

Networking:

# Configure network interfaces
ifconfig

# Test network connectivity
ping

# Display network statistics
netstat

# Trace the route to a host
traceroute

# Data transfer to or from a server
curl

# Retrieve files from the internet or server
wget
Enter fullscreen mode Exit fullscreen mode

Text processing:

# Search for text patterns within files
grep

# Pattern scanning and processing language
awk

# Stream editor for text manipulation
sed

# Filters out the repeated lines in a file
uniq

# Word count
wc
Enter fullscreen mode Exit fullscreen mode

File compression:

# Create, extract, or list archive files
tar

# Compress or decompress files
gzip
Enter fullscreen mode Exit fullscreen mode

User management:

# Display the users currently logged in
who

# Display the username of the user who is currently logged in
whoami

# Add user
useradd

# Set password
passwd

# Switch user
su

# Delete user
userdel
Enter fullscreen mode Exit fullscreen mode

System information:

# Details about your Linux system
uname

# Obtain the system hostname
hostname

# CPU information
lscpu
cat /proc/cpuinfo

# Disk info
lsblk
Enter fullscreen mode Exit fullscreen mode

Disk management:

# view, create, delete, change, resize, copy and move partitions
fdisk

# make a file system on a formatted storage device
mkfs
Enter fullscreen mode Exit fullscreen mode

Miscellaneous:

# Package management
yum
apt

# Get date
date

# Clear screen
clear

# Access documentation of a command
man
Enter fullscreen mode Exit fullscreen mode
. . . .