
Essential Linux Commands: The Ultimate Guide for Data Analysts, Engineers & Raspberry Pi Enthusiasts
Your Comprehensive Beginner’s Reference with Explanations, Risks, and Distribution Tips
Looking for essential Linux commands for data analytics, engineering, or Raspberry Pi projects? This comprehensive guide provides clear explanations, risk notes, and distribution-specific tips, making it perfect for both beginners and experienced users.
Published: May 07, 2025 – This article was created using AI.
1. File and Directory Management
Introduction: Managing files and directories is fundamental in Linux. These commands help you navigate, organize, and secure your data.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
ls | List directory contents | All | – |
cd | Change directory | All | – |
pwd | Print working directory | All | – |
cp | Copy files and directories | All | Overwrites target without warning |
mv | Move or rename files/directories | All | Overwrites target without warning |
rm | Remove files or directories | All | Irrecoverable deletion; use with caution |
mkdir | Make directories | All | – |
rmdir | Remove empty directories | All | Only works on empty dirs |
touch | Create empty files or update timestamps | All | – |
find | Search for files in a directory hierarchy | All | Can be slow on large trees |
locate | Find files by name (uses database) | May require install/update | Database must be current |
tree | Display directories in a tree format | May require install | – |
chmod | Change file permissions | All | Wrong permissions can cause security issues |
chown | Change file owner and group | All | Wrong owner can block access |
chgrp | Change group ownership | All | – |
stat | Display file or file system status | All | – |
2. File Viewing and Editing
Introduction: Quickly view, search, and edit files-essential for data exploration and manipulation.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
cat | Concatenate and display file content | All | Large files can flood terminal |
tac | Display file content in reverse | All | – |
more | View file content page by page | All | – |
less | View file content scrollably | All | – |
head | Output the first part of a file | All | – |
tail | Output the last part of a file | All | – |
nano | Simple terminal text editor | All | – |
vim / vi | Advanced text editors | All | Steep learning curve |
emacs | Powerful text editor | May require install | – |
grep | Search text using patterns | All | – |
sed | Stream editor for filtering and transforming text | All | Wrong syntax can corrupt data |
awk | Pattern scanning and processing language | All | – |
cut | Remove sections from each line of files | All | – |
sort | Sort lines of text files | All | – |
uniq | Report or omit repeated lines | All | – |
3. Process Management
Introduction: Monitor, control, and optimize running processes for system stability and performance.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
ps | Snapshot of current processes | All | – |
top | Display Linux tasks live | All | – |
htop | Interactive process viewer | May require install | – |
kill | Send signal to a process | All | Wrong PID can kill critical processes |
killall | Terminate processes by name | All | – |
bg | Resume job in background | All | – |
fg | Bring job to foreground | All | – |
jobs | List active jobs | All | – |
nice | Run with modified scheduling priority | All | – |
renice | Alter priority of running processes | All | – |
uptime | Show system uptime | All | – |
time | Measure program running time | All | – |
4. Disk Management
Introduction: Manage disks, partitions, and file systems for optimal storage and performance.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
df | Report file system disk space usage | All | – |
du | Estimate file/directory space usage | All | – |
fdisk | Partition table manipulator (MBR) | Not for GPT; advanced use only | Data loss if misused! |
lsblk | List block device info | All | – |
mount | Mount a file system | All | Wrong use can make system unusable |
umount | Unmount a file system | All | – |
parted | Partition manipulation program | May require install | – |
mkfs | Create a file system | All | WARNING: Destroys data on partition! |
fsck | File system consistency check | All | Never run on mounted partitions! |
blkid | Print block device attributes | All | – |
5. Networking
Introduction: Configure, diagnose, and troubleshoot network connectivity and performance.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
ifconfig | Configure network interfaces (deprecated) | Often not preinstalled, replaced by ip | – |
ip | Modern network configuration tool | All | – |
ping | Send ICMP Echo requests | All | – |
netstat | Network statistics (deprecated) | Use ss instead | – |
ss | Socket statistics (faster than netstat) | All | – |
traceroute | Trace the route packets take | All | – |
nslookup | Query DNS servers | All | – |
dig | DNS lookup utility | May require install | – |
wget | Non-interactive network downloader | All | – |
curl | Transfer data with URLs | All | – |
scp | Secure copy files between hosts | All | – |
ssh | Secure shell for remote login | All | Security risk with weak passwords |
ftp | File Transfer Protocol client | May require install | Insecure, use SFTP/SSH instead |
6. User and Group Management
Introduction: Manage users and groups to ensure secure, multi-user environments.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
useradd | Add a user | All | – |
usermod | Modify a user account | All | – |
userdel | Delete a user account | All | May delete home directory! |
groupadd | Add a group | All | – |
groupdel | Delete a group | All | – |
passwd | Change user password | All | – |
chage | Change user password expiry info | All | – |
whoami | Print current user | All | – |
who | Show who is logged in | All | – |
w | Show who is logged in and what they’re doing | All | – |
id | Display user and group info | All | – |
groups | Show user’s groups | All | – |
7. System Information and Monitoring
Introduction: Check system health, hardware, and performance for troubleshooting and optimization.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
uname | Print system information | All | – |
hostname | Show/set system hostname | All | – |
uptime | System uptime | All | – |
dmesg | Boot and system messages | All | – |
free | Display memory usage | All | – |
top | Display Linux tasks | All | – |
vmstat | Virtual memory statistics | All | – |
lscpu | CPU architecture info | All | – |
lsusb | List USB devices | All | – |
lspci | List PCI devices | All | – |
lshw | Hardware configuration | May require install | – |
8. Archiving and Compression
Introduction: Archive, compress, and extract files for efficient storage and transfer.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
tar | Archive files | All | – |
tar -czf archive.tar.gz /path/to/directory | Compress files using gzip | All | – |
tar -xzf archive.tar.gz | Extract gzipped tarball | All | – |
tar -cf archive.tar /path/to/directory | Create a tarball | All | – |
tar -xf archive.tar | Extract tarball | All | – |
zip | Package and compress files into a ZIP archive | May require install | – |
unzip | Extract files from a ZIP archive | May require install | – |
gzip | Compress files using the gzip algorithm | All | – |
gunzip | Decompress files compressed with gzip | All | – |
bzip2 | Compress files using the bzip2 algorithm | May require install | – |
bunzip2 | Decompress files compressed with bzip2 | May require install | – |
xz | Compress files using the xz algorithm | May require install | – |
unxz | Decompress files compressed with xz | May require install | – |
9. Package Management (Depends on Distribution)
Introduction: Install, update, and remove software-package managers vary by distribution.
Command | Description | Distribution | Risks/Dangers |
---|---|---|---|
apt-get | APT package handling utility | Debian/Ubuntu | – |
apt-get install <package> | Install a package | Debian/Ubuntu | – |
apt-get update | Update package list | Debian/Ubuntu | – |
apt-get upgrade | Upgrade installed packages | Debian/Ubuntu | – |
apt-get remove <package> | Remove a package | Debian/Ubuntu | – |
apt-cache search <package> | Search for a package | Debian/Ubuntu | – |
apt-cache show <package> | Show package details | Debian/Ubuntu | – |
yum | RPM-based package manager | CentOS, RHEL | – |
yum install <package> | Install a package | CentOS, RHEL | – |
yum update | Update installed packages | CentOS, RHEL | – |
yum remove <package> | Remove a package | CentOS, RHEL | – |
dnf | Next-gen package manager | Fedora, CentOS 8+ | – |
dnf install <package> | Install a package | Fedora, CentOS 8+ | – |
dnf update | Update installed packages | Fedora, CentOS 8+ | – |
dnf remove <package> | Remove a package | Fedora, CentOS 8+ | – |
rpm -i <package.rpm> | Install an RPM package | RHEL, CentOS, Fedora | – |
rpm -e <package> | Remove an RPM package | RHEL, CentOS, Fedora | – |
dpkg -i <package.deb> | Install a Debian package | Debian/Ubuntu | – |
dpkg -r <package> | Remove a Debian package | Debian/Ubuntu | – |
Note: Package managers are distribution-specific. For example, apt-get
does not work on CentOS or Fedora; use yum
or dnf
instead.
10. System Services and Daemon Management
Introduction: Start, stop, and monitor services-crucial for servers, data pipelines, and IoT projects.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
systemctl | Control systemd services | systemd-based (Ubuntu, Fedora) | Not on SysVinit systems |
systemctl start <service> | Start a service | systemd-based | – |
systemctl stop <service> | Stop a service | systemd-based | – |
systemctl restart <service> | Restart a service | systemd-based | – |
systemctl enable <service> | Enable service at boot | systemd-based | – |
systemctl disable <service> | Disable service at boot | systemd-based | – |
systemctl status <service> | Check service status | systemd-based | – |
service <service> start | Start a service | SysVinit-based | – |
service <service> stop | Stop a service | SysVinit-based | – |
service <service> restart | Restart a service | SysVinit-based | – |
service <service> status | Check service status | SysVinit-based | – |
11. Scheduling Tasks
Introduction: Automate repetitive or scheduled tasks with cron and related tools.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
cron | Daemon for scheduled commands | All | – |
crontab -e | Edit user’s cron jobs | All | Syntax errors break schedules |
at | Run commands at specified time | All | – |
batch | Run when system load is low | All | – |
12. File Permissions and Security
Introduction: Advanced permission management and security controls are essential for protecting sensitive data and managing multi-user environments. The following commands allow you to set, view, and modify permissions, as well as manage user privileges securely.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
chmod | Change file permissions | All | Incorrect permissions can expose or block access to files |
chown | Change file owner and group | All | Wrong owner/group can restrict access or cause system issues |
chgrp | Change group ownership of a file | All | – |
umask | Set default permissions for new files | All | Improper settings may create insecure files |
setfacl | Set file access control lists (ACL) | May require install | Complex ACLs can cause confusion or unintended access |
getfacl | Get file access control lists (ACL) | May require install | – |
sudo | Execute a command as another user (usually root) | All | Misuse can compromise system security |
visudo | Safely edit the sudoers file | All | Syntax errors can block sudo access |
passwd | Change a user’s password | All | – |
sudoers | Manage sudo access for users (file: /etc/sudoers) | All | Incorrect configuration can lock out admin access |
gpasswd | Administer group password | All | – |
13. System Backup and Restore
Introduction: Reliable backup and restore strategies are crucial for data protection and disaster recovery. The following commands enable you to create, synchronize, and restore backups at file, directory, or disk level.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
rsync | Synchronize files and directories locally or remotely | All | Incorrect options may overwrite or delete files unintentionally |
rsync -avz source/ destination/ | Synchronize directories with archive, verbose, and compression options | All | – |
rsync -avz -e ssh source/ user@remote:/destination/ | Synchronize files over SSH to a remote machine | All | Network issues may interrupt transfer |
cpio | Copy files to and from archives | All | Complex syntax, risk of overwriting files |
dd | Low-level copying and backup of entire disks/partitions | All | Misuse can destroy data; always double-check source and target |
dd if=/dev/sda of=/path/to/backup.img | Backup a disk/partition to an image file | All | Source disk must not be in use; image is as large as the source |
dd if=/path/to/backup.img of=/dev/sda | Restore a disk/partition from an image file | All | Will overwrite all data on the target disk/partition |
14. System Diagnostics and Troubleshooting
Introduction: Diagnosing, debugging, and resolving system issues is essential for stable and performant Linux environments. The following commands help you analyze logs, monitor hardware, and trace system activity.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
dmesg | Print kernel ring buffer messages (boot and hardware events) | All | May expose sensitive hardware info |
journalctl | Query and view logs from systemd’s journal | systemd-based | Large logs can be overwhelming |
strace | Trace system calls and signals | All | May slow down traced processes |
strace <command> | Trace a command’s system calls | All | – |
lsof | List open files (useful for debugging) | All | May require root for full info |
lsof <file> | Show processes using a specific file | All | – |
vmstat | Report virtual memory statistics | All | – |
iostat | Report CPU and I/O statistics | May require install | – |
mpstat | Report CPU usage statistics | May require install | – |
pidstat | Report statistics by process | May require install | – |
free | Display memory usage | All | – |
uptime | How long the system has been running | All | – |
watch | Execute a program periodically and show output | All | – |
lshw | List hardware configuration | May require install | – |
htop | Advanced interactive process viewer | May require install | – |
netstat | Network statistics (deprecated, use ss) | All | – |
ss | Show socket statistics (more efficient than netstat) | All | – |
15. Networking & Remote Management
Introduction: Advanced network configuration, diagnostics, and secure remote access are essential for modern Linux systems, especially for servers and distributed data environments. The following commands help you manage interfaces, routes, firewalls, and remote sessions.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
ifconfig | Configure network interfaces (deprecated, use ip instead) | May require install; replaced by ip | May not be available on newer systems |
ip | Show/manipulate routing, devices, and tunnels | All | – |
ip addr | Show IP addresses | All | – |
ip link | Show or manipulate network interfaces | All | – |
ip route | Show or manipulate routing tables | All | – |
ss | Display socket statistics (network diagnostics) | All | – |
nmap | Network exploration and security auditing tool | May require install | Use responsibly; can trigger network security alerts |
telnet | User interface to the TELNET protocol | May require install; insecure, rarely used | Unencrypted; avoid for sensitive data |
nc (netcat) | Network utility for reading and writing from connections | May require install | Can be used maliciously if misconfigured |
iptables | IPv4 packet filtering and NAT | All | Misconfiguration can block network access |
firewalld | Firewall management frontend | Fedora, CentOS | – |
ufw | Uncomplicated firewall (iptables frontend) | Ubuntu, Debian | – |
ufw enable | Enable the firewall | Ubuntu, Debian | May block existing connections if not configured |
ufw allow <port> | Allow traffic on a specific port | Ubuntu, Debian | – |
tcpdump | Packet analyzer for network diagnostics | May require install | Captures sensitive data if not filtered |
curl | Transfer data from or to a server (HTTP, FTP, etc.) | All | – |
wget | Download files from the web | All | – |
scp | Secure copy over SSH | All | Requires SSH access; use strong authentication |
rsync | Remote file and directory synchronization | All | Incorrect options may overwrite/delete files |
ssh | Secure shell for remote login | All | Weak passwords can lead to security breaches |
16. Text Processing Utilities
Introduction: Powerful text processing tools are essential for data analysis, scripting, and automation on Linux. These commands help you search, filter, transform, and summarize text and data files efficiently.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
grep | Search for patterns within files | All | – |
grep 'pattern' file.txt | Search for a pattern in a file | All | – |
grep -r 'pattern' /dir/ | Recursively search for a pattern in a directory | All | Can be slow on large directories |
sed | Stream editor for filtering and transforming text | All | Incorrect patterns can corrupt data |
sed 's/old/new/g' file.txt | Replace ‘old’ with ‘new’ globally in a file | All | – |
awk | Pattern scanning and processing language | All | – |
awk '{print $1}' file.txt | Print the first column of each line in a file | All | – |
cut | Remove sections from each line of files | All | – |
cut -d':' -f1 /etc/passwd | Print the first field of each line, using ‘:’ as delimiter | All | – |
sort | Sort lines of text files | All | – |
uniq | Report or omit repeated lines in a file | All | Requires sorted input for best results |
sort file.txt | uniq | Sort and remove duplicate lines | All | – |
tee | Read from standard input and write to standard output and files | All | – |
echo "text" | tee file.txt | Write to file and show output on screen | All | Overwrites file unless used with -a (append) |
tr | Translate or delete characters | All | – |
echo "hello" | tr 'a-z' 'A-Z' | Convert lowercase to uppercase | All | – |
paste | Merge lines of files | All | – |
paste file1.txt file2.txt | Combine lines of two files side by side | All | – |
wc | Count words, lines, characters, and bytes | All | – |
wc -l file.txt | Count lines in a file | All | – |
wc -w file.txt | Count words in a file | All | – |
17. System Shutdown and Reboot
Introduction: Proper shutdown and reboot procedures are essential for maintaining system integrity and preventing data loss. These commands allow you to safely power off, reboot, or change the runlevel of your Linux system.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
shutdown | Shut down or reboot the system safely | All | Active users may lose unsaved work |
shutdown -h now | Immediately shut down the system | All | All users will be logged out |
shutdown -r now | Immediately reboot the system | All | All users will be logged out |
shutdown -h +10 | Shut down after 10 minutes | All | Warn users in advance |
reboot | Reboot the system | All | Equivalent to shutdown -r now |
halt | Halt the system immediately | All | May not power off on all hardware |
poweroff | Power off the system | All | Equivalent to shutdown -h now |
init 0 | Shutdown (old-style SysVinit) | SysVinit | Use with caution; not for systemd |
init 6 | Reboot (old-style SysVinit) | SysVinit | Use with caution; not for systemd |
18. File System Mounting and Management
Introduction: Mounting and managing file systems is crucial for accessing, organizing, and maintaining persistent storage on Linux. These commands allow you to mount, unmount, and configure file systems safely and efficiently.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
mount | Mount a file system to a directory | All | Incorrect use can make the system or data inaccessible |
mount /dev/sda1 /mnt | Mount partition /dev/sda1 to /mnt | All | Directory must exist and not be in use |
umount | Unmount a file system | All | Unmounting in-use filesystems can cause data loss |
umount /mnt | Unmount the file system mounted at /mnt | All | Ensure no files are open from the mount point |
fstab | File system table configuration file (/etc/fstab ) | All | Incorrect entries can prevent system boot |
blkid | Display block device attributes (UUID, type, etc.) | All | – |
fsck | Check and repair a file system | All | Never run on a mounted or in-use file system |
fsck /dev/sda1 | Check and repair file system on /dev/sda1 | All | Unmount before running |
19. Filesystem Permissions and Security
Introduction: Fine-tuning file and directory permissions is vital for multi-user environments and data protection. These commands allow you to set, view, and manage access rights and advanced permissions on Linux filesystems.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
chmod | Change file or directory permissions | All | Incorrect permissions can expose or block access to files |
chmod 755 file.txt | Set read, write, execute for owner; read, execute for group and others | All | May make files executable unintentionally |
chown | Change file owner and group | All | Wrong owner/group can restrict access or cause issues |
chown user:group file.txt | Change owner and group of a file | All | – |
chgrp | Change group ownership of a file | All | – |
chgrp group file.txt | Change the group of a file | All | – |
umask | Set default permissions for new files | All | Improper settings may create insecure files |
umask 022 | Set default permissions for new files to 755 | All | – |
setfacl | Set Access Control Lists (ACL) for files/directories | May require install | Complex ACLs can cause confusion or unintended access |
getfacl | Get Access Control Lists (ACL) for files/directories | May require install | – |
20. Containerization and Orchestration
Introduction: Containers and orchestration tools like Docker and Kubernetes are essential for scalable, reproducible, and portable environments in data science, engineering, and modern DevOps. These commands help you manage containers, images, and clusters efficiently.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
docker | Docker command-line interface for managing containers | May require install | Requires root or docker group membership |
docker run <image> | Run a container from an image | All | Container may expose ports or consume resources |
docker ps | List running containers | All | – |
docker ps -a | List all containers (including stopped) | All | – |
docker build -t <image_name> . | Build a Docker image from a Dockerfile | All | Dockerfile errors can cause build failures |
docker exec -it <container_id> bash | Open an interactive shell in a running container | All | – |
docker stop <container_id> | Stop a running container | All | Unsaved data in container may be lost |
docker rm <container_id> | Remove a container | All | Data in container will be lost if not persisted |
docker logs <container_id> | View logs of a container | All | – |
docker images | List available Docker images | All | – |
docker rmi <image_name> | Remove a Docker image | All | Images in use by containers cannot be removed |
docker network ls | List Docker networks | All | – |
docker-compose up | Start up a multi-container Docker application | May require install | Misconfigured files can cause failures |
docker-compose down | Stop and remove containers created by docker-compose | May require install | Removes all containers, networks, and volumes defined in the compose file |
docker-compose logs | View logs from containers managed by docker-compose | May require install | – |
kubectl | Kubernetes command-line tool for managing clusters | May require install | Requires access to a running Kubernetes cluster |
kubectl get pods | List pods in the current namespace | All | – |
kubectl get nodes | List nodes in the cluster | All | – |
kubectl get services | List services in the cluster | All | – |
kubectl apply -f <file>.yaml | Apply configuration from a YAML file | All | Incorrect YAML can cause deployment errors |
kubectl exec -it <pod_name> -- bash | Open a shell in a running pod | All | – |
kubectl logs <pod_name> | View logs of a pod | All | – |
kubectl describe pod <pod_name> | Get detailed information about a pod | All | – |
kubectl scale deployment <deployment_name> --replicas=<number> | Scale a deployment to the desired number of replicas | All | – |
kubectl rollout restart deployment <deployment_name> | Restart a deployment | All | – |
kubectl port-forward pod/<pod_name> <local_port>:<remote_port> | Forward a port from a pod to localhost | All | – |
helm | Kubernetes package manager for deploying applications | May require install | – |
helm install <release_name> <chart_name> | Install a Helm chart | All | Incorrect chart or values can cause deployment errors |
helm upgrade <release_name> <chart_name> | Upgrade a Helm release | All | – |
helm list | List all Helm releases | All | – |
helm delete <release_name> | Delete a Helm release | All | Removes all resources managed by the release |
helm search <chart_name> | Search for a Helm chart | All | – |
21. Automation and Configuration Management
Introduction: Automation and configuration management tools help you maintain consistency, reproducibility, and scalability across your infrastructure. These commands cover leading tools like Ansible, Terraform, and Puppet for automating deployments and managing systems as code.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
ansible | Automation tool for configuration management and orchestration | May require install | Requires SSH access to managed nodes |
ansible all -m ping | Ping all hosts defined in the inventory | All | Inventory must be correct |
ansible-playbook playbook.yml | Run an Ansible playbook | All | Playbook errors can cause misconfiguration |
ansible -m command -a 'command' <host> | Run a single command on a target host | All | – |
ansible-playbook --check playbook.yml | Dry-run a playbook to see what would change | All | No changes will be made |
ansible-playbook --limit <host> playbook.yml | Run a playbook on a specific host or group | All | – |
ansible-playbook --extra-vars "key=value" | Pass extra variables to a playbook | All | – |
terraform | Infrastructure as code tool for provisioning and managing cloud resources | May require install | Misconfiguration can affect cloud resources |
terraform init | Initialize a working directory for Terraform configuration | All | – |
terraform plan | Show an execution plan (preview of changes) | All | – |
terraform apply | Apply the changes described in a Terraform configuration | All | Applies changes to real infrastructure |
terraform destroy | Destroy infrastructure created by Terraform | All | Irreversible, removes resources |
terraform validate | Validate the configuration files | All | – |
terraform show | Show the current state of the infrastructure | All | – |
puppet | Configuration management tool (agent/master or standalone) | May require install | Requires manifests and correct configuration |
puppet apply <manifest.pp> | Apply a Puppet manifest locally | All | Misconfiguration can affect system state |
puppet agent --test | Test the Puppet agent (run a one-off configuration) | All | – |
puppet resource | Show the current state of resources (files, services, etc.) | All | – |
22. CI/CD Tools and Commands
Introduction: Continuous Integration and Continuous Deployment (CI/CD) tools automate the building, testing, and deployment of applications. These commands and configurations help you set up and manage CI/CD pipelines with Jenkins, GitLab CI, and GitHub Actions.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
jenkins | Continuous integration tool (typically runs as a Java application) | May require install | Should be secured with authentication |
java -jar jenkins.war | Start Jenkins from a WAR file | All (Java required) | Default port 8080 may conflict with other services |
gitlab-runner register | Register a new runner with GitLab for CI/CD pipelines | May require install | Runner must be secured and properly configured |
gitlab-runner run | Start the GitLab Runner to process jobs | May require install | – |
.gitlab-ci.yml | Configuration file for GitLab CI/CD pipelines (in your repository) | GitLab | Syntax errors will break pipelines |
.github/workflows/ | Directory for GitHub Actions workflow YAML files | GitHub | Incorrect configuration can prevent workflow execution |
actions/checkout@v2 | GitHub Action for checking out repository code | GitHub Actions | – |
actions/setup-node@v2 | GitHub Action for setting up Node.js in a workflow | GitHub Actions | – |
docker/setup-buildx-action@v1 | GitHub Action for setting up Docker Buildx (multi-platform builds) | GitHub Actions | – |
23. Cloud Services
Introduction: Cloud command-line tools let you manage, automate, and monitor cloud resources directly from your terminal. These commands cover AWS CLI, Azure CLI, and Google Cloud SDK (gcloud) for common cloud tasks.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
AWS CLI (Amazon Web Services) | |||
aws | AWS command-line interface for managing AWS services | May require install | Credentials must be secured |
aws configure | Configure AWS CLI with credentials | All | Credentials stored in plain text by default |
aws s3 cp file.txt s3://bucket-name/ | Copy a file to an S3 bucket | All | Overwrites if file exists |
aws s3 sync . s3://bucket-name/ | Synchronize a local directory to an S3 bucket | All | – |
aws ec2 describe-instances | List EC2 instances | All | Requires correct permissions |
aws ec2 start-instances --instance-ids <id> | Start an EC2 instance | All | May incur costs |
aws ec2 stop-instances --instance-ids <id> | Stop an EC2 instance | All | May cause downtime |
Azure CLI (Microsoft Azure) | |||
az | Azure command-line interface | May require install | Credentials must be secured |
az login | Log in to your Azure account | All | – |
az vm list | List all virtual machines | All | – |
az vm start --name <vm_name> --resource-group <group> | Start an Azure VM | All | May incur costs |
az storage blob upload --account-name <account> --container-name <container> --file file.txt --name file.txt | Upload a file to Azure Blob Storage | All | – |
az group create --name <group> --location <location> | Create a new resource group | All | – |
Google Cloud SDK (gcloud) | |||
gcloud | Google Cloud command-line tool | May require install | Credentials must be secured |
gcloud auth login | Authenticate to Google Cloud | All | – |
gcloud compute instances list | List compute instances | All | – |
gcloud compute instances stop <instance_name> | Stop a Google Cloud VM instance | All | May cause downtime |
gcloud app browse | Open the current App Engine application in a browser | All | – |
24. Logging and Monitoring
Introduction: Logging and monitoring are essential for observability, troubleshooting, and performance optimization in modern IT environments. The following tools and commands help you collect, visualize, and analyze metrics and logs from your systems and applications.
Command | Description | Distribution/Notes | Risks/Dangers |
---|---|---|---|
Prometheus | |||
prometheus | Start Prometheus monitoring server | May require install | Should be secured before exposing to networks |
prometheus --config.file=<config_file> | Start Prometheus with a specific configuration file | All | Misconfiguration may cause data loss or failed monitoring |
Grafana | |||
grafana-cli | Manage Grafana plugins from the command line | May require install | – |
grafana-cli plugins install <plugin-name> | Install a plugin in Grafana | All | Plugin compatibility should be checked |
ELK Stack (Elasticsearch, Logstash, Kibana) | |||
elasticsearch | Start Elasticsearch search and analytics engine | May require install | Should be secured before exposing to networks |
curl -XGET 'localhost:9200/_cluster/health?pretty' | Get Elasticsearch cluster health status | All | Requires running Elasticsearch |
logstash | Run Logstash for collecting, parsing, and transforming logs | May require install | Misconfiguration can cause data loss |
logstash -f <config_file> | Run Logstash with a specific configuration file | All | – |
kibana | Start Kibana web interface for visualizing Elasticsearch data | May require install | Should be secured before exposing to networks |
Access Kibana via http://localhost:5601 | Open Kibana dashboard in your browser | All | – |
25. References & Further Reading
- Accessed on May 07, 2025: Linux Command Documentation [LinuxCommand.org]
- Accessed on May 07, 2025: 50+ Essential Linux Commands: A Comprehensive Guide [DigitalOcean]
- Accessed on May 07, 2025: Linux Commands – Rocky Linux Documentation
Read also: