common putty commands

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.

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

passwd

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

pwd

Type pwd to see where on the server you are.

For example, if I type pwd in PuTTy it returns /root

4. Navigate

cd

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

cd.

5. How to get root access without root user details?

sudo su

6. How to move and rename file

Use this command to move and rename file

mv

example: moving a file to another directory

mv techpanga.jpg home/techpanga.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]

example:

rm techpanga.jpg

8. Copying a file

cp

To copy a file just use the cp ssh command.

Example:

cp file.php /home/file.php

Copy a folder with all files

cp -r

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]

example:

mkdir image

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

touch

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]

example:

chmod 777 index.php

14. How to list files and/or directories in a directory

ls

list all files and information

ls -al

Show contents with file size

ls -h

15. Create a new user account

adduser

16. Compressing folders

zip -r foldername.zip foldername

example: zip -r newfolder.zip newfolder

17. Decompressing folders

unzip

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

free -m

21. Monitor CPU, processes and memory

top
22. Display sever disk usage
df -h

If you want to know more then comment here I update this article

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.