Basic (PuTTY) SSH commands help you navigate and work efficiently with the files in the Linux terminal. You can download PuTTY to connect with the Linux server. We’d handpicked a list of basic PuTTY commands, their options, and their usage in this guide.
|Check the present location.|
|This command used to display all the content in a folder or directory.|
|It stands for change directory.
Type "cd /location"
It helps you to navigate.
|Helps you to stay at the same directory.|
|Command will shift one directory back.|
|Commands take you back to the previous location.
For example, If you were at "/home" but you moved to "/dir".
Typing the "cd -" command will take you back to "/home".
|It helps you to make the new directory.|
|The command used to copy a file in Linux.
Syntax: cp filename.extension /dir/filename.extension.
The above command copies the file extension and keeps at the location/dir with the same name file.
|Copy all the folder content.|
|If a file with the same name happens in the destination, then it will force the copy process by deleting the destination file.|
|Display the warning message before proceeding with the copy process.|
|If file have different content .It will update the file in the destination folder.|
|Will first check whether the file exists. If it happens. It don't overwrite the file again.|
|Archive the file.|
|This command moves the file from one place to another.
(Syntax: mv filename.extension /dir/filename.extension)
"mv filename.extension /dir/filename1.extension” is used to move and rename a file.
|Used to move file one folder back.|
|This command creates a new file with any extension you want like text, HTML, PHP, etc. in your current directory.
Syntax: touch filename.
the extension helps to create a file extension without any extension.
|Remove command will delete a file from a server.
Its Syntax: rm filename.extension.
|Delete all the files or content in a directory.|
|Remove the complete directory or folder.|
|Delete the folder as well as the folders inside it.|
|To display content of a file on the screen. It also copy standard input to standard output.
Syntax: cat filename.extension.
|cat command also allows scrolling if the displayed text doesn't fit the screen completely.|
|cat command also used to create a new file.
Syntax: cat > filename.extension
It is also used to concatenate two files.
">" is the output redirection character
|Allow you to read the first ten lines of the content available inside the folder.
|You can also update the number of lines you would like to display on the screen.
Syntax: head -n15 /temp/filename
Above Syntax will display the first fifteen lines of the content from the given file.
|Gives the last ten lines of content from the file.
Syntax: tail filename.extension
The tail command can provide multiple file names. It shows the last ten lines from each of the mentioned files.
Syntax: tail /dir/file1 /dir/file2
|The tail command allows you to change the number of lines you want to be displayed, other than the default number.
Syntax: tail -n15 /temp/filename
|Display the last fifteen lines of content from the given file.|
|Compress the file size.
The zip Syntax: zip -r foldername.zip folder name
|Delete the file from the zip archive by the following command
"zip -d filename.zip filename"
|The following command can update the specified list of files.
"zip -u filename.zip filename"
|To delete the original file after creating its zip archive.
By the following command,
"zip -m filename.zip filename"
|This command is used to decompress a file.
Syntax: unzip filename.zip
|Multiple numbers of data are undone by using power.
"unzip file1.zip file2.zip file3.zip"
|Syntax: unzip filename.zip -x excludedfile.zip
Syntax: unzip filename.zip -x excludedfile.zip
|to compress and decompress folders, the tar command is used.|
|The command for compressing"folder".
tar -czvf folder1.tar.gz
|The command for decompressing.
tar -xvf folder1.tar.gz
|It allows you to change permissions of a file or directory. It stands for change mode.
Syntax: chmod 754 filenames.
Permissions can be represented either by numbers from 0 to 7 or with alphanumeric characters.
|4 represents reading permission
2 represents writing permission
1 represents executing permission
0 represents no permission
|5 is a combination of 4, 0, and 1. It suggests the read, no write, and execute an agreement.|
|4 are a combination of 4, 0, and 0. It indicates read, no write and no execute permission.|
|"chmod -r" allows you to change the permission of a folder and all the files inside it.|
|This command enables you to search for a particular string inside a file or folder. If it finds the perfect match, it will return the whole line containing the phrase.|
|The command "grep -i "string" filename."Allow you to search for a string case-insensitively in the file.|
|The command "grep -c "string" filename." Allow you to count the number of appearances of a string in the given file.|
|The command "grep -l "string" *".-> display the filename that contains a particular pattern or string.|
|The command "grep -n "string" filename".-> display the line number along with the result.|
|It searches for a file inside a folder.
The Syntax: find. -name filename.extension.
By this Syntax, you can find files by permissions, users, groups, file type, size, etc.
|The command "find /directory -name filename.extension"
find a file in some directory.
|The power "find. type f -name filename.php".
You can look for any type of data, say a PHP file by using this command.
|It allows you to enter a text editor.
Syntax: vi filename
The Syntax will open the data on the screen, and if the file doesn't exist, it will create a new one with the same name.
|The escape key → allows you to cancel any command which has started in the vi editor mode.|
|To exit the vi editor, type ":q."
If in case you haven't done any changes to the file.
|Type ":q!" to exit
If you want to undo the changes in a file.
Basic SSH (PuTTY) commands are beneficial for a user to manage the basic functionalities. These commands help handle the files and folders on a Linux web server.