Langsung ke konten utama

How To Use SSH Command


Introduction

In this tutorial we will discuss what SSH and 14 commands (commands) are most often used in SSH. By understanding this syntax, you will find it easier to use the Linux terminal and know how to use SSH on a PC.

is - Show directory contents (list the names of files).
cd - Change Directory.
mkdir - Create a new folder (directory).
touch - Create a new file.
rm - Remove a file.
cat - Show contents of a file.
pwd - Show current directory (full path to where you are right now).
cp - Copy file/folder.
mv - Move file/folder.
grep - Search for a specific phrase in file/lines.
find - Search files and directories.
vi/nano - Text editors.
history - Show last 50 used commands.
clear - Clear the terminal screen.

What you need 

Things you must prepare before starting this guide:

  • Have access to the Terminal


Step 1 - Access the remote server 

Before you start, you are advised to have a virtual server with a new state first, so that if you accidentally make a mistake and delete something accidentally, you can immediately restore it to its original state easily.

SSH stands for Secure Shell, a protocol used to connect to the system remotely.

The basic commands that you can use are:

ssh user@serverip

This command connects you to a server that has a serverip IP address and user username. Another way you can use it is to use ssh serverip, in this way the shell will understand that you are trying to contact the same user you used when logging in now.

After you enter this command, you will be asked to fill in the password (if this is the first time you have connected, you will be shown a message that the server you have contacted has not been identified, type yes in the command line).

Yes, that's the only way, now you are connected and can continue reading this guide on how to manage your files via Terminal! If you want to exit the remote server and return to your local computer, just type exit on the command line.

Step 2 - Study the command 

In this step, we will try directly all the commands that you will learn!

IMPORTANT This can be applied to all commands in the shell. When writing arguments for the command (syntax / command), for example, cd 'Folder One' (where folder names contain 2 separate words), you must enter the name of the folder in quotation marks. The cd Folder One command (without quotes) will not work properly because the shell will think of the command as 2 arguments ("Folder" and "One").


  1. ls - This command is used to display all files and directories. We recommend that you use this command with the -l option, so that it will be ls -l, so that all files are displayed neatly and accompanied by detailed information about each of these files. Another option that can be used is -a, which also displays all files, accompanied by hidden files / directories (dot files with a dot in front of them, for example: the .ssh directory).
  2. cd - This command is used to "run" between directories (cd is an example of "change directory"). After displaying all the files and directories with ls, you can choose the directory you want to run. For example, there is a home directory that you want to enter. Enter the cd home command and you will move from your current location to the "home" directory. You can use ls again to display files & directories in the new directory. You can also type the full address into a directory if, for example, you want to go to a directory with a deeper level. You can use (for example) the command cd home / TestDirectory / Another Directory. In this way, you will go directly to the directory called "Another Directory". Use the command cd ... (there are spaces and 2 points after cd) to move up 1 level (in the example, we will move back to the "Test Directory" directory from the "Another Directories" directory).
  3. mkdir - This command is used to create a new directory (stands for "make directory"). This command will create a new directory with the name that you specify, for example, mkdir Folder New will create a new directory with the current Folder name in your current directory. 
  4. touch - This command is used to create a new file with a certain extension. For example, touch FileBaru.txt will create a "txt" file called FileBarudi in your current directory (the extension can be of any type you want, even you can create a file without any extensions at all), such as touch File New. 
  5. rm - This command is used to delete certain files / directories. For example, rm File New will delete the New File file that we have created before. If you want to delete a directory and all the directories in it, use the New rm -r Folder, this will delete the "New Folder" folder and all the folders in it. 
  6. cat - This command is used to display the contents of a file. For example, cat info.txt will bring up the contents of the file to your screen. Another example, cat info.txt info2.txt> mergedinfo.txt will combine 2 files into one ("info.txt" and "info2.txt") and write the contents of the file that is combined into the file "mergedinfo.txt".
  7. cp - This command is used to copy files and folders. The command is: cp [option] source destination. Basically, you can type directly the file that you want to copy in the source section. Whereas you can replace the destination with the destination address / folder / file. Now, if you write a destination that does not yet exist, for example, you have the original file filelama.txt and make filebaru.txt as the destination, then bash will immediately copy the file and copy it with a new name. In addition, here are some options that you can use with the cp command: cp -f source destination - Force copy (copy) process by deleting destination files if needed. cp -i source destination - Will give you a warning message before overwriting the file. cp -u source destination - update option. Only copies if the source file is newer than the destination file. cp -n source destination - Will not copy if the file already exists (does not overwrite). cp -a source destination - This option will archive files. 
  8. mv - This command works in the same way as cp, but the difference is that mv will move your files, not copy them. This command can also be used to rename files (rename). If we take the same example from the cp command, (in our current directory, there is 1 file oldfile.txt) and we type this command: mv oldfile.txt newfile.txt then bash will rename the file name oldfile.txt to newfile.txt. 
  9. grep - This command looks for values ​​in files / folders. For example: the grep 'bag' file will search for the word 'bag' in the file called "file". grep will bring up all the lines containing the word. For example, if there is a line containing the phrase 'There is a bird over Budi's head', then the line will be displayed because there is a phrase bag in the sentence. 
  10. find - This command is used to find folders for files that are included in the specified criteria (name, size, file type). For example: find. -name "* .html". This request will display all the files in your current directory that have an extension / suffix ".html" (note the use of an asterisk "*" in the command we entered, it is called a wildcard whose function is to convey bash that no matter what name file before the extension ".html", the important thing is that the file has the extension ".html". 
  11. vi / nano - This command is used to enter into the text editor. For example, nano newfile will create a new file called "newfile" and directly enter the nano editor or edit the file "newfile" (if it already exists) with nano editor. The same thing applies to the vi command, which will activate another editor named vi. IMPORTANT the nano text editor is not the default editor like vi, you have to install it before you use it.
  12. history - This command is used to display commands that have been used previously. For example: history 20 will display as many as 20 commands that were previously entered in the Terminal. 
  13. clear - This command is used to delete all text from your Terminal screen. 

Conclusion Hopefully this tutorial is quite clear to you and can make you really understand the basic SSH commands and how to use them. We recommend that you view this page for more detailed information about the commands described in this tutorial and more!

Komentar

Postingan populer dari blog ini

Traffic Bot Pro v1.6.9 (Elite Cracked)

Traffic Bot Pro v1.6.9 Elite Cracked can search for your keywords in search engines (Google, Yahoo and Bing) and shopping sites (Amazon and Ebay), then find your site or product and click on your site or product page to see. TrafficBotPro can simulate many different people to do this based on your settings. You can set to get how many searches / clicks / views in a certain time, and you can also adjust the ratio of search, click and view, all will be done like real people and your site / product ranking will increase rapidly. TAGS bot traffic crackeddiabolic traffic crackeddiabolic traffic bot pro pro crack traffic bot pro download free metabolic traffic botdiabolic traffic 6.2 About Traffic Cracked Pro Bot 2018 Advertise yourself to make a profit or defeat your rival by clicking on their ads consistently. TrafficBotPro can visit any page directly or from hunting, at that time click on any ads that you set on the page consequently. It can reproduce original human tasks by setting arbi...

Simplify 2 Template Blogger

Halo sahabat Tu Sort , seperti biasanya saya akan membagikan template blogger. Template kali ini bernama Simplify 2 . Template ini dibuat oleh mbk Arlina , template dari mbk Arlina terkenal responsive dan friendly. Template ini penerus dari versi yang sebelumnya yaitu Simplify dan Simplify 2 ini mempunyai fitur lebih baik dibandingkan yang pertama. Penampakan SIMPLIFY 2 Featured Availability Responsive True Google Testing Tools Validator   True Mobile Friendly True Dynamic Heading True Adsense True Valid Schema.org True High CTR True Personal Blog True 2 Column Grid True Auto Read More With Thumbnail True Search Box True Sosial Share Button True Back to Top Button True Short Code True Unlimited Page Numbered True Fitur template SIMPLIFY 2  sangat lengkap dan bahkan dibilang cukup buat memanjakan mata pengunjung blog kalian. Bila ada pertanyaan tentang template ini, silahkan kalian tanya di komentar atau hubungi kami melalu...

Stackposts v3.3 NULLED (Includes Modules) - Social Marketing Tools

Stackposts is a social media marketing tool that allows and helps you to easily post automatically, schedule Instagram posts along with Facebook, Twitter and many others! It can also manage multiple social networks, schedule posts, increase your Traffic and engage your audience. Just upload the media you want to post, type your caption, and use the practical calendar to decide when you want your post to come out. FEATURES Easy to install and use, cellular responsive UI Post Now and Scheduled Posts Multi Social Media accounts (Instagram, Facebook, Twitter etc ...) Facebook: automatic posts, schedule post media, links, text to all Facebook profiles, pages, groups Instagram: automatic posting, schedule posting videos, pictures, stories and carousels to all Instagram accounts Twitter: automatic posting, schedule posting videos, images, text to all Twitter accounts Automatically resize images to fit Instagram's aspect ratio (Almost for each picture) Upload media to send Import media (i...