Just wait 3 second

0 %
Md Golam Abir
Web Designer
Wordpress Expert
  • Residence:
    Bangladesh
  • City:
    Dhaka
  • Age:
    25
Bangla
English
Hindi
html
CSS
WordPress
  • Elementor, Elementor pro.
  • Cpanel, Whm, CyberPanel
  • Linux Server Management

Linux Commands You Should Know

February 18, 2025

Introduction

Linux is a powerful operating system used by developers, system administrators, and tech enthusiasts worldwide. Mastering essential Linux commands can greatly improve efficiency in managing files, directories, processes, and network settings. This article explores 60 crucial Linux commands that every user should know.

1. Accessing Remote Systems with SSH

  • ssh user@server: Securely connect to a remote Linux machine.
  • Useful for system administrators managing servers remotely.

2. File and Directory Management

  • ls: Lists files in a directory. Use ls -l for detailed output.
  • pwd: Prints the current directory path.
  • cd directory_name: Changes the current directory.
  • mkdir folder_name: Creates a new directory.
  • rm file_name: Deletes a file, and rm -r folder_name removes directories recursively.
  • cp file1 file2: Copies a file.
  • mv file1 new_location/: Moves or renames a file.

3. Working with Files

  • touch file_name: Creates an empty file.
  • nano file_name: Opens the file in the Nano text editor.
  • vim file_name: Opens the file in the Vim editor.
  • cat file_name: Displays file content.
  • less file_name: Allows scrolling through a file.
  • head file_name: Shows the first 10 lines.
  • tail file_name: Shows the last 10 lines.

4. User and Permission Management

  • whoami: Displays the current user.
  • su user_name: Switches to another user.
  • passwd: Changes the current user’s password.
  • chmod +x file_name: Grants executable permission to a file.
  • chown user:group file_name: Changes file ownership.

5. Process and Resource Management

  • ps aux: Lists all running processes.
  • top: Displays real-time process monitoring.
  • htop: An improved version of top.
  • kill PID: Terminates a process.
  • pkill process_name: Kills a process by name.

6. Networking Commands

  • ping google.com: Tests network connectivity.
  • traceroute google.com: Displays the route packets take to reach a host.
  • ifconfig: Shows network interfaces (deprecated in some systems).
  • ip a: Displays IP addresses and interfaces.
  • netstat -tulnp: Lists open ports and network connections.
  • ufw enable: Enables the firewall.
  • ufw allow 80: Allows HTTP traffic through the firewall.

7. File Searching and Text Processing

  • find / -name file_name: Searches for a file in the entire system.
  • grep 'text' file_name: Searches for specific text in a file.
  • sort file_name: Sorts lines in a file alphabetically.
  • diff file1 file2: Compares two files line by line.
  • wc -l file_name: Counts the number of lines in a file.

8. Package Management

  • apt update: Updates package repositories (Debian-based systems).
  • apt install package_name: Installs a package.
  • yum install package_name: Installs packages on Red Hat-based systems.

9. System Information and Monitoring

  • uname -a: Displays system information.
  • df -h: Shows disk space usage.
  • free -h: Displays memory usage.
  • history: Shows previously executed commands.

10. System Control and Shutdown

  • reboot: Restarts the system.
  • shutdown -h now: Shuts down the system immediately.
  • shutdown -r now: Restarts the system immediately.

Conclusion

Understanding these essential Linux commands can significantly enhance your efficiency in navigating and managing a Linux environment. Whether you’re a beginner or an experienced user, mastering these commands will help you perform tasks more effectively and securely.

Posted in Linux ServerTags: