0% found this document useful (0 votes)
27 views2 pages

Linux Notes

Linux basic command
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

Linux Notes

Linux basic command
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Linux:

User-->OS-->Laptop

OS types:

GUI-->Graphical User Interface.


CLI-->Command Line Interface.

Window-->cost/ram/storage/loe_secure/
Linux-->free/low ram/law storage/High Security/Multi User(Not User Friendly)

Linux os (CLI)

1)login as:ec2-user
2)whoami-naa yaaru
3)sudo su,sudo -i,sudo su -root---->convert to ec2 user to root(admin)user
4)exit----->root user to ec2 user
5)clear---->clear the screen
6)pwd(present working directry)-----current location----->eg.(/root),(/home/ec2-
user)
7)ls(list)---->directry kulla irukkura file
8)ls -a------->directry kulla irukkura hide with hide file kaattum
9)mkdir dir_name--->create a directry.
10)mkdir dir_name1 dir_name2 dir_name3 ...--->create a directry.
11)cd dir_name--->click and see directry.
12)cd ..---->backword.
13)cd ../../../..--->4 step backword.
14)touch file_name---->create file name(format txt file)
15)touch file_name.format(py,json,yaml...)--->create file with format.
16)touch file_name1 file_name2 file_name3--->create multible files.
17)touch file_name1.txt file_name.py---->create multible files with format.
18)cp file_name--->copy(not only depends on the location)
19)cp file_name1 file_name2 paste_dir_name(eg_/root/d1/old/new/manoj/)
20)mv move_dir_name paste_dir_name----->move.
21)rm file_name---->remove file
21 i)rm:remove regular empty file 'file_name'?y(or)n.
22)rm -f file_name---->remove force fully.
23)rm -f file_name1 file_name2 file_name3---->remove files.
24)rm dir_name--->remove directry
24 i)rm: cannot remove 'dir_name':ls a directory.
25)rm -r dir_name---->remove directory.
25 i)rm: descend into directory 'dir_name'?y(or)n
26)rm -rf dir_name--->remove directory forcefully.
27)rm -rf *---->remove all directory and files forcefully.
28)ls -l--->long list.
29)ls -lt---->long list with time arrage.
30)ls -ltr--->long list with time arragement reverse.
31)ls -ltrh--->lond list with time arragement reverse in human readable.

Edit

32)vi file_name---->edit file.


i)i--->INSERT Mode ON.(typing)
ii)Esc button--->switch escabe mode.
iii):w-->switch command mode (save).
iv):q-->quite.
v):wq--->save and quite.
vi)yy--->copy one line
vii)p---->paste.
viii)10yy--->10 line copy
ix)select---->indivitual line copy
x)right click---->paste(INSERT Mode ON)
xi)dd---->delete(Switch Escabe Mode)
xii)10dd---->10 line delete.
xiii):set nu--->line number set.
xiv):set no nu--->no line number set.
xv)gg,:$--->go to first line.
xvi)shift_button g--->last line.
xvii):mention_line_number
xviii):/find_name
xix):%s/find_name/replace_name
xx):wq!--->save and exit forcefully
xxi)cat file_name---->show inside file
xxii)cat -n file_name--->show inside file with line number.
xxiii)head file_name--->first 10 line show without line numbers.
xxiv)tail file_name---->last 10 line show without line numbers.
xxv)head -3 file_name--->first 3 line show without line numbers.
xxvi)tail -3 file_name--->first 3 line show without line numbers.
33)vi no_file_name---->create file_name and edit.

34)ps--->current running is showing.


35)ps -ef--->all running is showing.
36)ps -ef | grep ec2-user---->indivitual directory running process show.
37)kill -9 id_name_eg_2314---->forcefully close.
38)kill -15 id_name_eg_2314--->propare close.
39)pkill -9--->close using name.(?)
40)pkill -15--->close using name forcefully.(?)
41)top---->uses of CPU and Memory.
42)lsblk--->showing the number of disk connected.
43)df--->show disk file system.
44)df -h--->disk file system showing the human readable.
45)du -h---->disk utilization show the dir files size.
46)ls -sh-->show the files size.
47)gzip file_name(or)dir_name---->zip the file(eg_hi.gz)
48)gunzip file_name.gz--->un zip files.

49)U G O

read------->4
Write------>2
excecute--->1

rwx r-x r-x ===>rwx r-- --x


7 5 5 7 4 1

49)chmod 741 dir_name(or)file_name-------->change in modification()permission.


50)mv old_file_name new_file_name----->rename.

You might also like