Sitemap
Dilshika tissera

Dilshika tissera

Concerned about Cyber security and law

linux basic commands

2 min readAug 19, 2023

There are so many commands available in linux used for various tasks.

but do we have to memorize all these commands? no . If you are a begginer man man command will be helful for you when you are working with linux . If you dont know wheat is done by particular command you can always get help from man command. for example if you want to know what is ls command you can type man ls. this command will display the what is ls command means and what are the options we can use with it.

But with the time you will master most of these commands. here are some basic commands you need to know in linux:

cd — go inside a directory

pwd — current location

cd — comeback from current directory

cat — open a file

ls — list down

ls -l — list down with permissions

ls -al — all directories ad files with permissions

mkdir — create a new directory

mv — test1.txt student

move test1.txt file into student directory

rmdir — remove directory

***if directory has files first we have to delete files inside the directory.

Get Dilshika tissera’s stories in your inbox

Join Medium for free to get updates from this writer.

rm — delete file

how to change permissions of a file

in linux r,w,x means read , write and executable permissions respectively.

these r,w,x has their own value.

0 — no permissions

1- execute

2- write

4- read

all permissions (rwx) → 1+2+4 =7

chmod 7 4 6 test1.txt

  • initial permissions → -rwxr — rw-
  • chmod 7 5 0 text1.txt
  • after changing → -rwxr-x- — -

what if we want to give permission only to group?think that our current file hasnt given executable permission to group .so we can give permission like this ;

chmod g+x test.txt

there are several text editors available in linux such as nano,vim,gedit,mousepad

--

--

Dilshika tissera
Dilshika tissera

Written by Dilshika tissera

0 followers

Concerned about Cyber security and law