Basic Linux Commands used in DevOps
#Linux #OpenSource #LinuxAdmin #SysAdmin #LinuxKernel #LinuxCommands #LinuxCommunity #LinuxNetworking #LinuxSecurity #Unix #BashScripting#ShellScript

Basic Linux Commands used in DevOps

File and Directory Management

  • ls: List directory contents.
  • cd [directory]: Change the current directory.
  • pwd: Print the current working directory.
  • mkdir [directory]: Create a new directory.
  • rm [file]: Remove a file.
  • rm -r [directory]: Remove a directory and its contents recursively.
  • cp [source] [destination]: Copy files or directories.
  • mv [source] [destination]: Move or rename files or directories.

File Viewing and Editing

  • cat [file]: Display file contents.
  • more [file]: View file contents one screen at a time.
  • less [file]: Similar to more, but allows backward movement in the file.
  • nano [file]: Edit a file using the Nano text editor.
  • vi [file]: Edit a file using the Vi text editor.

Permissions

  • chmod [permissions] [file]: Change the file's permissions.
  • chown [user]:[group] [file]: Change file owner and group.

Networking

  • ifconfig: Display or configure network interfaces.
  • ping [host]: Check connectivity to a host.
  • netstat: Display network connections, routing tables, etc.
  • curl [url]: Transfer data from or to a server.
  • wget [url]: Download files from the web.
  • ssh [user]@[host]: Connect to a remote host via SSH.
  • scp [file] [user]@[host]:[path]: Securely copy files between hosts.

Process Management

  • ps: Display information about running processes.
  • top: Display real-time system resource usage.
  • kill [PID]: Terminate a process by its Process ID.

Package Management (Debian/Ubuntu)

  • apt update: Update the list of available packages.
  • apt upgrade: Upgrade installed packages to the latest version.
  • apt install [package]: Install a package.
  • apt remove [package]: Remove a package.

Disk Usage

  • df: Report file system disk space usage.
  • du: Estimate file space usage.

System Information

  • uname -a: Display all system information.
  • hostname: Show or set the system’s host name.
  • uptime: Display how long the system has been running.
  • free -h: Display available memory and swap usage.

File Search

  • find [directory] -name [file]: Search for files in a directory hierarchy.
  • grep [pattern] [file]: Search for a pattern in files.

Archiving and Compression

  • tar -czvf [archive.tar.gz] [directory]: Create a compressed archive.
  • tar -xzvf [archive.tar.gz]: Extract a compressed archive.

User and Group Management

  • useradd [username]: Add a new user.
  • usermod -aG [group] [username]: Add a user to a group.
  • passwd [username]: Change a user's password.

Scheduling and Automation

  • crontab -e: Edit cron jobs for scheduling tasks.
  • systemctl: Control systemd services.

Logs and Monitoring

  • tail -f [file]: Continuously monitor file changes.
  • dmesg: Display system boot and diagnostic messages.
  • journalctl: Query and display messages from the system journal.


To view or add a comment, sign in

More articles by Prince K. Ranjan

  • Networking Concept For Devops

    Networking fundamentals are essential for understanding how data is transferred and communicated between devices. Here…

Others also viewed

Explore content categories