-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDevops_IntroLinux.txt
More file actions
306 lines (200 loc) · 5.74 KB
/
Devops_IntroLinux.txt
File metadata and controls
306 lines (200 loc) · 5.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
Why Org. needs DevOps:
Fast Delivery,Higher Quality,Less capex+opex,Reduced Outage.
#SDLC#
Developers->Build----->.exe
(git) (Maven) |
Test
|
Q.A
|
Deploy(Onsite)(chef/ancible/docker/puppet)
|
Maintainance+(employee Training)
|
Monitoring(NagiOs,AWS cloud Watch)
..........................................
SDLC::
Develop->BUild->Test->Q&A(Developer)
Deploy->Maintanince->Monitoring()
DevOps Stages:
->version control::maintains version of code.(Git)
->continous Integration::compile,validate,review,unit testing,Integration testing
->continous Delivery:: deploy the build app to test servers
->continous Deployment:: deploying the test app on prod. server for realease
Devops is a methodology that allows a single team to manage the entire application
development life cycle that is development,testing,deployment and operations.
Agile drawback-Silos(employees not coperate)
Agile(Build short,Build often)(sprints)
(scrum)
code deploy
build plan operator
release
test monitor
-------------------------------------------------------------
::Linux::
UNIX:
UNICS:uniplexed information and computing services
unix v6-1975
unix-- IBM-AIX
Sun Solaris
Mac os
Hp-Ux
Linux(1991)
Linux+GNU=OS
(kernel)[part of os]
LINUX -----> RHEL,Fedora,Debian,Others(ubuntu,centos,amazon linux,Kali Linux)
->Linux is not a unix derivative.It well written from scratch.
->Linux distribution is the linux kernal and collection of software together, create an OS.
Features:
open source,secure,simplified updates for all feature software
light weight,multiuser,multi distribution.
File System hirarchy:
/home= home directory for other user
/root= its home directory for root user
/boot= Its contains bootable files
/etc = It contains all conf. files
/usr = by default soft. installed in this.
/bin = Its contains all commands used by user.
/sbin= Its contains commands used by only root user.
/opt = Optional application soft. packages.
/dev = essential device files,this includes terminal
devices,usb or any device attached to systems.
How to create a file:
Cat Touch Vi/Vm Nano
(editors)
cat > filename
touch file1 file2[empty file]
sudo su=sudo user do switch user
[root@ip]#
case sensitive write all in small
CAT: cat command is one of the most universal tools, yet all
it does is copy standard input to standard output.
create file .............ctrl+d[exit from file]
copy files
concatenate file
tac
cat > filename
cat >> filename //add some content to existing files
cat file1 file2 > all
cat file1>file2 //copy
Touch: [timestamp]
create a empty file
create multiple empty file
change time stamp of file
update only access time of file,modify time of file.
ex:
touch file1
ls
touch file1 file2
ls
stat file1
touch -a file2(access time change)
touch -m file2(modify time change)
(meta data will change any changes on access and modify)
Vi Editor:
-A programer text editor
vi filea
insert i
----hello-----
esc + (:wq or :x) , :q , :q!
H J K L or directly arrow button(for navigate)
Nano:
nano fileb
ctrl+x(to out of file)
ll or ls -l(long listing of all file)
ls -a(hidden files)
history(all commands)
.....................................................
mkdir dirName(make a directory)
cd dirName(change directory)
cd ..(Parent directory)
pwd (present working directory)
touch .file('.' helps to hidden file)
mkdir .dirName(hidden directory)
cp <srcFile> <destFile>
mv <srcFile/dir> <dir>
mv oldFile newFile(rename)
rmdir delete directory
rm delete file
rmdir -p (remove parent and child)
rm -rf(forcefully delete)
rm -rp(remove non empty incuding parent and child)
rm -r(remove empty directory)
less file1
head file1
tail file1
more file1
...................................................
useradd ram(add user)
cat etc/passwd
groupadd myGroup
cat etc/group
gpassword -a sai myGroup
gpassword -m anamd,yash,saleem myGroup
ln -s file1 softFile
ln file1 hardFile
tar [clubing all files in single files]
tar cvf dirx
gzip [compress]
gzip dirx.tar
gunzip
dir tar.gz
wget <url>(download any file)
-yum install tree
-mkdir -p dirx/diry/dirz
-useradd karri
-cat /etc/passwd
-groupadd myGroup
-cat /etc/group
-useradd dilip
-useradd sanjay
-gpasswd -a karri myGroup
-gpasswd -m dilip,sanjay myGroup
-cat /etc/group
-cat >> file1
-ln -a file1 softLinkFile1
-ls -l
-cat softLinkFile1
-ln file2 hardLink2
[hardlink normal kind of file]
-cat >> hardLink2
-cat file2
-softLink vs HardLink
-tar -cvf dirx.tar dirx
(dest) (src)
-gzip dirx.tar [compress]
-gunzip dirx.tar.gz
-tar -xvf dirx.tar
-wget <url>
-ls
-yum install <fileName>
-rm -rf *(remove all files)
-------------------------------------------------------------------
Access Mode/Permission
r 4 to display the content to list content
w 2 to modify to create or remove
x 1 to execute to enter into directory
10 character long:
-/d/l rwx r_x r__
(file/directory/link) (root user/admin) (group) (other users)
-/d/l rwx r_x r__ 1 root root 0 date time name
(symb. link) (owner) (group) (filesize)
commands:
[rwx(4+2+1)=7]
chmod 777 dirName
u=root user/owner,g=group,o=other
+ add, - remove, = assign permission
u+w(add write permission to user)
1. chmod -> used to change access mode of file.
chmod u-w,g+w,o=wx fileName
2. chown -> change the owner.
chown karri file1
3. chgrp -> change the group.
chgrp myGroup file1
chmod 777 dir1
chmod 755 file1
chmod g=r,o=rw dir1
chmod u=r,g=rwx,o=x file1
chmod u+w,g-w,o+r file1
chown karri dir1
chgrp linux file1