SSH is a network communication protocol (similar to the popular FTP protocol) that allows communication, e.g. between two computers (usually between a computer and a server). The greatest feature of SSH is continuous communication encryption, making it a popular protocol for working in unsecured networks.
SSH performs its role mainly when performing operations on remote computers but is often used for data transfer. For SSH connection you will need an SSH client, ie a program to connect to, for example, the server. It is worth remembering that the SSH connection programs are available both in versions with the command line and in the graphic version with buttons.
The following article provides information about the basic commands used when working with SSH. Their knowledge will help you perform basic activities on your server and will be the basis for performing more and more advanced activities.
List of Basic SSH Commands:
SSH Command | Explanation |
---|---|
ls |
Show directory contents (list the names of files), use: ls -a to list all files in a directory ls -h to list files along with file sizes ls *.html – list all files ending in .html |
cd |
Change Directory, for example: cd /vin/www-page will put you in the www-pagedirectory), use: cd ~ to go to the home folder cd / to go to the root directory cd – to go to the previous directory cd . . to move up one directory |
mkdir |
Create a new folder (directory). |
vi/nano |
Text editors. |
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. |
history |
Show last 50 used commands. |
clear |
Clear the terminal screen. |
tar |
Create & Unpack compressed archives. |
wget |
Download files from the internet. |
du |
Get file size. |
vim |
Open or create a file with the Vim text editor (e.g. vim filename.html) |
unzip |
Decompresses a folder (e.g. unzip folder.zip) |
zip |
Compress a folder (e.g. zip -r folder.zip folder). |
chmod |
Change a file’s permissions (e.g. chmod 777 folder). |
netstat |
Display network connections |
free-m |
Display your machine’s current memory usage |
exit |
Exit the remote server and return to your local machine |