If you are running a Linux VPS server then you must learn to manage VPS server. You will face many types of bucks errors like server down, need to changer VPS password, rename or delete old directory. So You should learn some common putty commands to manage Ubuntu or Linux VPS server.In this article, I am sharing with you some common putty commands to manage VPS server.
- 1 What Is PuTTy?
- 2 Common Putty Commands
- 2.0.1 1. Change Password
- 2.0.2 2. Update and Upgrade
- 2.0.3 3. How to find the current directory
- 2.0.4 4. Navigate
- 2.0.5 5. How to get root access without root user details?
- 2.0.6 6. How to move and rename file
- 2.0.7 7. How to delete / remove a file
- 2.0.8 8. Copying a file
- 2.0.9 9. How to copy a folder with all files and folders in it
- 2.0.10 10. How to create new folder
- 2.0.11 11. Search for a file
- 2.0.12 12. Create a file
- 2.0.13 13. how to change file permission
- 2.0.14 14. How to list files and/or directories in a directory
- 2.0.15 15. Create a new user account
- 2.0.16 16. Compressing folders
- 2.0.17 17. Decompressing folders
- 2.0.18 18. Compressing folders using tar -czvf
- 2.0.19 19. Decompressing folders using tar -czvf
- 2.0.20 20. check usage memory
- 2.0.21 21. Monitor CPU, processes and memory
- 2.1 Related
What Is PuTTy?
PuTTY is an open source program that you can use to perform network protocol SSH, Telnet, and Rlogin. Actually putty is just one piece of software that can be used on a Windows operating system to access a VPS (virtual private server) that is based on Linux.
This can be used, for example, when configuring CGI scripts. SSH is included with many modern operating systems including Mac ® OS X and Linux distributions.Y can download putty from here: PuTTy
Common Putty Commands
1. Change Password
To change password type passwd then enter the old password and again type a new password, again verify the new password.
2. Update and Upgrade
apt-get update apt-get -s upgrade
3. How to find the current directory
Type pwd to see where on the server you are.
For example, if I type pwd in PuTTy it returns /root
The cd command (also known change directory) is used to navigate to a specified directory on your server.
Such as: cd /home (moves you into the home folder)
If you want to come into same directory then enter
5. How to get root access without root user details?
6. How to move and rename file
Use this command to move and rename file
example: moving a file to another directory
mv earngurus.jpg home/earngurus.jpg
moving a file to another directory and renaming it at once
mv image.jpg home/image2.jpg
7. How to delete / remove a file
rm [file name]
8. Copying a file
To copy a file just use the cp ssh command.
cp file.php /home/file.php
Copy a folder with all files
This one is used to copy the entire folder with all its contents.
Copy and rename
cp file.php /home/file2.php
9. How to copy a folder with all files and folders in it
cp -r [directory] [new directory]
10. How to create new folder
mkdir [folder name]
11. Search for a file
find . -name [filename] -print
example: find a file called “file.jpg” in current folder
find . -name file.jpg -print
12. Create a file
Use the touch command to create different files and file extensions (you can later edit them)
Example: touch index.php, touch index.html, touch robots.txt
13. how to change file permission
chmod [permission type] [file/folder name]
chmod 777 index.php
14. How to list files and/or directories in a directory
list all files and information
Show contents with file size
15. Create a new user account
16. Compressing folders
zip -r foldername.zip foldername
example: zip -r newfolder.zip newfolder
17. Decompressing folders
Example: unzip newfolder.zip
18. Compressing folders using tar -czvf
tar -czvf foldername.tar.gz foldername
Example: tar -czvf wp-content.tar.gz wp-content
19. Decompressing folders using tar -czvf
tar -xvf foldername.tar.gz
Example: tar -xvf wp-content.tar.gz
20. check usage memory
21. Monitor CPU, processes and memory
22. Display sever disk usage
If you want to know more then comment here I update this article