• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Techgoeasy

Techgoeasy

Learn Oracle, PHP, HTML,CSS,Perl,UNIX shell scripts

  • Home
  • Oracle
    • Oracle database
    • Oracle Ebusiness Suite
    • Oracle weblogic
    • Oracle Performance Tuning
    • Oracle Hyperion
    • Oracle Cloud Tutorials
  • SQL
  • interview questions
  • Linux
  • PHP and HTML
  • Downloads
  • General
Home » Unix command and scripts » Useful SSH Putty commands

Useful SSH Putty commands

September 4, 2020 by techgoeasy 5 Comments

Useful SSH Putty commands

These are 41 Most Useful SSH Putty commands to help you manage the VPS (Virtual Private Server) or Dedicated Server.

These putty commands should help you in daily work on the server.  I have included SSH Putty commands for all major Linux distributions like Cent-OS, Ubuntu

(1)How to connect to Server using putty

Download Putty here
(a)Provide Hostname or IP address of the VPS or dedicated server (b) Choose SSH or telnet (c) For SSH, it will ask for verification of keys (d) Provide username and password and  login to the system we can use the puttycm tool.It is very useful if you are managing multiple server

PuTTY CONNECTION MANAGER (PuttyCM)

(2) Check Linux Distribution
cat /etc/*-release

(3) How to reboot the VPS
reboot

(4) How to find uptime of the box
uptime

(5) How to check the filesystem space
df -k
or
df -h

(6) How to check CPU
We can use the top command

top

SSH Putty commands


(7) How to update the package

Cent-OS distribution

yum update
Ubuntu distribution

apt-get install

(8) How to list the file

Use ls command
ls: it will list file

ls -lrt: it will list files in order of timestamp

ls -l: it will list files with details

(9) How to locate the configuration files

locate my.cnf

locate httpd.cnf

(10) How to start and stop httpd service
how to start and stop httpd service

(11) How to stop and start the MySql service
How to start and stop MySQL on Linux

(12) How to edit the file 

We can use either vi and Nano editor for it

check out the below tutorials for vi

vi editor:- vi editor tutorials

for Nano, the below command will be of help

nano <file name> : This will open filename for edit.

(13) How to create a directory

mkdir command is used to create a directory

mkdir image

(14) How to remove the file

rm command can be used to delete the file

rm <file name>

(15) How to change the password for the username

As root user

passwd <user name>

As user only

passwd

(16) How to remove the directory

rmdir can be used to delete the directory. The directory must be empty for  deletion from this command

rmdir <directory name>

(17) How to kill a process

Sometimes, you may want to kill a  stuck process. You can use the kill command to do it. We need to get the PID of the process and then kill using the below command

kill <pid>

(18) How to search for a string across the files

You can use the grep command to do it. Read the below-detailed article on it

grep "test" *.txt

grep examples

(19) How to backup the directory or folder

You may often want to backup the directory or folder before performing changes on the system. We can use the tar command for this. It is a very useful utility to perform backup

tar -cvf foldername.tar foldername

tar -xvf foldername.tar

tar a directory:- how to tar a directory in Linux

(20) How to check the content of the file

We can use the cat command for it

cat <file  name >

If the file is large, we can use more here to scroll as required

cat <file name>|more

(21) How to download files from external locations

Use the wget command.

wget http://wordpress.org/latest.tar.gz

(22)  How to change ownership of the files or directory

chown can be used to do it

chown tech:tech <filename>

chown -R tech:tech <directory name> : It will change ownership in the directory recursively

(23)  How to change the permission of the files

We can use the chmod command for that

chmod 755 <file name>

(24)  How to find the system name and version

uname -a

(25) How to find the version of Ubuntu running on the system

cat /etc/issue

(26) how to walk into the directories

We use the cd command to walk into directories

cd <directory name>

To come out of the directory, we use

cd ..

(27) How to copy the files

Use the cp command to do it

cp <file name1> <filename 2>

(28) How to rename the files or directories

Use mv command

mv file1 file2

(29) How to check for Port usage in the system

netstat -anp|grep <port no>

(30) How to shutdown the box

Type shutdown command
shutdown

(31) How to check what all users are logged into the box

Use finger command

finger

(32) How to check for running processes on the system

Use ps command

ps -ef|grep <process name>

ps -ef|grep mysql

(33) How to check the used and free RAM on the box

Use free command

free

(34) How to enable service to start on reboot?

We can use chkconfig or systemctl command for this

chkconfig mysqld on

systemctl mysqld enable

(35) How to find files across directories

We can use the find command
find . -name "test*" -print

find command: -find command in Unix with an example, How to use find command in Unix. Unix find directory command, how to find based on modified time

(36) How to read the large file in the command line
We can use more commands to read the large file in the command line

more

(37)Printing last few lines

We can use the tail command to print the lines at the end of the file

tail
We can specify the number of lines also
tail -100 alert.log

(38)Printing starting few lines

We can use the head command to print the lines at the start of the file

head
We can specify the number of lines also
head -100 alert.log

(39)command line history

We can use the history command to print all the commands executed recently. This can help us find the command executed

history

(40)File Manipulation command
We can use awk or sed for that. These are very powerful command
ps -ef|grep pmon|awk '{print $NF}'

Please read the below articles for details

sed command:- sed command is a Stream Editor – works as a filter processing  input line by line And here are 32 Useful sed command examples in Linux/Unix
awk command:-Awk command in Unix or Linux is a powerful command for processing text. Learn about awk syntax, records, fields, line Separator with examples of awk in Unix

(41)man command to know about the option for the above command
We can use man
man history

SSH Putty commands

I hope you like this compilation of useful SSH Putty commands. This is not at all the complete list. I have just tried to compile the most used ones. Please do let me know what other command should I add to this list

Related Articles

How to install SSH on Ubuntu: This post on how to install SSH on Ubuntu and troubleshoot various issues while implementing it
Linux Tutorials: List of all the Linux Articles to help in getting good knowledge on Linux Day to day Activities
Linux command for Oracle DBA: This post list all the Linux command that Oracle DBA must know in order to be successful
Unix shell scripting interview questions: Great compilation of Unix shell scripting interview questions for success in any interviews. Examples are given for the command also
split Unix command: Details about Split command, how we can split based on lines, bytes, and much more
how to tar a directory in Linux: how to tar a directory in Linux, tar command example, tar compress directory, tar gzip command, untar/extract command, tar cvfz command, tar xvfz command
https://en.wikipedia.org/wiki/PuTTY

Filed Under: Unix command and scripts Tagged With: putty, ssh command, ssh putty command

Reader Interactions

Comments

  1. Princess Mehwish says

    December 24, 2019 at 5:48 am

    Thanks for sharing the knowledge, keep up the good work.

    Reply
    • techgoeasy says

      January 30, 2020 at 4:18 am

      Thanks Princess

      Reply
  2. PapaBrew says

    December 18, 2021 at 11:42 am

    Typo fix; lowercase u in uptime

    Reply
    • techgoeasy says

      December 19, 2021 at 2:20 pm

      thanks.I have fix it

      Reply
  3. Abdullah says

    February 21, 2022 at 3:54 am

    Nothing Use-full for beginners Not mentioned any ” Return Results OR The Errors ” So iwill give you Only one l;Little star

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar



Subscribe to our mailing list

Enter your email address to subscribe to this blog and receive notifications of new posts by email

Recent Posts

  • Move SQL Baseline from One Database to Another in Oracle
  • How to drop the sql baseline in Oracle
  • how to create sql baseline from AWR repository without STS
  • how to create sql baseline from Sql tuning set in Oracle
  • How to create sql baseline from cursor cache in Oracle

Copyright © 2023 : TechGoEasy

  • Hire me
  • Privacy Policy
  • Contact Us
  • New? Start Here
  • About Us
x
x