"Maximizing DevOps Efficiency with Linux"

"Maximizing DevOps Efficiency with Linux"

Linux Cheat Sheet:

Linux is an open-source UNIX-like operating system (OS). An operating system is a software that directly manages a system’s hardware and resources, like CPU, memory, and storage.OS acts as a GUI through which user can communicate with the computer. The OS sits between applications and hardware and makes the connections between all of your software and the physical resources that do the work.


1.File and Directory Operation Commands

  • ls : List Files and directories
  • ls-l : Long format Listing with detailed information
  • ls -a : shows all files and directories includes hidden
  • ls -lh :Displays file sizes in Human readable format
  • cd : Change directory to specified path
  • pwd : Displays the present working Directory
  • mkdir : create new directory (folder)
  • rmdir dir_1:Deletes the directory with name "dir_1"
  • touch A : Create an empty file with name "A"
  • rm : Removes files and directories
  • rm file1 : Delete a file with name File1
  • rm -r dir_1: deletes the directory “dir_1” and its contents
  • rm -f file1:forcefully deletes the file “file1” without confirmation.
  • cp A B :copies data form source file "A" to destination file "B"
  • mv A dir_1 : Moves file A to dir_1
  • cat A :displays the contents in file A
  • head A : displays the first ten lines in File A
  • tail A : displays the last ten lines in File A

2. File Permissions

  • chmod : Used to change file Permissions u - user /owner g - group o - other
  • chmod u+rwx : grants read write and execute permissions to the user

3.Process Management Commands :

  • ps :display Running Processes
  • ps -aux : Show all processes
  • kill : terminate a process
  • grep :used to search for specific patterns or regular expressions in text files or streams and display matching lines.
  • grep -i "hello" file.txt: we are extracting our desired output(hello) from filename (file.txt)-i: Ignore case distinctions while searching.-v: Invert the match, displaying non-matching lines.-r or -R: Recursively search directories for matching patterns.-l: Print only the names of files containing matches.-n: Display line numbers alongside matching lines.-w: Match whole words only, rather than partial matches.-c: Count the number of matching lines instead of displaying them.-e: Specify multiple patterns to search for.-A: Display lines after the matching line.-B: Display lines before the matching line.-C: Display lines both before and after the matching line.

4.System Information Commands :

  • uname : Print system information.
  • uname -a :  displays all system information.
  • whoami : Display current username.
  • df : Show disk space usage.
  • df -h :  displays disk space usage in a human-readable format.
  • free : Display memory usage information.
  • free -h  displays memory usage in a human-readable format.
  • uptime : Show system uptime.

5.Networking Commands :




Koenraad Block

Founder @ Bridge2IT +32 471 26 11 22 | Business Analyst @ Carrefour Finance

1y

DevOps - where collaboration fuels success. Inspiring! 💼👥

Like
Reply

To view or add a comment, sign in

More articles by VINAI KOLLURI

  • Snyk

    🚨 Snyk: Proactive Vulnerability Detection for Secure Code, Containers, and Dependencies 🚨 In today's fast-paced…

  • Linux

    Here are some essential Linux commands for a DevOps engineer : 1. ls: Lists files and directories in the current…

  • Essential Terms & Services Every DevOps / DevSecOps Engineer Should Know

    In the rapidly evolving field of DevOps, staying updated with the latest tools and concepts is crucial. Below is a…

Insights from the community

Others also viewed

Explore topics