X

Select Your Country

Turkey (Türkçe)Turkey (Türkçe) Worldwide (English)Worldwide (English)
X

Select Your Currency

Türk Lirası $ US Dollar

Linux SSH Terminal Commands and Explanations

What are Linux SSH Terminal Commands and Explanations?
HomepageKnowledge BaseLinuxLinux SSH Terminal Commands and Exp...
Linux SSH Terminal Commands and Explanations

 

1. Connection and Authentication

 

  • ssh user@server_ip → Connects to a remote server via SSH.

  • ssh -p 2222 user@server_ip → Connects via SSH on a custom port.

 

2. File and Directory Management

 

  • ls → Lists files and folders in the current directory.

  • ls -la → Lists files including hidden ones, with detailed info.

  • cd /path → Changes to the specified directory.

  • pwd → Prints the full path of the current directory.

  • mkdir folder → Creates a new folder.

  • rm file → Deletes a file.

  • rm -rf folder → Forcefully deletes a folder and its contents.

  • cp source target → Copies a file or folder.

  • mv source target → Moves or renames a file or folder.

 

3. Viewing and Editing Files

 

  • cat file.txt → Displays the contents of a file.

  • more file.txt → Views a file page by page.

  • less file.txt → Allows scrolling through file content.

  • nano file.txt → Opens file with a simple text editor.

  • vim file.txt → Opens file with an advanced text editor.

 

4. System Info and Monitoring

 

  • uname -a → Displays system information.

  • top → Shows real-time CPU and memory usage.

  • htop → Colorful and interactive system monitor (requires installation).

  • df -h → Shows disk usage in human-readable format.

  • du -sh /folder → Shows the size of a specified folder.

  • free -h → Displays RAM usage.

  • uptime → Shows how long the server has been running.

 

5. User and Permission Management

 

  • whoami → Shows the current user.

  • id → Displays user ID and group info.

  • sudo command → Runs a command with admin privileges.

  • adduser username → Adds a new user.

  • passwd username → Changes a user's password.

 

6. Network Commands

 

  • ip a → Lists IP addresses and network interfaces.

  • ping google.com → Tests internet connectivity.

  • curl URL → Fetches data from a URL.

  • wget URL → Downloads files from a URL.

  • netstat -tulnp → Lists open ports and associated services.

  • ss -tulnp → Modern tool to check active ports and services.

 

7. Package Management (Debian/Ubuntu)

 

  • apt update → Updates package lists.

  • apt upgrade → Upgrades all installed packages.

  • apt install package → Installs a package.

  • apt remove package → Removes a package.

 

8. Package Management (CentOS/RHEL/AlmaLinux)

 

  • yum update or dnf update → Updates system packages.

  • yum install package → Installs a package.

  • yum remove package → Removes a package.

 

9. Service Management

 

  • systemctl start service → Starts a service.

  • systemctl stop service → Stops a service.

  • systemctl restart service → Restarts a service.

  • systemctl status service → Shows the service status.

  • systemctl enable service → Enables the service to start at boot.

 

10. Other Common Commands

 

  • history → Lists previously used commands.

  • clear → Clears the terminal screen.

  • tar -czvf archive.tar.gz folder → Compresses a folder into an archive.

  • tar -xzvf archive.tar.gz → Extracts an archive.

  • chmod 755 file → Changes file permissions.

  • chown user:group file → Changes file ownership.

Can't find the information you're looking for?

You have examined the knowledge base in detail, but if you cannot find the information you need,

Create a Support Ticket
Did you find it useful?
(784 times viewed. / 3 people found helpful.)