Basic Linux Manual

Listen to this Post

2025-02-11

Linux is an open-source operating system widely used in servers, development, and cybersecurity. This basic manual covers essential commands for beginners looking to familiarize themselves with the Linux terminal.

Basic Linux Commands

1. Directory Navigation:

  • pwd: Displays the current directory.
  • ls: Lists files and directories in the current location.
  • cd [directory]: Changes to the specified directory.

2. File Management:

  • touch [filename]: Creates an empty file.
  • cp [source] [destination]: Copies files or directories.
  • mv [source] [destination]: Moves or renames files or directories.
  • rm [file]: Deletes a file.

3. Permissions and Ownership:

  • chmod [permissions] [file]: Changes file permissions.
  • chown [user]:[group] [file]: Changes the owner and group of a file.

4. Process Management:

  • ps: Displays currently running processes.
  • top: Shows real-time system processes and resource usage.
  • kill [PID]: Terminates a process by its Process ID.

5. Networking:

– `ifconfig` or ip addr: Displays network interface information.
ping [host]: Tests connectivity to a host.
netstat: Shows network connections and statistics.

6. Package Management:

  • sudo apt update: Updates the package list (Debian/Ubuntu).
  • sudo apt install [package]: Installs a package.
  • sudo yum install [package]: Installs a package (CentOS/RHEL).

7. Text Processing:

  • cat [file]: Displays the contents of a file.
  • grep [pattern] [file]: Searches for a pattern in a file.
  • sed 's/old/new/' [file]: Replaces text in a file.

8. System Information:

  • uname -a: Displays system information.
  • df -h: Shows disk usage in a human-readable format.
  • free -h: Displays memory usage.

What Undercode Says

Linux is a powerful and versatile operating system that forms the backbone of many IT infrastructures. Mastering basic Linux commands is essential for system administrators, developers, and cybersecurity professionals. Here are some additional commands and tips to enhance your Linux skills:

  • File Compression: Use `tar -czvf archive.tar.gz [directory]` to create a compressed archive.
  • SSH Access: Use `ssh user@host` to securely connect to a remote server.
  • File Transfer: Use `scp [file] user@host:/path` to securely copy files between systems.
  • Logs Inspection: Use `tail -f /var/log/syslog` to monitor system logs in real-time.
  • Environment Variables: Use `export VAR=value` to set environment variables temporarily.
  • Scheduling Tasks: Use `crontab -e` to schedule recurring tasks.
  • Firewall Management: Use `ufw allow [port]` to open a port in the firewall (Ubuntu).
  • Disk Partitioning: Use `fdisk -l` to list disk partitions.
  • User Management: Use `adduser [username]` to create a new user.
  • Service Management: Use `systemctl start [service]` to start a service.

For further reading, check out these resources:

Linux is not just an operating system; it’s a skill that opens doors to endless possibilities in IT and cybersecurity. Keep practicing, and soon you’ll be navigating the terminal like a pro.

References:

Hackers Feeds, Undercode AIFeatured Image