sandervanvugt

linux fundamentals oct 2020

Oct 27th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.64 KB | None | 0 0
  1. 1 usermod -aG wheel student
  2. 2 exit
  3. 3 id
  4. 4 exit
  5. 5 cd /boot
  6. 6 ls -il
  7. 7 cp /etc/hosts .
  8. 8 ls -il
  9. 9 debugfs /dev/sda1
  10. 10 ls -l /etc/hosts
  11. 11 cat /etc/hosts
  12. 12 ls -li
  13. 13 cp hosts cphosts
  14. 14 ls -il hosts cphosts
  15. 15 ln hosts hardhosts
  16. 16 ls -il hosts hardhosts
  17. 17 echo hello >> hosts
  18. 18 ls -il hosts hardhosts
  19. 19 ln -s hosts symhosts
  20. 20 ls -il hosts hardhosts symhosts
  21. 21 cat symhosts
  22. 22 rm hosts
  23. 23 ls -l symhosts
  24. 24 cat symhosts
  25. 25 ln hardhosts hosts
  26. 26 cat symhosts
  27. 27 cd /
  28. 28 ls -l
  29. 29 history
  30. 30 ln /boot/hosts /tmp/hosts
  31. 31 ln /etc/ /tmp/etc
  32. 32 ln -s /etc/ /tmp/etc
  33. 33 cd /tmp
  34. 34 ls
  35. 35 exit
  36. 36 cd /boot
  37. 37 ls -l
  38. 38 chmod +x hosts
  39. 39 ls -l
  40. 40 find / -name "hosts"
  41. 41 find / -name "hosts" 2>/dev/null
  42. 42 find / -name "*hosts*" 2>/dev/null
  43. 43 find / -user linda
  44. 44 find / -size +200M 2>/dev/null
  45. 45 mkdir /root/linda; find / -user linda -exec cp {} /root/linda/ \;
  46. 46 history
  47. 47 cd
  48. 48 ls kugkjgjg ; who
  49. 49 ls kugkjgjg && who
  50. 50 ls kugkjgjg || who
  51. 51 ls /etc/hosts || who
  52. 52 find / -size +100M -exec ls -l {} \; -exec cp {} /root/linda/ \;
  53. 53 tar -cvf my_archive.tar /home /etc
  54. 54 ls -l
  55. 55 tar -tvf my_archive.tar
  56. 56 tar -xvf my_archive.tar
  57. 57 ls
  58. 58 yum install -y tree
  59. 59 tree etc
  60. 60 rm -rf etc home
  61. 61 ls
  62. 62 tar -czvf my_archive.tar /home /etc
  63. 63 ls -l
  64. 64 tar -cjvf my_archive.tar.bz2 /home /etc
  65. 65 ls -l
  66. 66 rm -rf /home
  67. 67 tar xvf my_archive.tar home -C /
  68. 68 tree /home
  69. 69 tar xvf my_archive.tar -C / home
  70. 70 tree /home
  71. 71 history
  72. 72 ls -l
  73. 73 file my_archive.tar
  74. 74 gunzip my_archive.tar
  75. 75 rm my_archive.tar
  76. 76 tar cvf etc.tar /etc
  77. 77 ls -l
  78. 78 gzip etc.tar
  79. 79 ls -l
  80. 80 gunzip etc.tar.gz
  81. 81 ls -l
  82. 82 bzip2 etc.tar
  83. 83 ls -l
  84. 84 bunzip2 etc.tar.bz2
  85. 85 xz etc.tar
  86. 86 ls -l
  87. 87 file my_archive.tar.bz2
  88. 88 find / -name countdown
  89. 89 echo $PATH
  90. 90 ln /usr/local/bin/countdown /usr/local/sbin/countdown
  91. 91 countdown 12
  92. 92 vim myfile
  93. 93 vimtutor
  94. 94 less /var/log/messages
  95. 95 more /var/log/messages
  96. 96 head /etc/passwd
  97. 97 head -5 /etc/passwd
  98. 98 head -5 /etc/passwd | tail -1
  99. 99 tail -f /var/log/messages
  100. 100 cat myfile
  101. 101 tac myfile
  102. 102 visudo
  103. 103 export EDITOR=/usr/bin/nano
  104. 104 visudo
  105. 105 echo export EDITOR=/usr/bin/nano >> .bashrc
  106. 106 vim .bashrc
  107. 107 export EDITOR=
  108. 108 visudo
  109. 109 cd /etc
  110. 110 grep linda *
  111. 111 grep linda * 2>/dev/null
  112. 112 ps aux
  113. 113 ps aux | grep ssh
  114. 114 ps aux | grep ssh | grep -v grep
  115. 115 grep LINDA *
  116. 116 grep LINDA * 2>/dev/null
  117. 117 grep -i LINDA * 2>/dev/null
  118. 118 grep -iR LINDA * 2>/dev/null
  119. 119 grep -iR root * 2>/dev/null
  120. 120 grep -iR -A 2 -B 2 linda * 2>/dev/null
  121. 121 COLOR=red
  122. 122 echo $COLOR
  123. 123 unset COLOR
  124. 124 echo $COLOR
  125. 125 cd
  126. 126 vim myfile
  127. 127 grep lea myfile
  128. 128 grep 'lea' myfile
  129. 129 grep '^lea' myfile
  130. 130 vim myfile
  131. 131 grep '^lea\b' myfile
  132. 132 grep '^lea' myfile
  133. 133 grep '^lea ' myfile
  134. 134 cat myfile
  135. 135 grep 'bo*t' myfile
  136. 136 grep 'bo+t' myfile
  137. 137 grep -E 'bo+t' myfile
  138. 138 grep -E 'bo?t' myfile
  139. 139 grep 'bon\{3\}nen' myfile
  140. 140 grep 'bon\{3\}en' myfile
  141. 141 grep '^.$' myfile
  142. 142 grep '^..$' myfile
  143. 143 grep 'bon{3}en' myfile
  144. 144 man semanage-fcontext
  145. 145 man 7 regex
  146. 146 man man
  147. 147 man 7 signals
  148. 148 man 7 signal
  149. 149 man 7 intro
  150. 150 man 7 standards
  151. 151 man man
  152. 152 man 2 intro
  153. 153 cat /etc/passwd
  154. 154 cut -d : -f 3 /etc/passwd
  155. 155 cut -d : -f 3 /etc/passwd | sort
  156. 156 cut -d : -f 3 /etc/passwd | sort -k
  157. 157 cut -d : -f 3 /etc/passwd | sort -n
  158. 158 echo hello | tr a-z A-Z
  159. 159 echo hello | tr [:lower:] [:upper:]
  160. 160 echo hello | tr [[:lower:]] [[:upper:]]
  161. 161 countdown 12
  162. 162 sed -n 5p /etc/passwd
  163. 163 vim myfile
  164. 164 sed -i s/bonnen/bennen/g myfile
  165. 165 cat myfile
  166. 166 ip a
  167. 167 for i in [1..99]; do echo $i; done
  168. 168 for i in {1..99}; do echo $i; done
  169. 169 for i in {1..99}; do echo hello > $i.conf; done
  170. 170 ls
  171. 171 cat 44.conf
  172. 172 for i in *conf; do sed -i 's/hello/goedemiddag/g' $i; done
  173. 173 cat 66.conf
  174. 174 awk -F : '{ print $4 }' /etc/passwd
  175. 175 awk -F : '/linda/ { print $3 }' /etc/passwd
  176. 176 awk -F : '$3 > 999 { print $1 }' /etc/passwd
  177. 177 pinfo sed
  178. 178 ls
  179. 179 ls > ls.out
  180. 180 less ls.out
  181. 181 who > ls.out
  182. 182 cat ls.out
  183. 183 date >> ls.out
  184. 184 cat ls.out
  185. 185 less /etc/services
  186. 186 sort /etc/services
  187. 187 yum install -y mailx
  188. 188 mail -s hello root
  189. 189 mail -s hello root < .
  190. 190 grep -R root /proc
  191. 191 grep -R root /proc 2> errors.txt
  192. 192 ps aux | tee psfile | grep ssh
  193. 193 less psfile
  194. 194 history
  195. 195 ls -a
  196. 196 date >> ls.out
  197. 197 ls
  198. 198 cd /etc
  199. 199 grep linda *
  200. 200 grep linda * > ~/outfile.txt
  201. 201 grep linda * > ~/outfile.txt 2&>1
  202. 202 less ~/outfile.txt
  203. 203 cd
  204. 204 history
  205. 205 cd /boot
  206. 206 ls -l
  207. 207 chmod +x hosts
  208. 208 ls -l
  209. 209 find / -name "hosts"
  210. 210 find / -name "hosts" 2>/dev/null
  211. 211 find / -name "*hosts*" 2>/dev/null
  212. 212 find / -user linda
  213. 213 find / -size +200M 2>/dev/null
  214. 214 mkdir /root/linda; find / -user linda -exec cp {} /root/linda/ \;
  215. 215 history
  216. 216 cd
  217. 217 ls kugkjgjg ; who
  218. 218 ls kugkjgjg && who
  219. 219 ls kugkjgjg || who
  220. 220 ls /etc/hosts || who
  221. 221 find / -size +100M -exec ls -l {} \; -exec cp {} /root/linda/ \;
  222. 222 tar -cvf my_archive.tar /home /etc
  223. 223 ls -l
  224. 224 tar -tvf my_archive.tar
  225. 225 tar -xvf my_archive.tar
  226. 226 ls
  227. 227 yum install -y tree
  228. 228 tree etc
  229. 229 rm -rf etc home
  230. 230 ls
  231. 231 tar -czvf my_archive.tar /home /etc
  232. 232 ls -l
  233. 233 tar -cjvf my_archive.tar.bz2 /home /etc
  234. 234 ls -l
  235. 235 rm -rf /home
  236. 236 tar xvf my_archive.tar home -C /
  237. 237 tree /home
  238. 238 tar xvf my_archive.tar -C / home
  239. 239 tree /home
  240. 240 history
  241. 241 ls -l
  242. 242 file my_archive.tar
  243. 243 gunzip my_archive.tar
  244. 244 rm my_archive.tar
  245. 245 tar cvf etc.tar /etc
  246. 246 ls -l
  247. 247 gzip etc.tar
  248. 248 ls -l
  249. 249 gunzip etc.tar.gz
  250. 250 ls -l
  251. 251 bzip2 etc.tar
  252. 252 ls -l
  253. 253 bunzip2 etc.tar.bz2
  254. 254 xz etc.tar
  255. 255 ls -l
  256. 256 file my_archive.tar.bz2
  257. 257 find / -name countdown
  258. 258 echo $PATH
  259. 259 ln /usr/local/bin/countdown /usr/local/sbin/countdown
  260. 260 countdown 12
  261. 261 vim myfile
  262. 262 vimtutor
  263. 263 less /var/log/messages
  264. 264 more /var/log/messages
  265. 265 head /etc/passwd
  266. 266 head -5 /etc/passwd
  267. 267 head -5 /etc/passwd | tail -1
  268. 268 tail -f /var/log/messages
  269. 269 cat myfile
  270. 270 tac myfile
  271. 271 visudo
  272. 272 export EDITOR=/usr/bin/nano
  273. 273 visudo
  274. 274 echo export EDITOR=/usr/bin/nano >> .bashrc
  275. 275 vim .bashrc
  276. 276 export EDITOR=
  277. 277 visudo
  278. 278 cd /etc
  279. 279 grep linda *
  280. 280 grep linda * 2>/dev/null
  281. 281 ps aux
  282. 282 ps aux | grep ssh
  283. 283 ps aux | grep ssh | grep -v grep
  284. 284 grep LINDA *
  285. 285 grep LINDA * 2>/dev/null
  286. 286 grep -i LINDA * 2>/dev/null
  287. 287 grep -iR LINDA * 2>/dev/null
  288. 288 grep -iR root * 2>/dev/null
  289. 289 grep -iR -A 2 -B 2 linda * 2>/dev/null
  290. 290 COLOR=red
  291. 291 echo $COLOR
  292. 292 unset COLOR
  293. 293 echo $COLOR
  294. 294 cd
  295. 295 vim myfile
  296. 296 grep lea myfile
  297. 297 grep 'lea' myfile
  298. 298 grep '^lea' myfile
  299. 299 vim myfile
  300. 300 grep '^lea\b' myfile
  301. 301 grep '^lea' myfile
  302. 302 grep '^lea ' myfile
  303. 303 cat myfile
  304. 304 grep 'bo*t' myfile
  305. 305 grep 'bo+t' myfile
  306. 306 grep -E 'bo+t' myfile
  307. 307 grep -E 'bo?t' myfile
  308. 308 grep 'bon\{3\}nen' myfile
  309. 309 grep 'bon\{3\}en' myfile
  310. 310 grep '^.$' myfile
  311. 311 grep '^..$' myfile
  312. 312 grep 'bon{3}en' myfile
  313. 313 man semanage-fcontext
  314. 314 man 7 regex
  315. 315 man man
  316. 316 man 7 signals
  317. 317 man 7 signal
  318. 318 man 7 intro
  319. 319 man 7 standards
  320. 320 man man
  321. 321 man 2 intro
  322. 322 cat /etc/passwd
  323. 323 cut -d : -f 3 /etc/passwd
  324. 324 cut -d : -f 3 /etc/passwd | sort
  325. 325 cut -d : -f 3 /etc/passwd | sort -k
  326. 326 cut -d : -f 3 /etc/passwd | sort -n
  327. 327 echo hello | tr a-z A-Z
  328. 328 echo hello | tr [:lower:] [:upper:]
  329. 329 echo hello | tr [[:lower:]] [[:upper:]]
  330. 330 countdown 12
  331. 331 sed -n 5p /etc/passwd
  332. 332 vim myfile
  333. 333 sed -i s/bonnen/bennen/g myfile
  334. 334 cat myfile
  335. 335 ip a
  336. 336 for i in [1..99]; do echo $i; done
  337. 337 for i in {1..99}; do echo $i; done
  338. 338 for i in {1..99}; do echo hello > $i.conf; done
  339. 339 ls
  340. 340 cat 44.conf
  341. 341 for i in *conf; do sed -i 's/hello/goedemiddag/g' $i; done
  342. 342 cat 66.conf
  343. 343 awk -F : '{ print $4 }' /etc/passwd
  344. 344 awk -F : '/linda/ { print $3 }' /etc/passwd
  345. 345 awk -F : '$3 > 999 { print $1 }' /etc/passwd
  346. 346 pinfo sed
  347. 347 ls
  348. 348 ls > ls.out
  349. 349 less ls.out
  350. 350 who > ls.out
  351. 351 cat ls.out
  352. 352 date >> ls.out
  353. 353 cat ls.out
  354. 354 less /etc/services
  355. 355 sort /etc/services
  356. 356 yum install -y mailx
  357. 357 mail -s hello root
  358. 358 mail -s hello root < .
  359. 359 grep -R root /proc
  360. 360 grep -R root /proc 2> errors.txt
  361. 361 ps aux | tee psfile | grep ssh
  362. 362 less psfile
  363. 363 history
  364. 364 ls -a
  365. 365 date >> ls.out
  366. 366 ls
  367. 367 cd /etc
  368. 368 grep linda *
  369. 369 grep linda * > ~/outfile.txt
  370. 370 grep linda * > ~/outfile.txt 2&>1
  371. 371 less ~/outfile.txt
  372. 372 cd
  373. 373 history
  374. 374 history -w
  375. 375 vim .bash_history
  376. 376 exit
  377. 377 history
  378. 378 history -w
  379. 379 cp .bash_history .bash_history.bak
  380. 380 history -d 365
  381. 381 history -w
  382. 382 history
  383. 383 cat .bash_history
  384. 384 exit
  385. 385 echo $COLOR
  386. 386 exit
  387. 387 echo $COLOR
  388. 388 exit
  389. 389 history
  390. 390 touch iwyrighiwhybiuheiurbhiuerhiubhiuerhbiuheriubiuebriubgeiugbui
  391. 391 ls
  392. 392 rm iwyrighiwhybiuheiurbhiuerhiubhiuerhbiuheriubiuebriubgeiugbui
  393. 393 yum install -y bash-completion
  394. 394 echo $EDITOR
  395. 395 echo $PATH
  396. 396 env
  397. 397 COLOR=red
  398. 398 echo $COLOR
  399. 399 bash
  400. 400 export COLOR=red
  401. 401 bash
  402. 402 vim ~/.bashrc
  403. 403 exit
  404. 404 echo $PATH
  405. 405 echo $EDITOR
  406. 406 set
  407. 407 env
  408. 408 alias hello='ls -l /etc/'
  409. 409 hello
  410. 410 alias
  411. 411 sleep 3600
  412. 412 vim /etc/profile
  413. 413 cd /etc/profile.d/
  414. 414 ls
  415. 415 vim colorls.sh
  416. 416 cd
  417. 417 vim .bash_profile
  418. 418 vim .bashrc
  419. 419 vim .bash_logout
  420. 420 countdown 12
  421. 421 sleep 3600
  422. 422 bg
  423. 423 jobs
  424. 424 sleep 1800 &
  425. 425 jobs
  426. 426 fg 2
  427. 427 fg
  428. 428 ps aux | grep ssh
  429. 429 systemctl status sshd
  430. 430 top
  431. 431 dd if=/dev/zero of=/dev/null &
  432. 432 top
  433. 433 ps
  434. 434 ps aux
  435. 435 ps -ef
  436. 436 ps -ef | less
  437. 437 ps -e -o pid,args --forest
  438. 438 kill -9 2394
  439. 439 ps -e -o pid,args --forest
  440. 440 ps aux --sort pmem | less
  441. 441 ps aux --sort pmem | head
  442. 442 dd if=/dev/zero of=/dev/null &
  443. 443 top
  444. 444 ps aux | grep dd
  445. 445 killall dd
  446. 446 ps aux
  447. 447 yum repolist
  448. 448 yum install epel-release
  449. 449 yum repolist
  450. 450 yum search nmap
  451. 451 yum install nmap
  452. 452 yum search rwho
  453. 453 yum search seinfo
  454. 454 yum provides */seinfo
  455. 455 yum install setools-console -y
  456. 456 yum install -y git
  457. 457 git clone git://git.sv.gnu.org/coreutils
  458. 458 ls
  459. 459 cd coreutils/
  460. 460 ls
  461. 461 cd src
  462. 462 ls
  463. 463 less cut.c
  464. 464 cd
  465. 465 which yum
  466. 466 ls -l /usr/bin/yum
  467. 467 su - linda
  468. 468 usermod -aG wheel linda
  469. 469 id linda
  470. 470 mkdir /data/sales
  471. 471 mkdir -p /data/sales
  472. 472 groupadd sales
  473. 473 usermod -aG sales linda
  474. 474 id linda
  475. 475 cd /data
  476. 476 ls
  477. 477 ls -l
  478. 478 chown linda.sales sales
  479. 479 ls -l
  480. 480 chmod 770 sales
  481. 481 su - linda
  482. 482 ip a
  483. 483 nmtui
  484. 484 man ifconfig
  485. 485 lsblk
  486. 486 umount /dev/sdb1
  487. 487 lsblk
  488. 488 mount /dev/sdb1 /mnt
  489. 489 cd /mnt
  490. 490 ls
  491. 491 cd
  492. 492 umount /dev/sdb1
  493. 493 yum install -y httpd
  494. 494 systemctl status httpd
  495. 495 systemctl start httpd
  496. 496 systemctl status httpd
  497. 497 systemctl enable httpd
  498. 498 cd /var/log
  499. 499 ls -l
  500. 500 less messages
  501. 501 journalctl
  502. 502 journalctl -u sshd
  503. 503 journalctl --dmesg
  504. 504 journalctl -u crond --since yesterday
  505. 505 man ifconfig
  506. 506 ip -s link
  507. 507 history
  508.  
Add Comment
Please, Sign In to add comment