Some useful commands for a Linux Administration | DevOps tutorials

Some useful commands for a Linux Administration | DevOps tutorials

List of common Linux commands for system administration tasks.

·

2 min read

Table of contents

No heading

No headings in the article.

However, keep in mind that the exact commands you need will depend on your specific requirements and the Linux distribution you are using. Here are some commonly used commands:

  1. Managing users and groups:
  • adduser: adds a new user to the system

  • usermod: modifies user properties such as password, home directory, and group membership

  • deluser: deletes a user account from the system

  • groupadd: adds a new group to the system

  • groupmod: modifies group properties such as group name or group ID

  • delgroup: deletes a group from the system

  1. Managing file system:
  • ls: lists the contents of a directory

  • cd: changes the current working directory

  • pwd: prints the current working directory

  • mkdir: creates a new directory

  • rm: removes a file or directory

  • cp: copies files or directories

  • mv: moves files or directories

  • chown: changes ownership of a file or directory

  • chmod: changes file permissions

  • df: displays disk space usage

  • du: displays disk usage of a file or directory

  1. Managing network:
  • ping: tests network connectivity to a remote host

  • ifconfig: displays network interface information

  • ip: a more modern tool to configure and manage networking

  • netstat: displays network connections and statistics

  • traceroute: traces the network path to a remote host

  • nslookup: resolves domain names to IP addresses

  • systemctl: a tool to start, stop, enable and disable system services

  1. Managing system and hardware:
  • top: displays system resource usage (CPU, memory, etc.) in real-time

  • ps: lists active processes and their status

  • kill: terminates a running process

  • reboot: restarts the system

  • shutdown: shuts down the system

  • free: displays available memory

  • lspci: lists all PCI devices attached to the system

  • lsusb: lists all USB devices attached to the system

  • hwinfo: a tool to query detailed hardware information

Again*, this is just a small selection of commonly used Linux commands for system administration. You may need to use additional commands depending on your specific use case.*