Essential Linux Commands: The Ultimate Guide for Data Analysts, Engineers & Raspberry Pi Enthusiasts. Made with Flux1.ai by Gary Owl.
Linux Raspberry Pi
Gary Owl  

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.

CommandDescriptionDistribution/NotesRisks/Dangers
lsList directory contentsAll
cdChange directoryAll
pwdPrint working directoryAll
cpCopy files and directoriesAllOverwrites target without warning
mvMove or rename files/directoriesAllOverwrites target without warning
rmRemove files or directoriesAllIrrecoverable deletion; use with caution
mkdirMake directoriesAll
rmdirRemove empty directoriesAllOnly works on empty dirs
touchCreate empty files or update timestampsAll
findSearch for files in a directory hierarchyAllCan be slow on large trees
locateFind files by name (uses database)May require install/updateDatabase must be current
treeDisplay directories in a tree formatMay require install
chmodChange file permissionsAllWrong permissions can cause security issues
chownChange file owner and groupAllWrong owner can block access
chgrpChange group ownershipAll
statDisplay file or file system statusAll

2. File Viewing and Editing

Introduction: Quickly view, search, and edit files-essential for data exploration and manipulation.

CommandDescriptionDistribution/NotesRisks/Dangers
catConcatenate and display file contentAllLarge files can flood terminal
tacDisplay file content in reverseAll
moreView file content page by pageAll
lessView file content scrollablyAll
headOutput the first part of a fileAll
tailOutput the last part of a fileAll
nanoSimple terminal text editorAll
vim / viAdvanced text editorsAllSteep learning curve
emacsPowerful text editorMay require install
grepSearch text using patternsAll
sedStream editor for filtering and transforming textAllWrong syntax can corrupt data
awkPattern scanning and processing languageAll
cutRemove sections from each line of filesAll
sortSort lines of text filesAll
uniqReport or omit repeated linesAll

3. Process Management

Introduction: Monitor, control, and optimize running processes for system stability and performance.

CommandDescriptionDistribution/NotesRisks/Dangers
psSnapshot of current processesAll
topDisplay Linux tasks liveAll
htopInteractive process viewerMay require install
killSend signal to a processAllWrong PID can kill critical processes
killallTerminate processes by nameAll
bgResume job in backgroundAll
fgBring job to foregroundAll
jobsList active jobsAll
niceRun with modified scheduling priorityAll
reniceAlter priority of running processesAll
uptimeShow system uptimeAll
timeMeasure program running timeAll

4. Disk Management

Introduction: Manage disks, partitions, and file systems for optimal storage and performance.

CommandDescriptionDistribution/NotesRisks/Dangers
dfReport file system disk space usageAll
duEstimate file/directory space usageAll
fdiskPartition table manipulator (MBR)Not for GPT; advanced use onlyData loss if misused!
lsblkList block device infoAll
mountMount a file systemAllWrong use can make system unusable
umountUnmount a file systemAll
partedPartition manipulation programMay require install
mkfsCreate a file systemAllWARNING: Destroys data on partition!
fsckFile system consistency checkAllNever run on mounted partitions!
blkidPrint block device attributesAll

5. Networking

Introduction: Configure, diagnose, and troubleshoot network connectivity and performance.

CommandDescriptionDistribution/NotesRisks/Dangers
ifconfigConfigure network interfaces (deprecated)Often not preinstalled, replaced by ip
ipModern network configuration toolAll
pingSend ICMP Echo requestsAll
netstatNetwork statistics (deprecated)Use ss instead
ssSocket statistics (faster than netstat)All
tracerouteTrace the route packets takeAll
nslookupQuery DNS serversAll
digDNS lookup utilityMay require install
wgetNon-interactive network downloaderAll
curlTransfer data with URLsAll
scpSecure copy files between hostsAll
sshSecure shell for remote loginAllSecurity risk with weak passwords
ftpFile Transfer Protocol clientMay require installInsecure, use SFTP/SSH instead

6. User and Group Management

Introduction: Manage users and groups to ensure secure, multi-user environments.

CommandDescriptionDistribution/NotesRisks/Dangers
useraddAdd a userAll
usermodModify a user accountAll
userdelDelete a user accountAllMay delete home directory!
groupaddAdd a groupAll
groupdelDelete a groupAll
passwdChange user passwordAll
chageChange user password expiry infoAll
whoamiPrint current userAll
whoShow who is logged inAll
wShow who is logged in and what they’re doingAll
idDisplay user and group infoAll
groupsShow user’s groupsAll

7. System Information and Monitoring

Introduction: Check system health, hardware, and performance for troubleshooting and optimization.

CommandDescriptionDistribution/NotesRisks/Dangers
unamePrint system informationAll
hostnameShow/set system hostnameAll
uptimeSystem uptimeAll
dmesgBoot and system messagesAll
freeDisplay memory usageAll
topDisplay Linux tasksAll
vmstatVirtual memory statisticsAll
lscpuCPU architecture infoAll
lsusbList USB devicesAll
lspciList PCI devicesAll
lshwHardware configurationMay require install

8. Archiving and Compression

Introduction: Archive, compress, and extract files for efficient storage and transfer.

CommandDescriptionDistribution/NotesRisks/Dangers
tarArchive filesAll
tar -czf archive.tar.gz /path/to/directoryCompress files using gzipAll
tar -xzf archive.tar.gzExtract gzipped tarballAll
tar -cf archive.tar /path/to/directoryCreate a tarballAll
tar -xf archive.tarExtract tarballAll
zipPackage and compress files into a ZIP archiveMay require install
unzipExtract files from a ZIP archiveMay require install
gzipCompress files using the gzip algorithmAll
gunzipDecompress files compressed with gzipAll
bzip2Compress files using the bzip2 algorithmMay require install
bunzip2Decompress files compressed with bzip2May require install
xzCompress files using the xz algorithmMay require install
unxzDecompress files compressed with xzMay require install

9. Package Management (Depends on Distribution)

Introduction: Install, update, and remove software-package managers vary by distribution.

CommandDescriptionDistributionRisks/Dangers
apt-getAPT package handling utilityDebian/Ubuntu
apt-get install <package>Install a packageDebian/Ubuntu
apt-get updateUpdate package listDebian/Ubuntu
apt-get upgradeUpgrade installed packagesDebian/Ubuntu
apt-get remove <package>Remove a packageDebian/Ubuntu
apt-cache search <package>Search for a packageDebian/Ubuntu
apt-cache show <package>Show package detailsDebian/Ubuntu
yumRPM-based package managerCentOS, RHEL
yum install <package>Install a packageCentOS, RHEL
yum updateUpdate installed packagesCentOS, RHEL
yum remove <package>Remove a packageCentOS, RHEL
dnfNext-gen package managerFedora, CentOS 8+
dnf install <package>Install a packageFedora, CentOS 8+
dnf updateUpdate installed packagesFedora, CentOS 8+
dnf remove <package>Remove a packageFedora, CentOS 8+
rpm -i <package.rpm>Install an RPM packageRHEL, CentOS, Fedora
rpm -e <package>Remove an RPM packageRHEL, CentOS, Fedora
dpkg -i <package.deb>Install a Debian packageDebian/Ubuntu
dpkg -r <package>Remove a Debian packageDebian/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.

CommandDescriptionDistribution/NotesRisks/Dangers
systemctlControl systemd servicessystemd-based (Ubuntu, Fedora)Not on SysVinit systems
systemctl start <service>Start a servicesystemd-based
systemctl stop <service>Stop a servicesystemd-based
systemctl restart <service>Restart a servicesystemd-based
systemctl enable <service>Enable service at bootsystemd-based
systemctl disable <service>Disable service at bootsystemd-based
systemctl status <service>Check service statussystemd-based
service <service> startStart a serviceSysVinit-based
service <service> stopStop a serviceSysVinit-based
service <service> restartRestart a serviceSysVinit-based
service <service> statusCheck service statusSysVinit-based

11. Scheduling Tasks

Introduction: Automate repetitive or scheduled tasks with cron and related tools.

CommandDescriptionDistribution/NotesRisks/Dangers
cronDaemon for scheduled commandsAll
crontab -eEdit user’s cron jobsAllSyntax errors break schedules
atRun commands at specified timeAll
batchRun when system load is lowAll

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.

CommandDescriptionDistribution/NotesRisks/Dangers
chmodChange file permissionsAllIncorrect permissions can expose or block access to files
chownChange file owner and groupAllWrong owner/group can restrict access or cause system issues
chgrpChange group ownership of a fileAll
umaskSet default permissions for new filesAllImproper settings may create insecure files
setfaclSet file access control lists (ACL)May require installComplex ACLs can cause confusion or unintended access
getfaclGet file access control lists (ACL)May require install
sudoExecute a command as another user (usually root)AllMisuse can compromise system security
visudoSafely edit the sudoers fileAllSyntax errors can block sudo access
passwdChange a user’s passwordAll
sudoersManage sudo access for users (file: /etc/sudoers)AllIncorrect configuration can lock out admin access
gpasswdAdminister group passwordAll

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.

CommandDescriptionDistribution/NotesRisks/Dangers
rsyncSynchronize files and directories locally or remotelyAllIncorrect options may overwrite or delete files unintentionally
rsync -avz source/ destination/Synchronize directories with archive, verbose, and compression optionsAll
rsync -avz -e ssh source/ user@remote:/destination/Synchronize files over SSH to a remote machineAllNetwork issues may interrupt transfer
cpioCopy files to and from archivesAllComplex syntax, risk of overwriting files
ddLow-level copying and backup of entire disks/partitionsAllMisuse can destroy data; always double-check source and target
dd if=/dev/sda of=/path/to/backup.imgBackup a disk/partition to an image fileAllSource disk must not be in use; image is as large as the source
dd if=/path/to/backup.img of=/dev/sdaRestore a disk/partition from an image fileAllWill 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.

CommandDescriptionDistribution/NotesRisks/Dangers
dmesgPrint kernel ring buffer messages (boot and hardware events)AllMay expose sensitive hardware info
journalctlQuery and view logs from systemd’s journalsystemd-basedLarge logs can be overwhelming
straceTrace system calls and signalsAllMay slow down traced processes
strace <command>Trace a command’s system callsAll
lsofList open files (useful for debugging)AllMay require root for full info
lsof <file>Show processes using a specific fileAll
vmstatReport virtual memory statisticsAll
iostatReport CPU and I/O statisticsMay require install
mpstatReport CPU usage statisticsMay require install
pidstatReport statistics by processMay require install
freeDisplay memory usageAll
uptimeHow long the system has been runningAll
watchExecute a program periodically and show outputAll
lshwList hardware configurationMay require install
htopAdvanced interactive process viewerMay require install
netstatNetwork statistics (deprecated, use ss)All
ssShow 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.

CommandDescriptionDistribution/NotesRisks/Dangers
ifconfigConfigure network interfaces (deprecated, use ip instead)May require install; replaced by ipMay not be available on newer systems
ipShow/manipulate routing, devices, and tunnelsAll
ip addrShow IP addressesAll
ip linkShow or manipulate network interfacesAll
ip routeShow or manipulate routing tablesAll
ssDisplay socket statistics (network diagnostics)All
nmapNetwork exploration and security auditing toolMay require installUse responsibly; can trigger network security alerts
telnetUser interface to the TELNET protocolMay require install; insecure, rarely usedUnencrypted; avoid for sensitive data
nc (netcat)Network utility for reading and writing from connectionsMay require installCan be used maliciously if misconfigured
iptablesIPv4 packet filtering and NATAllMisconfiguration can block network access
firewalldFirewall management frontendFedora, CentOS
ufwUncomplicated firewall (iptables frontend)Ubuntu, Debian
ufw enableEnable the firewallUbuntu, DebianMay block existing connections if not configured
ufw allow <port>Allow traffic on a specific portUbuntu, Debian
tcpdumpPacket analyzer for network diagnosticsMay require installCaptures sensitive data if not filtered
curlTransfer data from or to a server (HTTP, FTP, etc.)All
wgetDownload files from the webAll
scpSecure copy over SSHAllRequires SSH access; use strong authentication
rsyncRemote file and directory synchronizationAllIncorrect options may overwrite/delete files
sshSecure shell for remote loginAllWeak 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.

CommandDescriptionDistribution/NotesRisks/Dangers
grepSearch for patterns within filesAll
grep 'pattern' file.txtSearch for a pattern in a fileAll
grep -r 'pattern' /dir/Recursively search for a pattern in a directoryAllCan be slow on large directories
sedStream editor for filtering and transforming textAllIncorrect patterns can corrupt data
sed 's/old/new/g' file.txtReplace ‘old’ with ‘new’ globally in a fileAll
awkPattern scanning and processing languageAll
awk '{print $1}' file.txtPrint the first column of each line in a fileAll
cutRemove sections from each line of filesAll
cut -d':' -f1 /etc/passwdPrint the first field of each line, using ‘:’ as delimiterAll
sortSort lines of text filesAll
uniqReport or omit repeated lines in a fileAllRequires sorted input for best results
sort file.txt | uniqSort and remove duplicate linesAll
teeRead from standard input and write to standard output and filesAll
echo "text" | tee file.txtWrite to file and show output on screenAllOverwrites file unless used with -a (append)
trTranslate or delete charactersAll
echo "hello" | tr 'a-z' 'A-Z'Convert lowercase to uppercaseAll
pasteMerge lines of filesAll
paste file1.txt file2.txtCombine lines of two files side by sideAll
wcCount words, lines, characters, and bytesAll
wc -l file.txtCount lines in a fileAll
wc -w file.txtCount words in a fileAll

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.

CommandDescriptionDistribution/NotesRisks/Dangers
shutdownShut down or reboot the system safelyAllActive users may lose unsaved work
shutdown -h nowImmediately shut down the systemAllAll users will be logged out
shutdown -r nowImmediately reboot the systemAllAll users will be logged out
shutdown -h +10Shut down after 10 minutesAllWarn users in advance
rebootReboot the systemAllEquivalent to shutdown -r now
haltHalt the system immediatelyAllMay not power off on all hardware
poweroffPower off the systemAllEquivalent to shutdown -h now
init 0Shutdown (old-style SysVinit)SysVinitUse with caution; not for systemd
init 6Reboot (old-style SysVinit)SysVinitUse 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.

CommandDescriptionDistribution/NotesRisks/Dangers
mountMount a file system to a directoryAllIncorrect use can make the system or data inaccessible
mount /dev/sda1 /mntMount partition /dev/sda1 to /mntAllDirectory must exist and not be in use
umountUnmount a file systemAllUnmounting in-use filesystems can cause data loss
umount /mntUnmount the file system mounted at /mntAllEnsure no files are open from the mount point
fstabFile system table configuration file (/etc/fstab)AllIncorrect entries can prevent system boot
blkidDisplay block device attributes (UUID, type, etc.)All
fsckCheck and repair a file systemAllNever run on a mounted or in-use file system
fsck /dev/sda1Check and repair file system on /dev/sda1AllUnmount 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.

CommandDescriptionDistribution/NotesRisks/Dangers
chmodChange file or directory permissionsAllIncorrect permissions can expose or block access to files
chmod 755 file.txtSet read, write, execute for owner; read, execute for group and othersAllMay make files executable unintentionally
chownChange file owner and groupAllWrong owner/group can restrict access or cause issues
chown user:group file.txtChange owner and group of a fileAll
chgrpChange group ownership of a fileAll
chgrp group file.txtChange the group of a fileAll
umaskSet default permissions for new filesAllImproper settings may create insecure files
umask 022Set default permissions for new files to 755All
setfaclSet Access Control Lists (ACL) for files/directoriesMay require installComplex ACLs can cause confusion or unintended access
getfaclGet Access Control Lists (ACL) for files/directoriesMay 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.

CommandDescriptionDistribution/NotesRisks/Dangers
dockerDocker command-line interface for managing containersMay require installRequires root or docker group membership
docker run <image>Run a container from an imageAllContainer may expose ports or consume resources
docker psList running containersAll
docker ps -aList all containers (including stopped)All
docker build -t <image_name> .Build a Docker image from a DockerfileAllDockerfile errors can cause build failures
docker exec -it <container_id> bashOpen an interactive shell in a running containerAll
docker stop <container_id>Stop a running containerAllUnsaved data in container may be lost
docker rm <container_id>Remove a containerAllData in container will be lost if not persisted
docker logs <container_id>View logs of a containerAll
docker imagesList available Docker imagesAll
docker rmi <image_name>Remove a Docker imageAllImages in use by containers cannot be removed
docker network lsList Docker networksAll
docker-compose upStart up a multi-container Docker applicationMay require installMisconfigured files can cause failures
docker-compose downStop and remove containers created by docker-composeMay require installRemoves all containers, networks, and volumes defined in the compose file
docker-compose logsView logs from containers managed by docker-composeMay require install
kubectlKubernetes command-line tool for managing clustersMay require installRequires access to a running Kubernetes cluster
kubectl get podsList pods in the current namespaceAll
kubectl get nodesList nodes in the clusterAll
kubectl get servicesList services in the clusterAll
kubectl apply -f <file>.yamlApply configuration from a YAML fileAllIncorrect YAML can cause deployment errors
kubectl exec -it <pod_name> -- bashOpen a shell in a running podAll
kubectl logs <pod_name>View logs of a podAll
kubectl describe pod <pod_name>Get detailed information about a podAll
kubectl scale deployment <deployment_name> --replicas=<number>Scale a deployment to the desired number of replicasAll
kubectl rollout restart deployment <deployment_name>Restart a deploymentAll
kubectl port-forward pod/<pod_name> <local_port>:<remote_port>Forward a port from a pod to localhostAll
helmKubernetes package manager for deploying applicationsMay require install
helm install <release_name> <chart_name>Install a Helm chartAllIncorrect chart or values can cause deployment errors
helm upgrade <release_name> <chart_name>Upgrade a Helm releaseAll
helm listList all Helm releasesAll
helm delete <release_name>Delete a Helm releaseAllRemoves all resources managed by the release
helm search <chart_name>Search for a Helm chartAll

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.

CommandDescriptionDistribution/NotesRisks/Dangers
ansibleAutomation tool for configuration management and orchestrationMay require installRequires SSH access to managed nodes
ansible all -m pingPing all hosts defined in the inventoryAllInventory must be correct
ansible-playbook playbook.ymlRun an Ansible playbookAllPlaybook errors can cause misconfiguration
ansible -m command -a 'command' <host>Run a single command on a target hostAll
ansible-playbook --check playbook.ymlDry-run a playbook to see what would changeAllNo changes will be made
ansible-playbook --limit <host> playbook.ymlRun a playbook on a specific host or groupAll
ansible-playbook --extra-vars "key=value"Pass extra variables to a playbookAll
terraformInfrastructure as code tool for provisioning and managing cloud resourcesMay require installMisconfiguration can affect cloud resources
terraform initInitialize a working directory for Terraform configurationAll
terraform planShow an execution plan (preview of changes)All
terraform applyApply the changes described in a Terraform configurationAllApplies changes to real infrastructure
terraform destroyDestroy infrastructure created by TerraformAllIrreversible, removes resources
terraform validateValidate the configuration filesAll
terraform showShow the current state of the infrastructureAll
puppetConfiguration management tool (agent/master or standalone)May require installRequires manifests and correct configuration
puppet apply <manifest.pp>Apply a Puppet manifest locallyAllMisconfiguration can affect system state
puppet agent --testTest the Puppet agent (run a one-off configuration)All
puppet resourceShow 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.

CommandDescriptionDistribution/NotesRisks/Dangers
jenkinsContinuous integration tool (typically runs as a Java application)May require installShould be secured with authentication
java -jar jenkins.warStart Jenkins from a WAR fileAll (Java required)Default port 8080 may conflict with other services
gitlab-runner registerRegister a new runner with GitLab for CI/CD pipelinesMay require installRunner must be secured and properly configured
gitlab-runner runStart the GitLab Runner to process jobsMay require install
.gitlab-ci.ymlConfiguration file for GitLab CI/CD pipelines (in your repository)GitLabSyntax errors will break pipelines
.github/workflows/Directory for GitHub Actions workflow YAML filesGitHubIncorrect configuration can prevent workflow execution
actions/checkout@v2GitHub Action for checking out repository codeGitHub Actions
actions/setup-node@v2GitHub Action for setting up Node.js in a workflowGitHub Actions
docker/setup-buildx-action@v1GitHub 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.

CommandDescriptionDistribution/NotesRisks/Dangers
AWS CLI (Amazon Web Services)
awsAWS command-line interface for managing AWS servicesMay require installCredentials must be secured
aws configureConfigure AWS CLI with credentialsAllCredentials stored in plain text by default
aws s3 cp file.txt s3://bucket-name/Copy a file to an S3 bucketAllOverwrites if file exists
aws s3 sync . s3://bucket-name/Synchronize a local directory to an S3 bucketAll
aws ec2 describe-instancesList EC2 instancesAllRequires correct permissions
aws ec2 start-instances --instance-ids <id>Start an EC2 instanceAllMay incur costs
aws ec2 stop-instances --instance-ids <id>Stop an EC2 instanceAllMay cause downtime
Azure CLI (Microsoft Azure)
azAzure command-line interfaceMay require installCredentials must be secured
az loginLog in to your Azure accountAll
az vm listList all virtual machinesAll
az vm start --name <vm_name> --resource-group <group>Start an Azure VMAllMay incur costs
az storage blob upload --account-name <account> --container-name <container> --file file.txt --name file.txtUpload a file to Azure Blob StorageAll
az group create --name <group> --location <location>Create a new resource groupAll
Google Cloud SDK (gcloud)
gcloudGoogle Cloud command-line toolMay require installCredentials must be secured
gcloud auth loginAuthenticate to Google CloudAll
gcloud compute instances listList compute instancesAll
gcloud compute instances stop <instance_name>Stop a Google Cloud VM instanceAllMay cause downtime
gcloud app browseOpen the current App Engine application in a browserAll

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.

CommandDescriptionDistribution/NotesRisks/Dangers
Prometheus
prometheusStart Prometheus monitoring serverMay require installShould be secured before exposing to networks
prometheus --config.file=<config_file>Start Prometheus with a specific configuration fileAllMisconfiguration may cause data loss or failed monitoring
Grafana
grafana-cliManage Grafana plugins from the command lineMay require install
grafana-cli plugins install <plugin-name>Install a plugin in GrafanaAllPlugin compatibility should be checked
ELK Stack (Elasticsearch, Logstash, Kibana)
elasticsearchStart Elasticsearch search and analytics engineMay require installShould be secured before exposing to networks
curl -XGET 'localhost:9200/_cluster/health?pretty'Get Elasticsearch cluster health statusAllRequires running Elasticsearch
logstashRun Logstash for collecting, parsing, and transforming logsMay require installMisconfiguration can cause data loss
logstash -f <config_file>Run Logstash with a specific configuration fileAll
kibanaStart Kibana web interface for visualizing Elasticsearch dataMay require installShould be secured before exposing to networks
Access Kibana via http://localhost:5601Open Kibana dashboard in your browserAll

25. References & Further Reading


Read also:

author avatar
Gary Owl