PuTTY Software Commands: A Beginner’s Guide With Easy Examples
If you have ever opened PuTTY and stared at a blinking black screen, not sure what to type, you are not alone. Most people feel a little lost the first time. The good news is that once you learn a few simple commands, uncovering a time-saving software egg inside the terminal, PuTTY becomes one of the easiest tools you will ever use.
In this article, I will walk you through every important PuTTY command. This includes basic commands you type after you log in, the special command-line options for PuTTY itself, and the file transfer tools that come with it. I have used PuTTY for years to manage servers, fix websites, and move files around. So I know exactly which commands beginners need first, and which ones they can skip for now.
Let’s get started.
What Is PuTTY, and Why Do People Use It?
PuTTY is a free tool for Windows. It lets you connect to another computer, usually a server, over the internet. You type commands, and the server does what you ask. This is called using a terminal or a command line, similar to how an engineer types autocad software commands into a prompt instead of clicking through endless menus.
Most people use PuTTY to connect through SSH (Secure Shell). SSH keeps your connection safe and private. So when someone says “PuTTY commands,” they often mean two things:
- The Linux commands you type after you connect to a server
- The special commands you can use to control PuTTY itself, like opening a saved connection automatically
This guide covers both, so you get the full picture.
How to Connect to a Server Using PuTTY
Before we look at commands, let’s quickly cover how to connect. If you already know this, feel free to skip ahead.
- Download PuTTY from the official website and open it. You do not need to install it.
- In the “Host Name” box, type your server’s IP address.
- Make sure “SSH” is selected, and the port is set to 22.
- Click “Open.”
- A black window will appear. Type your username and press Enter.
- Type your password and press Enter. Note: the password will not show on screen, not even as dots. This is normal, so don’t worry.
Once you see a command prompt, you are connected. Now you can start typing commands.
Basic Navigation Commands
These are the first commands every beginner should learn. They help you move around the server, like walking through folders on your computer.
- pwd: Shows the folder you are currently in. Type pwd and press Enter. It might show something like /home/username.
- ls: Lists all files and folders in your current location.
- ls -l: Lists files with extra details, like size and date.
- ls -a: Shows hidden files too. These are files that start with a dot, like .bashrc.
- cd foldername: Moves you into a folder. For example, cd public_html takes you into the public_html folder.
- cd ..: Moves you back one folder.
- cd ~: Takes you straight to your home folder, no matter where you are.
- cd /: Takes you to the very top folder, called the root.
Try moving around with these commands a few times. It feels strange at first, but it becomes second nature quickly.
File and Folder Management Commands
Once you can move around, the next step is creating, copying, and removing files. Be careful with these, since some actions cannot be undone.
- mkdir foldername: Creates a new folder. Example: mkdir backups
- touch filename: Creates a new, empty file. Example: touch notes.txt
- cp source destination: Copies a file. Example: cp file.txt backup.txt
- cp -r folder1 folder2: Copies an entire folder, including everything inside it.
- mv oldname newname: Moves or renames a file or folder. Example: mv notes.txt important.txt
- rm filename: Deletes a file. There is no recycle bin, so double check before you press Enter.
- rm -r foldername: Deletes a folder and everything inside it.
Tip: Before deleting anything important, type ls first to make sure you are deleting the right file. A small typo with rm can remove the wrong thing, and there is no way to get it back.
Viewing and Editing Files
Sometimes you need to look inside a file, or make small changes to it, without leaving the terminal.
- cat filename: Shows the entire content of a file on the screen. Good for short files.
- less filename: Opens a file so you can scroll through it slowly. Press q to exit.
- head filename: Shows the first 10 lines of a file.
- tail filename: Shows the last 10 lines of a file. Useful for checking error logs.
- nano filename: Opens a simple text editor. This is the easiest one for beginners. Use arrow keys to move, then press Ctrl+O to save and Ctrl+X to exit.
- vi filename or vim filename: Opens a more advanced editor. It can feel confusing at first, since you need to press i to start typing, and Esc then :wq to save and exit.
Checking Server Information
These commands help you understand how your server is doing. They are great for checking if something is running slowly or using too much space.
- top: Shows live information about what is using your server’s CPU and memory. Press q to exit.
- df -h: Shows how much storage space is used and free, in an easy-to-read format.
- free -h: Shows how much memory (RAM) is being used.
- uptime: Shows how long the server has been running without a restart.
- whoami: Shows the username you are currently logged in as.
- hostname: Shows the name of the server you are connected to.
Permission and User Commands
Linux servers control who can do what using permissions. Here are the commands you will run into most often.
- sudo command: Runs a command with admin-level power. For example, sudo apt update. You may need to type your password again.
- chmod 755 filename: Changes who can read, write, or run a file. The numbers control the permission level.
- chown user:group filename: Changes who owns a file or folder.
- passwd: Lets you change your password for the current user.
If you are not sure what permission number to use, 755 for folders and 644 for files is a safe starting point for most websites.
PuTTY Command-Line Switches (The Part Most Guides Skip)
Here is something many other guides leave out completely. PuTTY itself can be controlled using command-line switches. This means you can open PuTTY from a Windows shortcut, a script, or the Run box, and have it connect automatically without clicking anything.
You can use these by opening the Run box (Windows key + R) and typing the command, or by editing a desktop shortcut.
- putty.exe -ssh user@hostaddress: Opens PuTTY and connects to a server using SSH right away.
- putty.exe -load “SessionName”: Opens a saved session by name, with all its settings already filled in.
- putty.exe -ssh user@host -P 2222: Connects using a specific port number, here port 2222 instead of the default 22.
- putty.exe -pw yourpassword: Logs in automatically using a password. Be careful with this, since the password may be visible to anyone with access to your computer.
- putty.exe -i keyfile.ppk: Connects using a private key file instead of a password, which is safer.
These switches are useful if you connect to the same server often. You can create a desktop shortcut that opens PuTTY and logs you straight in, saving you several steps every time.
File Transfer Commands: PSCP and PSFTP
PuTTY actually comes with two extra tools that many beginners do not know about. They let you move files between your computer and your server without opening a separate program.
PSCP (PuTTY Secure Copy)
PSCP copies files securely between your computer and a server. You run it from the Windows Command Prompt, not from inside PuTTY.
- pscp file.txt user@host:/home/user/: Sends a file from your computer to the server.
- **pscp user@host:/home/user/file.txt C:\Downloads**: Downloads a file from the server to your computer.
PSFTP (PuTTY SFTP Client)
PSFTP opens an interactive file transfer session, similar to FTP, but secure.
- psftp user@host: Starts a secure file transfer session.
- put filename: Uploads a file to the server, once inside a PSFTP session.
- get filename: Downloads a file from the server, once inside a PSFTP session.
If you only need to move a few files now and then, PSCP is usually faster. If you need to browse folders and move several files, PSFTP feels more familiar.
Useful PuTTY Keyboard Shortcuts
These shortcuts work inside the PuTTY window itself, and they can save you a lot of time.
- Right-click: Pastes whatever you last copied. This is one of the most useful tricks in PuTTY.
- Highlight text with your mouse: Automatically copies it, no need to press Ctrl+C.
- Ctrl+Shift+C / Ctrl+Shift+V: Copy and paste, if right-click paste is turned off.
- Up arrow: Brings back your last typed command, so you don’t have to retype it.
- Ctrl+C: Stops a command that is currently running.
- Tab: Auto-completes file and folder names. Start typing a name and press Tab to finish it, a habit that is just as crucial as mastering linux laptop most used shortcuts for a faster workflow.”
Common PuTTY Problems and How to Fix Them
Even experienced users run into these issues from time to time. Here is how to handle the most common ones.
- “Connection refused”: This usually means the server is not running, or the port number is wrong. Double check the IP address and port.
- “Network error: Connection timed out”: Often caused by a firewall blocking the connection. Check your firewall settings, or contact your hosting provider.
- “Server’s host key is not cached”: This is normal the first time you connect to a new server. Click “Yes” to trust it and continue.
- Password not working: Remember, PuTTY does not show any characters when you type a password, not even dots. Just type carefully and press Enter.
- Session freezes: Try pressing Enter a few times. If that does not work, close PuTTY and reconnect.
Frequently Asked Questions
Is PuTTY safe to use?
Yes. PuTTY is widely trusted and has been used by IT professionals for over 20 years. Always download it from the official website to avoid fake versions.
Do I need to install PuTTY?
No. PuTTY is a single file. You can download it and run it right away, with no installation needed.
What is the difference between PuTTY and SSH commands?
PuTTY is the program you use to connect. SSH commands are the instructions you type once you are connected, like ls or cd. PuTTY is the door, and SSH commands are what you do once you are inside.
Can I save my login details in PuTTY?
You can save the host name, port, and connection type as a “saved session.” For security reasons, PuTTY does not save your password by default.
What should I do if I forget a command?
Type man followed by the command name, like man ls, to see instructions for how it works. Press q to exit.
Final Thoughts
Learning PuTTY commands is a lot like learning to ride a bike. It feels wobbly at first, but after a little practice, it becomes automatic. Start with the basic navigation commands like pwd, ls, and cd. Once those feel comfortable, move on to file management, and then try the PuTTY-specific shortcuts like saved sessions and right-click paste.
Keep this guide handy, and before long, you will be moving around servers like it’s second nature.








