Skip to main content

Command Palette

Search for a command to run...

Linux CheatSheet

Linux Commands in easiest way

Updated
4 min read
Linux CheatSheet

What is Linux ?

Linux is a open-source operating system. The Source code of linux is available to all.

Some jargons of linux

Directory : it is a folder in a linux like Windows but we call directory in Linux

Sudo : this command is used to become root in Linux to install some package or edit some important file which you can't do as a user

Root: Root is the admin of the system he has the highest privelge in the hierarchy he can remove any user or can do anything in the account of the user (not a good one will try to think in best way)

we think that linux is hard bcoz of it's command but if you know basic knowledge of files and folders in windows you will get to know linux Let's Understand in easy way possible

1) pwd Screenshot from 2022-10-31 10-17-47.png

pwd: present working directory this command is used to know in which directory you are in

2) cd Screenshot from 2022-10-31 10-19-16.png

cd: change directory this is used to change the directory

3) ls

Screenshot from 2022-10-31 10-18-19.png

ls: this is used to list all the directories and files in a directory

4) ls -l

Screenshot from 2022-10-31 10-19-40.png

ls -l : this is used to list all the files and directory with their permissions .permission in linux means once a file is created in linux it gives permission to a file like

  • r -->means only Read
  • w --> means only write
  • x --> means only executes

5)chmod

Screenshot from 2022-10-31 12-42-38.png

chmod: chmod this is use to change the file permission

chmod [permission] filename

  • r --> the value of r is 4
  • w --> the value of w is 2
  • x -->the value of x is 1

there are three categories for file permission

user group others these is the order it follows like

chmod 761 file1.txt

what does this chmod 761 mean

what does 7 means

7 is for give all permission to a user how this is 7

r+w+x =7

4+2+1=7

what does 6 means

6 means give only read and write permisson to groups how it is 6

r+w=6

4+2=6

what does 1 means

1 is given only to exectute permission for others how it 1

x =1 1=1

6) how to create a file

Screenshot from 2022-10-21 14-09-55.png

touch file1.txt what does this mean

touch is the command to create a file

file.txt is the name of the file that you want to create

7) rm file1.txt

Screenshot from 2022-10-31 12-43-16.png

we have created a file then how to delete a file

rm file1.txt

rm is the command to remove the file

file1.txt is the file that we want to delete a file

8)mkdir ineuron

Screenshot from 2022-10-31 10-26-18 (1).png

mkdir ineuron what does this mean

mkdir is used to create a directory

ineuron this is the folder name that we want to create

9)rmdir ineuron

Screenshot from 2022-10-31 12-47-15.png

we have created a directory now how to delete a directory

rmdir ineuron

rmdir is the command that is use to delete a directory

ineuron is the folder that we want to delete

10) cat file1.txt

Screenshot from 2022-10-31 10-24-43 (1).png

what does cat file1.txt

cat is the command that is used to see the content of the file

file1.txt is the command that we want to see what is there in it

11) cp file1.txt file2.txt

Screenshot from 2022-10-31 10-33-19.png

what does cp file1.txt file2.txt

cp is the command that we want to copy the file content

file1.txt is the file from where we want to copy

file2.txt is the file that we want to paste all the content of file1.txt

12) nano file1.txt

Screenshot from 2022-10-18 15-14-42.png

nano is the editor in the linux which is used to edit the file

nano is the command to open the nano editor

file1.txt is the command that is file that we want to edit

Ctrl+x is used to exit the editor

13) su -

Screenshot from 2022-10-31 10-47-03.png

this command is used to become root in linux why that # bcoz you are root now

To be Continued...