Introduction to Linux

Introduction to Linux

  • Basic Command.

  • Some Advance Commands.

  • SSH and SCP for connecting from local to main server and downloading the data from server and viceversa.

Basic Commands everyone should Know

1) Whoami => It tells you the which user u are or who u are.

2) ls => ls is used for listing all the things present in the directory

3) pwd=> pwd stands for (Present working Directory) it tells you about which directory you are in.

4) touch=> For creating any file we use touch and file extension for ex=> touch.txt etc..

5)mkdir => For creating folder we use mkdir, make directory.

6)cd => If you want to change the directory use cd and directory name cd new.

7) mv=> if we want to move file from one directory to other we use mv filename destination for ex=> mv filepathand filename folder

8)rm => if we want to remove file we can use rm with filename.

9) echo => echo cmd is used for printing or displaying the text or something to the terminal , it is used for displaying the data same as print in programming languages.

10) rmdir => For removing the directory we use this command same as rm.

11) cp => If we want to copy some file into another directory we can use cp cmd for that cp source/file destination.

Some Advance Commands of Linux

SSH(Secured Shell Protocol)=> why we need SSH ? If we want to connect from one machine to another machine and serving some data or some password , and in between some hackers hacks the password or data in between it will be great chaos . So it will help to connect to the other server securely with other server , we need ssh for that thing.

If we want to connect from one server to another we need pem(private key file) , then we have to run this command ssh -i Pemfile username@ ipaddress and servername

** ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. It is intended to provide secure encrypted communications between two un‐ trusted hosts over an insecure network. X11 connections, arbitrary TCP ports and UNIX-domain sockets can also be forwarded over the secure channel.

 ssh connects and logs into the specified destination, which may be specified as either
 [user@]hostname or a URI of the form ssh://[user@]hostname[:port].  The user must prove their
 identity to the remote machine using one of several methods (see below).

 If a command is specified, it will be executed on the remote host instead of a login shell.  A
 complete command line may be specified as command, or it may have additional arguments.  If
 supplied, the arguments will be appended to the command, separated by spaces, before it is sent
 to the server to be executed.**

Update and Install If we want to Update and Install something to the machine we can use sudo apt-get install and name of the package which we want to install in the machine for ex=> For Update sudo apt-get update. it will update the machine .

  • Man=> man ls it gives you the manual docs of the cmd.

SCP(open SSH secure file copy)

SCP copies files between host and a network

Suppose if we want to copy a file from local to server we use sudo scp -i(-i for identifying pem file) name.pem sourcefile destination : path of the Server

sudo scp -i touch.pem : /ubuntu/home. This command will copy file from local to server.

Image reference of local Screenshot (973).png

Image reference of server Screenshot (974).png

frommytext file is the one copied from local to server.

And we can also copy the things from server to local but the catch is , It is also operated from local machine the command will be written in the local machine for copying files from server to the local

For example=> we have created a file in server like fromserver.txt and we have to copy this file to local so we run this cmd scp -i pemfile serveraddress/filename . . is used for present or current directory so it will downloaded in that directory only.

Thank you for reading this so far. This is a brief introduction of Linux

Hope it's a nice and informative read for you. If you find this article useful, like and share this article. Someone could find it useful too.

If you find anything technically inaccurate, please feel free to reach out to us.

See you in my next Blog article, Take care!!