{"id":255,"date":"2021-12-15T11:42:16","date_gmt":"2021-12-15T11:42:16","guid":{"rendered":"https:\/\/adhavahost.com\/blog\/?p=255"},"modified":"2022-07-13T12:58:13","modified_gmt":"2022-07-13T12:58:13","slug":"useful-putty-commands","status":"publish","type":"post","link":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/","title":{"rendered":"Useful Putty Commands"},"content":{"rendered":"\n<p><strong>What Is Putty?<\/strong><\/p>\n\n\n\n<p>Putty is an open source SSH client used to connect to a remote server. Putty is basically a terminal for windows based operating systems.&nbsp;It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. PuTTY was originally written for Microsoft Windows, but it has been ported to various other operating systems. To work with Putty you need to know few basic Putty Commands.<\/p>\n\n\n\n<p>Say you have a Linux Server set up.<\/p>\n\n\n\n<p>To connect to your server from your PC you can use Putty and type simple SSH commands to perform different basic actions such as creating folders, copying them and so on.<\/p>\n\n\n\n<p><strong>What you will need to use Putty&nbsp;<\/strong><\/p>\n\n\n\n<p>1. A Linux based server<br>2. Putty installed on your computer<br>3. The server\u2019s IP address<br>4. Username<br>5. Password<\/p>\n\n\n\n<p>Download Putty and save it on your desktop. You don\u2019t have to install it just click on it and it will run out of the box.<\/p>\n\n\n\n<p>Out of all those options we are interested in well\u2026just one and that\u2019s the Host Name field(the IP address).<\/p>\n\n\n\n<p>Here you need to input your own server\u2019s IP address in order to connect to it.<\/p>\n\n\n\n<p>Just enter the IP address making sure the connection type SSH is checked and port is 22.<\/p>\n\n\n\n<p>Hit open.&nbsp;You will be presented with a black screen like this.<\/p>\n\n\n\n<p><strong>Useful SSH Putty Commands<\/strong><\/p>\n\n\n\n<p>1) How to find out where you are, the pwd command shows you&nbsp;<em>present working directory.<\/em><\/p>\n\n\n\n<p>pwd<\/p>\n\n\n\n<p>2) Change directory<\/p>\n\n\n\n<p>cd<\/p>\n\n\n\n<p>The cd command is used to navigate into a specified directory on your server.<\/p>\n\n\n\n<p>Example: cd \/home (moves you into the home folder)<\/p>\n\n\n\n<p>3) The same directory<\/p>\n\n\n\n<p>cd .<\/p>\n\n\n\n<p>Using this command you will remain in the same directory you were.<\/p>\n\n\n\n<p>4) Move me up one directory<\/p>\n\n\n\n<p>cd ..<\/p>\n\n\n\n<p>Above command will navigate two steps back from current directory<\/p>\n\n\n\n<p>5) Go to the previous directory<\/p>\n\n\n\n<p>cd \u2013<\/p>\n\n\n\n<p>Above command will navigate to the previous directory.<\/p>\n\n\n\n<p>6) Go to Home folder<\/p>\n\n\n\n<p>cd ~<\/p>\n\n\n\n<p>Above command will navigate to the home directory on your server.<\/p>\n\n\n\n<p>7) Go to root<\/p>\n\n\n\n<p>cd \/<\/p>\n\n\n\n<p>Above command will navigate to root.<\/p>\n\n\n\n<p><strong>How to List Directories and Contents<\/strong><\/p>\n\n\n\n<p>8) List files<\/p>\n\n\n\n<p>ls<br>usage: ls [option] [file]<\/p>\n\n\n\n<p>Using the ls command in a folder will display all it\u2019s content.<\/p>\n\n\n\n<p>Example: ls \/home.<\/p>\n\n\n\n<p>Will return all content of the folder \/home.<\/p>\n\n\n\n<p>9) Show me all files in a directory<\/p>\n\n\n\n<p>ls -a<\/p>\n\n\n\n<p>10) Show contents with file size<\/p>\n\n\n\n<p>ls -h<\/p>\n\n\n\n<p>If you wish to see a directory\u2019s contents with file sizes just type ls -h<\/p>\n\n\n\n<p>11) How to see sub-directories recursively<\/p>\n\n\n\n<p>ls -r<\/p>\n\n\n\n<p>The ls -r command is used to see sub-directories recursively.<\/p>\n\n\n\n<p>12) How to see files by file size<\/p>\n\n\n\n<p>ls -is<\/p>\n\n\n\n<p>13) List all folders in directory with details<\/p>\n\n\n\n<p>ls -alh<\/p>\n\n\n\n<p><strong>How to Copy files\/folders with Putty Commands<\/strong><\/p>\n\n\n\n<p>14) Copying a file<\/p>\n\n\n\n<p>cp<\/p>\n\n\n\n<p>To copy a file just use the cp ssh command.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p>cp filename.php \/home\/filename.php<\/p>\n\n\n\n<p>15) Copy a folder with all files<\/p>\n\n\n\n<p>cp -r<\/p>\n\n\n\n<p>This one is used to copy the entire folder with all it\u2019s contents.<\/p>\n\n\n\n<p>16) Copy and rename<\/p>\n\n\n\n<p>cp filename.php \/home\/filename2.php<\/p>\n\n\n\n<p><strong>How to Move files to different locations<\/strong><\/p>\n\n\n\n<p>17) Moving a file<\/p>\n\n\n\n<p>mv<\/p>\n\n\n\n<p>Example:&nbsp;mv page.php \/home\/page.php<\/p>\n\n\n\n<p>18) Move and rename<\/p>\n\n\n\n<p>mv page.php \/home\/newpage.php<\/p>\n\n\n\n<p>19) Move file up one directory<\/p>\n\n\n\n<p>mv filename ..<\/p>\n\n\n\n<p>example: mv index.html\/ ..<\/p>\n\n\n\n<p><strong>How to Create files\/folders using Putty Commands<\/strong><\/p>\n\n\n\n<p>20) Create a folder<\/p>\n\n\n\n<p>mkdir<\/p>\n\n\n\n<p>example: mkdir new-folder<\/p>\n\n\n\n<p>21) Create a file<\/p>\n\n\n\n<p>touch<\/p>\n\n\n\n<p>Use the touch command to create different files and file extensions<\/p>\n\n\n\n<p>Example:&nbsp;touch index.php<\/p>\n\n\n\n<p><strong>How to Compress\/Uncompress files?<\/strong><\/p>\n\n\n\n<p>22) Compressing folders<\/p>\n\n\n\n<p>zip -r foldername.zip foldername<\/p>\n\n\n\n<p>Example:&nbsp;zip -r newfolder.zip newfolder<\/p>\n\n\n\n<p>23) uncompressing folders<\/p>\n\n\n\n<p>unzip<\/p>\n\n\n\n<p>Example:&nbsp;unzip newfolder.zip<\/p>\n\n\n\n<p>24) Compressing folders using tar -czvf<\/p>\n\n\n\n<p>tar -czvf foldername.tar.gz foldername<\/p>\n\n\n\n<p>Example:&nbsp;tar -czvf wp-content.tar.gz wp-content<\/p>\n\n\n\n<p>25) uncompressing folders using tar -czvf<\/p>\n\n\n\n<p>tar -xvf foldername.tar.gz<\/p>\n\n\n\n<p>Example:&nbsp;tar -xvf wp-content.tar.gz<\/p>\n\n\n\n<p><strong>How to Delete\/Remove files?<\/strong><\/p>\n\n\n\n<p>26) Delete a file<\/p>\n\n\n\n<p>rm<\/p>\n\n\n\n<p>To delete a file on your server just use the rm command.<\/p>\n\n\n\n<p>Example: rm index.php<\/p>\n\n\n\n<p>27) Delete all files from a directory<\/p>\n\n\n\n<p>rm *<\/p>\n\n\n\n<p>This command is used to delete all contents from a directory.<\/p>\n\n\n\n<p>Example: rm * foldername<\/p>\n\n\n\n<p>28) Delete a folder\/directory<\/p>\n\n\n\n<p>rmdir<\/p>\n\n\n\n<p>Use this command to remove directories.<\/p>\n\n\n\n<p><strong>How to change File permissions?<\/strong><\/p>\n\n\n\n<p>29) Change file permissions<\/p>\n\n\n\n<p>chmod<\/p>\n\n\n\n<p>Example:&nbsp;chmod 775 newfolder<\/p>\n\n\n\n<p>30) Change permissions of folder and all files inside<\/p>\n\n\n\n<p>chmod 755 folder name -R<\/p>\n\n\n\n<p>Thanks for reading our article and we will keep updating the same articles with more useful commands in coming days. Keep checking this space for more Putty commands.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Visit our website\u00a0<a href=\"http:\/\/www.adhavahost.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">www.adhavahost.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What Is Putty? Putty is an open source SSH client used to connect to a remote server. Putty is basically a terminal for windows based operating systems.&nbsp;It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. PuTTY was originally written for Microsoft Windows, but it has been ported to various other &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/\"> <span class=\"screen-reader-text\">Useful Putty Commands<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[19],"tags":[26,16,17,18,24,25],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Useful Putty Commands | Adhava Host - Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Useful Putty Commands | Adhava Host - Blog\" \/>\n<meta property=\"og:description\" content=\"What Is Putty? Putty is an open source SSH client used to connect to a remote server. Putty is basically a terminal for windows based operating systems.&nbsp;It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. PuTTY was originally written for Microsoft Windows, but it has been ported to various other &hellip; Useful Putty Commands Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Adhava Host - Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/adhavahost\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-15T11:42:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-13T12:58:13+00:00\" \/>\n<meta name=\"author\" content=\"kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/\"},\"author\":{\"name\":\"kumar\",\"@id\":\"https:\/\/adhavahost.com\/blog\/#\/schema\/person\/a9c101bbf3b9071cbe94dc2ee06e8f7e\"},\"headline\":\"Useful Putty Commands\",\"datePublished\":\"2021-12-15T11:42:16+00:00\",\"dateModified\":\"2022-07-13T12:58:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/\"},\"wordCount\":767,\"publisher\":{\"@id\":\"https:\/\/adhavahost.com\/blog\/#organization\"},\"keywords\":[\"domain registration\",\"web hosting\",\"web hosting chennai\",\"web hosting india\",\"web hosting tamil nadu\",\"web hosting tn\"],\"articleSection\":[\"web hosting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/\",\"url\":\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/\",\"name\":\"Useful Putty Commands | Adhava Host - Blog\",\"isPartOf\":{\"@id\":\"https:\/\/adhavahost.com\/blog\/#website\"},\"datePublished\":\"2021-12-15T11:42:16+00:00\",\"dateModified\":\"2022-07-13T12:58:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/adhavahost.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Useful Putty Commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/adhavahost.com\/blog\/#website\",\"url\":\"https:\/\/adhavahost.com\/blog\/\",\"name\":\"web hosting, website hosting, hosting, hosting india, web hosting india\",\"description\":\"web hosting in chennai, web hosting, website hosting, hosting, hosting india, web hosting india\",\"publisher\":{\"@id\":\"https:\/\/adhavahost.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/adhavahost.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/adhavahost.com\/blog\/#organization\",\"name\":\"www.adhavahost.com\",\"url\":\"https:\/\/adhavahost.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/adhavahost.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/adhavahost.com\/blog\/wp-content\/uploads\/2018\/01\/logo1-1.png\",\"contentUrl\":\"https:\/\/adhavahost.com\/blog\/wp-content\/uploads\/2018\/01\/logo1-1.png\",\"width\":180,\"height\":100,\"caption\":\"www.adhavahost.com\"},\"image\":{\"@id\":\"https:\/\/adhavahost.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/adhavahost\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/adhavahost.com\/blog\/#\/schema\/person\/a9c101bbf3b9071cbe94dc2ee06e8f7e\",\"name\":\"kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/adhavahost.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ed5258ae991aade853069c3d9802c54f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ed5258ae991aade853069c3d9802c54f?s=96&d=mm&r=g\",\"caption\":\"kumar\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Useful Putty Commands | Adhava Host - Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/","og_locale":"en_US","og_type":"article","og_title":"Useful Putty Commands | Adhava Host - Blog","og_description":"What Is Putty? Putty is an open source SSH client used to connect to a remote server. Putty is basically a terminal for windows based operating systems.&nbsp;It supports several network protocols, including SCP, SSH, Telnet, rlogin, and raw socket connection. PuTTY was originally written for Microsoft Windows, but it has been ported to various other &hellip; Useful Putty Commands Read More &raquo;","og_url":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/","og_site_name":"Adhava Host - Blog","article_publisher":"https:\/\/www.facebook.com\/adhavahost","article_published_time":"2021-12-15T11:42:16+00:00","article_modified_time":"2022-07-13T12:58:13+00:00","author":"kumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kumar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/#article","isPartOf":{"@id":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/"},"author":{"name":"kumar","@id":"https:\/\/adhavahost.com\/blog\/#\/schema\/person\/a9c101bbf3b9071cbe94dc2ee06e8f7e"},"headline":"Useful Putty Commands","datePublished":"2021-12-15T11:42:16+00:00","dateModified":"2022-07-13T12:58:13+00:00","mainEntityOfPage":{"@id":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/"},"wordCount":767,"publisher":{"@id":"https:\/\/adhavahost.com\/blog\/#organization"},"keywords":["domain registration","web hosting","web hosting chennai","web hosting india","web hosting tamil nadu","web hosting tn"],"articleSection":["web hosting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/","url":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/","name":"Useful Putty Commands | Adhava Host - Blog","isPartOf":{"@id":"https:\/\/adhavahost.com\/blog\/#website"},"datePublished":"2021-12-15T11:42:16+00:00","dateModified":"2022-07-13T12:58:13+00:00","breadcrumb":{"@id":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/adhavahost.com\/blog\/useful-putty-commands\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/adhavahost.com\/blog\/useful-putty-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/adhavahost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Useful Putty Commands"}]},{"@type":"WebSite","@id":"https:\/\/adhavahost.com\/blog\/#website","url":"https:\/\/adhavahost.com\/blog\/","name":"web hosting, website hosting, hosting, hosting india, web hosting india","description":"web hosting in chennai, web hosting, website hosting, hosting, hosting india, web hosting india","publisher":{"@id":"https:\/\/adhavahost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/adhavahost.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/adhavahost.com\/blog\/#organization","name":"www.adhavahost.com","url":"https:\/\/adhavahost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/adhavahost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/adhavahost.com\/blog\/wp-content\/uploads\/2018\/01\/logo1-1.png","contentUrl":"https:\/\/adhavahost.com\/blog\/wp-content\/uploads\/2018\/01\/logo1-1.png","width":180,"height":100,"caption":"www.adhavahost.com"},"image":{"@id":"https:\/\/adhavahost.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/adhavahost"]},{"@type":"Person","@id":"https:\/\/adhavahost.com\/blog\/#\/schema\/person\/a9c101bbf3b9071cbe94dc2ee06e8f7e","name":"kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/adhavahost.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ed5258ae991aade853069c3d9802c54f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed5258ae991aade853069c3d9802c54f?s=96&d=mm&r=g","caption":"kumar"}}]}},"_links":{"self":[{"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/posts\/255"}],"collection":[{"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":2,"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":257,"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/posts\/255\/revisions\/257"}],"wp:attachment":[{"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adhavahost.com\/blog\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}