This guide covers SSH commands PuTTY with practical steps you can copy into a real project.

SSH commands PuTTY

Hey Namaste,

In this article, we will learn some SSH commands for server operations such as zip, unzip, delete, and moving a file from one server to another.

SSH is one of the fastest ways to do server-side operations. Let’s start.

SSH in simple language

SSH stands for “Secure Shell” or “Secure Socket Shell.” It is a method of securely communicating with another computer. The “secure” part of the name means that all data sent via an SSH connection is encrypted. This means if a third party tries to intercept the information being transferred, it would appear scrambled and unreadable. The “shell” part of the name means SSH is based on a Unix shell, which is a program that interprets commands entered by a user.

Source: www.techterms.com

 

Install PuTTY

PuTTY is a free and open-source terminal emulator, serial console and network file transfer application.
Using PuTTY we can run SSH operations on a remote server.

Download from: www.putty.org

SSH Commands

1. ZIP(Compress) Operations
1.1 Compress(zip) all files in the current directory
e.g zip filename.zip *

Note: In this example, subfolders and files are not included. You can use a file name without an extension.

1.2 Compress (zip) an entire directory including all sub-directories
e.g zip -r filename *

2. UNZIP Operations
Unzip specific file
e.g unzip filename.zip

3. Delete folder or file
e.g rm -rf folder-name/

4. Move files from one server to another
For this we will use the SCP command. You need both servers’ IP addresses, usernames, passwords, and the path to the file or folder.

Move a file from the old server (A) to a new server (B) while logged into A.

e.g scp path/to/file UsernameofB@IPofB:path/to/destination

Note:
public_html/filename.zip = Server A
yuvrajkhavad@192.111.1.1:public_html/newdata = Server B

Contributing
Pull requests are welcome. Please add your SSH command and submit a pull request here.
Please make sure to update tests as appropriate.

If you have other commands in mind, mention them in the comments and I will add them to the post.

Note: This post was originally published on my previous agency blog.

 

Related reading

Questions? Use the contact page.

Reference: PuTTY.