Skip to main content

 🚀 𝗧𝗼𝗽 𝗟𝗶𝗻𝘂𝘅 𝗰𝗼𝗺𝗺𝗮𝗻𝗱𝘀 𝘂𝘀𝗲𝗳𝘂𝗹 𝗶𝗻 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗳𝗼𝗿 𝗗𝗲𝘃𝗼𝗽𝘀 𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿🚀


Linux is the backbone of cloud computing, DevOps, and system administration. Mastering these essential Linux commands can help you troubleshoot, automate, and optimize infrastructure efficiently.


🔹 Basic File & Directory Commands


1️⃣ ls – List files & directories 

2️⃣ cd – Change directory

3️⃣ pwd – Show current directory

4️⃣ mkdir – Create a directory

5️⃣ rm -rf – Remove files & directories


🔹 File Management


6️⃣ touch – Create an empty file

7️⃣ cp – Copy files & directories

8️⃣ mv – Move or rename files

9️⃣ cat – View file contents

🔟 less – Paginated file viewing


🔹 Permissions & Ownership


1️⃣1️⃣ chmod – Change file permissions

1️⃣2️⃣ chown – Change file owner

1️⃣3️⃣ umask – Set default permissions


🔹 Process Management


1️⃣4️⃣ ps – View running processes

1️⃣5️⃣ top – Monitor system performance

1️⃣6️⃣ kill – Terminate processes

1️⃣7️⃣ pkill – Kill processes by name

1️⃣8️⃣ nice / renice – Adjust process priority


🔹 Networking Commands


1️⃣9️⃣ ping – Check network connectivity

2️⃣0️⃣ netstat -tulnp – View open ports

2️⃣1️⃣ ip a – Check IP address

2️⃣2️⃣ nslookup – Query DNS records


🔹 Disk & Storage Management


2️⃣3️⃣ df -h – Check disk space

2️⃣4️⃣ du -sh folder/ – Check directory size

2️⃣5️⃣ mount – Mount filesystems


🔹 User Management


2️⃣6️⃣ whoami – Show current user

2️⃣7️⃣ id – Display user ID & group ID

2️⃣8️⃣ who – List logged-in users

2️⃣9️⃣ passwd – Change password

3️⃣0️⃣ su – Switch user


🔹 Logs & Monitoring


3️⃣1️⃣ uptime – Show system uptime

3️⃣2️⃣ dmesg – View system logs

3️⃣3️⃣ journalctl – Check systemd logs

3️⃣4️⃣ tail -f /var/log/syslog – Monitor logs live


🔹 Package Management


3️⃣5️⃣ apt / yum / dnf – Install packages

3️⃣6️⃣ rpm -q – Query installed RPM packages

3️⃣7️⃣ dpkg -l – List installed Debian packages


🔹 Advanced Commands


3️⃣8️⃣ crontab -e – Schedule tasks

3️⃣9️⃣ systemctl – Manage services

4️⃣0️⃣ tar -cvf backup.tar /dir – Create an archive

4️⃣1️⃣ grep – Search for patterns

4️⃣2️⃣ find – Locate files


🔹 Special Commands for DevOps


4️⃣3️⃣ docker ps – List running containers

4️⃣4️⃣ kubectl get pods – View Kubernetes pods

4️⃣5️⃣ ansible-playbook – Run Ansible automation scripts


🔹 Miscellaneous Commands


4️⃣6️⃣ alias – Create command shortcuts

4️⃣7️⃣ history – View command history

4️⃣8️⃣ env – Show environment variables

4️⃣9️⃣ echo $PATH – Display system path

5️⃣0️⃣ exit – Log out of a session


Basic LINUX Commands 

📂 File Management & Navigation

🔹 ls – List files and directories
🔹 ls -l – List with detailed info
🔹 ls -la – Include hidden files
🔹 cd dir – Change to directory
🔹 cd .. – Move to the parent directory
🔹 cd /dir – Change to an absolute path
🔹 cd – Go to home directory
🔹 pwd – Print current directory
🔹 mkdir dir – Create a directory
🔹 rm file – Delete a file
🔹 rm -f file – Force delete file
🔹 rm -r dir – Delete a directory
🔹 rm -rf dir – Force remove directory
🔹 cp file1 file2 – Copy file
🔹 mv file1 file2 – Rename file
🔹 mv file dir/ – Move file to directory
🔹 touch file – Create/update file
🔹 cat file – View file contents
🔹 tail -f file – View file as it updates


---

🌐 Networking

🔹 ping host – Check connectivity
🔹 whois domain – Get domain info
🔹 dig domain – Get DNS records
🔹 wget file – Download file
🔹 wget -c file – Resume download
🔹 curl URL – Fetch webpage content
🔹 ssh user@host – Remote login


---

⚙ System Info

🔹 date – Show date/time
🔹 uptime – System uptime
🔹 whoami – Show current user
🔹 w – Who is online
🔹 cat /proc/cpuinfo – CPU details
🔹 cat /proc/meminfo – Memory info
🔹 free – Check RAM usage
🔹 du -sh – Show directory size
🔹 df -h – Disk space usage
🔹 uname -a – Kernel info


---

📦 Compression

🔹 tar -cf file.tar files/ – Create archive
🔹 tar -xf file.tar – Extract archive
🔹 tar -tf file.tar – List archive contents


---

🔐 Permissions

🔹 chmod 777 file – Full access for all
🔹 chmod 755 file – rwx for owner, rx for others


---

🛠 Process Management

🔹 ps – View running processes
🔹 ps aux – Detailed process list
🔹 kill PID – Kill a process
🔹 killall process – Kill all instances
🔹 grep "pattern" file – Search for text
🔹 locate file – Find a file
🔹 whereis app – Locate application
🔹 man command – Get command manual

*****Essential Linux Commands for DevOps*****

System Analysis:
• htop - Interactive process viewer with CPU, memory, and load metrics
• netstat -tulpn - Display active network connections and listening ports
• ps aux | grep - Filter and find specific running processes
• lsof - List open files and processes using them
• dmesg - Display kernel-related messages and system logs

File Management:
• find . -name - Search files recursively by name or pattern
• rsync - Efficient file transfer and synchronization tool
• tar -xvf - Extract compressed archives
• grep -r - Search text patterns recursively in files
• sed -i - Stream editor for inline text modifications

Container & Orchestration:
• docker stats - Real-time container resource usage
• docker logs -f - Stream container logs live
• kubectl get pods - List Kubernetes pod status
• crictl pods - Low-level container runtime inspection

Monitoring & Logs:
• tail -f - Follow file updates in real-time
• watch - Execute commands periodically
• vmstat - Report virtual memory statistics
• journalctl - Query systemd journal logs

Network Tools:
• curl -v - HTTP request debugging with headers
• dig - DNS lookup utility
• ss - Socket statistics
• nc - Network testing and data transfer

Performance:
• strace - Trace system calls and signals
• tcpdump - Capture and analyze network traffic
• perf - Performance analysis tools
• sar - Collect and report system activity

System Control:
• systemctl - Control systemd services and units
• chmod/chown - Manage file permissions and ownership
• du -sh - Summarize directory sizes
• screen/tmux - Terminal session management

Comments

Popular posts from this blog

Top 10 high-level EC2 scenario-based questions to challenge your AWS & DevOps skills

 Here are 10 high-level EC2 scenario-based questions to challenge your AWS & DevOps skills 1. Your EC2 instance is running but you can’t connect via SSH. What troubleshooting steps will you take?  Check Security Group inbound rules (port 22 open to your IP).  Verify Network ACLs (NACLs not blocking inbound/outbound).  Confirm instance’s Public IP / Elastic IP.  Validate Key Pair and correct permissions on .pem.  Ensure SSM Agent is installed (Session Manager can help).  Check system logs on the console for OS-level issues. 2. You terminated an EC2 instance by mistake. How can you prevent this in the future? Enable Termination Protection in EC2 settings. Use IAM permissions to restrict TerminateInstances. Tag critical instances and set resource policies. 3. Your EC2 instance needs to access an S3 bucket securely. What’s the best way to configure this? Best practice: Attach an IAM Role with least privilege policy to the EC2 instance. Avoid hardcoding...

GitOps-Driven Management of VKS Clusters: Enabling GitOps on VCF 9.0 (Part 03)

  GitOps-Driven Management of VKS Clusters: Enabling GitOps on VCF 9.0 (Part 03) In the Part-02 blog, we walked through the process of deploying an Argo CD instance within a vSphere Namespace on  VMware Cloud Foundation (VCF) 9.0 , enabling a GitOps-based approach to manage Kubernetes workloads in a vSphere environment. With Argo CD successfully installed, we now have a powerful toolset to drive declarative infrastructure and application delivery. In this blog post, we’ll take the next step by demonstrating how to  provision and manage VKS clusters  directly through the Argo CD  UI and CLI . This allows us to fully operationalise GitOps within the private cloud, delivering consistency, scalability, and automation across the Kubernetes lifecycle. Importance of Managing the Kubernetes Cluster with a Gitops Approach Adopting a GitOps-based approach for managing Kubernetes clusters enables declarative, version-controlled, and automated operations by leveraging Git a...
 https://knowledge.broadcom.com/external/article?articleNumber=389217 VMware Aria Suite Backup and Restore Documentation Issue/Introduction This article host backup and restore documentation for VMware Aria Suite 2019 product lines. Environment VMware Aria Suite 8.x VMware Aria Automation 8.x VMware Aria Automation Orchestrator 8.x Cause Technical documentation has been migrated from docs dot vmware dot com to  https://techdocs.broadcom.com . During this migration, some content considered End of Life (EOL) or End of General Support (EOGS) was not targeted for migration. Resolution PDF files are provided in this article while these documents are restored to https://techdocs.broadcom.com. Attachments Backup & Restore with EMC Avamar for VMware Aria Suite.pdf get_app Backup & Restore with Netbackup for VMware Aria Suite.pdf get_app VMware Aria Suite Backup and Restore by Using vSphere Data Protection.pdf get_app