Advertisement
sandervanvugt

LinFun day2 jan24

Jan 23rd, 2024
123
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.77 KB | None | 1 0
  1. [student@centos2 ~]$ history
  2. 1 cat /etc/os-release
  3. 2 exit
  4. 3 vim countdown
  5. 4 countdown 12
  6. 5 ./countdown 12
  7. 6 ls -l countdown
  8. 7 chmod +x countdown
  9. 8 cat countdown
  10. 9 vim countdown
  11. 10 cat countdown
  12. 11 history
  13. 12 ls -l /root
  14. 13 sudo ls -l /root
  15. 14 id
  16. 15 dnf install openssh
  17. 16 sudo dnf install openssh
  18. 17 sudo systemctl status sshd
  19. 18 ip a
  20. 19 ssh 192.168.29.141
  21. 20 history
  22. 21 LS
  23. 22 ls
  24. 23 uname --help
  25. 24 uname -h
  26. 25 ls -lrt
  27. 26 pwd
  28. 27 cd /etc
  29. 28 ls -lrt
  30. 29 whoami
  31. 30 whoami --help
  32. 31 hostname
  33. 32 hostname --help
  34. 33 hostname --help | less
  35. 34 hostname -i
  36. 35 date
  37. 36 date --help | less
  38. 37 date +%d-%M-%Y
  39. 38 date +%d-%m-%Y
  40. 39 uname
  41. 40 uname -a
  42. 41 passwd
  43. 42 cd
  44. 43 touch hello
  45. 44 cd /etc
  46. 45 touch hello
  47. 46 cd
  48. 47 ls -l hello
  49. 48 touch hello
  50. 49 ls -l hello
  51. 50 last
  52. 51 history
  53. 52 history | less
  54. 53 man touch
  55. 54 pinfo '(coreutils) touch invocation'
  56. 55 man man
  57. 56 man -k user
  58. 57 man -k user | wc -l
  59. 58 man -k user
  60. 59 man -k user | grep 8
  61. 60 man -k sander
  62. 61 man man
  63. 62 man apropos
  64. 63 man mandb
  65. 64 sudo mandb
  66. 65 man lvcreate
  67. 66 history
  68. 67 man -k lvm
  69. 68 man lvcreate
  70. 69 man -k group
  71. 70 man -k group | wc -l
  72. 71 man -k group | grep 8
  73. 72 man -k group | grep 8 | grep user
  74. 73 man groupmems
  75. 74 man -k hostname
  76. 75 man hostnamectl
  77. 76 man hostname
  78. 77 hostnamectl centos2.example.com
  79. 78 hostnamectl --help
  80. 79 hostnamectl hostname centos2.example.com
  81. 80 exit
  82. 81 lvcreate --help | less
  83. 82 history
  84. 83 pwd
  85. 84 echo $USER
  86. 85 ls
  87. 86 ls -a
  88. 87 ls -al
  89. 88 ls /etc
  90. 89 ls -d /etc
  91. 90 ls -dl /etc
  92. 91 ls -lrt
  93. 92 cd /etc
  94. 93 ls a
  95. 94 ls a*
  96. 95 ls -d a*
  97. 96 ls -d a???
  98. 97 ls -d *???
  99. 98 ls -d ????
  100. 99 ls -d a[nm]
  101. 100 ls -d a[nm]*
  102. 101 ls -d a[a-m]*
  103. 102 ls trail
  104. 103 ls -trail
  105. 104 cd
  106. 105 cd /var/log
  107. 106 mkdir one
  108. 107 cd /tmp
  109. 108 mkdir one
  110. 109 rmdir one
  111. 110 mkdir one
  112. 111 touch one/two
  113. 112 rmdir one
  114. 113 rm -rf one
  115. 114 man hier
  116. 115 ls /usr
  117. 116 du -hs .
  118. 117 sudo du -hs .
  119. 118 cd /usr
  120. 119 du -hs .
  121. 120 cd /var
  122. 121 ls
  123. 122 ls log/
  124. 123 ls -l log/
  125. 124 less logs/messages
  126. 125 less log/messages
  127. 126 sudo less log/messages
  128. 127 cd /etc
  129. 128 ls
  130. 129 ls -l
  131. 130 less vconsole.conf
  132. 131 less passwd
  133. 132 less os-release
  134. 133 sudo apt install zypper
  135. 134 touch jhhkh
  136. 135 cd
  137. 136 countdown
  138. 137 echo $PATH
  139. 138 ./countdown
  140. 139 cp countdown /usr/local/bin
  141. 140 whoami
  142. 141 ls ld /usr/local/bin
  143. 142 ls -ld /usr/local/bin
  144. 143 sudo cp countdown /usr/local/bin
  145. 144 countdown
  146. 145 history
  147. 146 less log/messages
  148. 147 ls /var/log/messages
  149. 148 cd /var/cache
  150. 149 ls -l /var/log/messages
  151. 150 ls -l ../log/messages
  152. 151 cd
  153. 152 mkdir one/two/three/four/five
  154. 153 mkdir -p one/two/three/four/five
  155. 154 cd one/two/three/four/five
  156. 155 pwd
  157. 156 ls ..
  158. 157 ls ../..
  159. 158 ls ../../../../..
  160. 159 ls ../../../../../../..
  161. 160 cd
  162. 161 cp countdown /tmp/newdir
  163. 162 ls -l /tmp/newdir
  164. 163 rm -f /tmp/newdir
  165. 164 cp countdown /tmp/newdir/
  166. 165 mkdir /tmp/newdir
  167. 166 cp countdown /tmp/newdir/
  168. 167 cp * /tmp/newdir
  169. 168 ls -a /tmp/newdir
  170. 169 rm /tmp/newdir/*
  171. 170 cp -a .* /tmp/newdir/
  172. 171 ls -a /tmp/newdir
  173. 172 cp --help | less
  174. 173 ls
  175. 174 mv hello bue
  176. 175 ls
  177. 176 mv bue /tmp/
  178. 177 ls
  179. 178 history
  180. 179 sudo -i
  181. 180 cp /etc/hosts .
  182. 181 ls -il /etc/hosts
  183. 182 ls -il /etc/hosts hosts
  184. 183 ln hosts newhosts
  185. 184 ls -il hosts newhosts
  186. 185 echo hello
  187. 186 echo hello >> hosts
  188. 187 ls -il hosts newhosts
  189. 188 chmod +x hosts
  190. 189 ls -il hosts newhosts
  191. 190 ln -s hosts symhosts
  192. 191 ls -il hosts newhosts symhosts
  193. 192 rm hosts
  194. 193 ls -il hosts newhosts symhosts
  195. 194 cat symhosts
  196. 195 ln newhosts hosts
  197. 196 ls -il hosts newhosts symhosts
  198. 197 cat symhosts
  199. 198 history
  200. 199 cd /boot
  201. 200 ls
  202. 201 ln vmlinuz-5.14.0-319.el9.x86_64 ~/kernel
  203. 202 cd
  204. 203 unlink --help
  205. 204 mkdir /tmp/trash
  206. 205 cp -ar .* /tmp/trash/
  207. 206 ls -l
  208. 207 ls -la
  209. 208 cp -r /tmp .
  210. 209 ls
  211. 210 ls -ld tmp/
  212. 211 history
  213. 212 mkdir two/three/four
  214. 213 mkdir -p two/three/four
  215. 214 ls
  216. 215 tree
  217. 216 history
  218. 217 find / -name "hosts"
  219. 218 find / -name "hosts" 2>/dev/null
  220. 219 find / -name "hosts*" 2>/dev/null
  221. 220 sudo useradd bob
  222. 221 sudo find / -user "bob" -type f
  223. 222 sudo find / -user "bob" -type d
  224. 223 sudo find / -user "bob" -type l
  225. 224 sudo find / -size +1G
  226. 225 sudo find / -size +100G
  227. 226 sudo find / -size +100G 2>/dev/null
  228. 227 dd if=/dev/zero of=bigfile bs=1M count=111
  229. 228 sudo find / -size +100G 2>/dev/null
  230. 229 ls -l
  231. 230 ls -lh
  232. 231 sudo find / -size +100G 2>/dev/null
  233. 232 sudo find / -size +100M 2>/dev/null
  234. 233 sudo xxd -l 512 /dev/sda
  235. 234 sudo dd if=/dev/sda of=/root/mbr_backup bs=512 count=1
  236. 235 sudo dd if=/dev/zero of=/dev/sda bs=512 count=1
  237. 236 sudo xxd -l 512 /dev/sda
  238. 237 history
  239. 238 sudo dd if=/root/mbr_backup of=/dev/sda
  240. 239 sudo xxd -l 512 /dev/sda
  241. 240 history
  242. 241 lsblk
  243. 242 sudo dd if=/dev/sr0 of=/dev/sdb bs=1M
  244. 243 find / -user bob -exec ls -l {} \;
  245. 244 sudo find / -user bob -exec ls -l {} \; 2>/dev/null
  246. 245 sudo find / -user bob -exec ls -ld {} \; 2>/dev/null
  247. 246 who; ls
  248. 247 who\; ls
  249. 248 sudo find / -user bob -exec ls -ld {} \; 2>/dev/null
  250. 249 sudo mkdir /root/bob; sudo find / -user bob -exec cp -r {} /root/bob/ \; 2>/dev/null
  251. 250 echo $?
  252. 251 sudo ls -l /root/bob
  253. 252 ls
  254. 253 ls > lsfile
  255. 254 cat lsfile
  256. 255 ls hiughiughuih > lsfile
  257. 256 ls hiughiughuih hosts 2> lserr
  258. 257 cat lserr
  259. 258 ls oihiuh ; who
  260. 259 ls oihiuh && who
  261. 260 ls oihiuh || who
  262. 261 tar -cvf my_archive.tar /etc
  263. 262 sudo tar -cvf my_archive.tar /etc
  264. 263 ls
  265. 264 tar -tvf my_archive.tar
  266. 265 tar -xvf my_archive.tar
  267. 266 ls
  268. 267 tree etc
  269. 268 ls
  270. 269 ls -l my_archive.tar
  271. 270 tar -czvf my_archive.tgz /etc
  272. 271 sudo tar -czvf my_archive.tgz /etc
  273. 272 ls -l my*
  274. 273 sudo tar -cjvf my_archive.tar.bz2 /etc
  275. 274 ls -l my*
  276. 275 sudo tar -cJvf my_archive.tar.xz /etc
  277. 276 ls -l my*
  278. 277 history
  279. 278 mkdir /tmp/files
  280. 279 mkdir /tmp/files/{pictures,photos,videos}
  281. 280 tree /tmp/files
  282. 281 cp /etc/a* /tmp/files
  283. 282 cp /etc/[a-c]* /tmp/files
  284. 283 cd /tmp/files
  285. 284 ls
  286. 285 mv c* videos/
  287. 286 mv [ab]* photos/
  288. 287 man find
  289. 288 sudo find /etc -size -1000c -exec cp {} pictures/ \;
  290. 289 ls -l pictures/
  291. 290 ln -s /var .
  292. 291 ls
  293. 292 ls -l
  294. 293 tar -czvd homes.tgz /home
  295. 294 tar -czvf homes.tgz /home
  296. 295 ls
  297. 296 mkdir ../archive
  298. 297 cd ../archive/
  299. 298 tar -xvf ../files/homes.tgz
  300. 299 history
  301. 300 cd ../files/
  302. 301 ls
  303. 302 file homes.tgz
  304. 303 mv homes.tgz homes
  305. 304 file homes
  306. 305 vimtutor
  307. 306 vim vimfile
  308. 307 cat vimfile
  309. 308 sudo less /var/log/messages
  310. 309 sudo more /var/log/messages
  311. 310 head /etc/passwd
  312. 311 tail /etc/passwd
  313. 312 tail -5 /etc/passwd
  314. 313 tail -5 /etc/passwd | head -1
  315. 314 sudo tail -f /var/log/messages
  316. 315 cat /etc/hosts
  317. 316 cat /etc/passwd
  318. 317 cat /etc/passwd | less
  319. 318 less /etc/passwd
  320. 319 vim numbers
  321. 320 cat numbers
  322. 321 tac numbers
  323. 322 cd /etc
  324. 323 sudo grep student *
  325. 324 sudo grep student * 2>/dev/null
  326. 325 sudo grep -l student * 2>/dev/null
  327. 326 sudo grep -li student * 2>/dev/null
  328. 327 ps aux
  329. 328 ps aux | grep ssh
  330. 329 ps aux | grep ssh && echo ssh is running
  331. 330 ps aux | grep ssh >/dev/null && echo ssh is running
  332. 331 ps aux | grep sander >/dev/null && echo sander is running
  333. 332 ps aux | grep sander
  334. 333 ps aux | grep sander | grep -v grep
  335. 334 ps aux | grep sander | grep -v grep && echo sander is running
  336. 335 vim /etc/ssh/sshd_config
  337. 336 sudo vim /etc/ssh/sshd_config
  338. 337 sudo grep -i 'kerberos option' /etc/ssh/sshd_config
  339. 338 sudo grep -A 5 -i 'kerberos option' /etc/ssh/sshd_config
  340. 339 sudo grep -B 5 -i 'kerberos option' /etc/ssh/sshd_config
  341. 340 sudo grep -C 5 -i 'kerberos option' /etc/ssh/sshd_config
  342. 341 history
  343. 342 cd
  344. 343 vim regexes
  345. 344 cat regexes
  346. 345 grep 'anna' regexes
  347. 346 grep '^anna' regexes
  348. 347 grep 'anna$' regexes
  349. 348 grep '^anna$' regexes
  350. 349 grep '^anna' regexes
  351. 350 vim regexes
  352. 351 grep '^anna' regexes
  353. 352 grep '^anna$' regexes
  354. 353 grep '^anna\b' regexes
  355. 354 grep 'b.*t' regexes
  356. 355 grep 'b.+t' regexes
  357. 356 grep -E 'b.+t' regexes
  358. 357 grep -E 'b.?t' regexes
  359. 358 grep -E 'bo\{5\}t' regexes
  360. 359 grep 'bo\{5\}t' regexes
  361. 360 history
  362. 361 cat regexes
  363. 362 cut /etc/passwd
  364. 363 cut -d : -f 1 /etc/passwd
  365. 364 sort /etc/passwd
  366. 365 sort -k 3 /etc/passwd
  367. 366 sort -d : -k 3 /etc/passwd
  368. 367 man sort
  369. 368 echo hello
  370. 369 echo hello | tr a-z A-Z
  371. 370 echo hello | tr [:lower:] [:upper:]
  372. 371 echo hello | tr a-k l-z
  373. 372 sed -n 5p /etc/passwd
  374. 373 sed -i s/anna/ANNA/g regexes
  375. 374 cat regexes
  376. 375 head -1 /etc/passwd
  377. 376 awk -F : '{ print $4 }' /etc/passwd
  378. 377 awk -F : '/bob/ { print $4 }' /etc/passwd
  379. 378 awk -F : '$3 > 999 { print $1 }' /etc/passwd
  380. 379 history
  381. 380 head -5 /etc/passwd | tail -1
  382. 381 ps aux
  383. 382 ps aux | awk '{ print $1 }'
  384. 383 sudo grep -l '^root' /etc/*
  385. 384 sudo grep -l '^root' /etc/* 2>/dev/null
  386. 385 sudo tail -f | grep anna /var/log/messages
  387. 386 sudo tail -f /var/log/messages | grep anna
  388. 387 sudo sh -c |tail -f /var/log/messages | grep anna
  389. 388 sudo sh -c "tail -f /var/log/messages | grep anna"
  390. 389 sudo grep '...' /etc/* 2>/dev/null
  391. 390 sudo grep '^...$' /etc/* 2>/dev/null
  392. 391 history
  393. 392 ls > lsfile
  394. 393 cat lsfile
  395. 394 who > lsfile
  396. 395 cat lsfile
  397. 396 ls >> lsfile
  398. 397 grep -R root /etc &> myfile
  399. 398 ps aux | tee psfile | grep ssh
  400. 399 ls -la .bash_h*
  401. 400 history
  402. 401 sudo useradd anna
  403. 402 sudo sh -c "echo password | passwd --stdin anna"
  404. 403 history -d 403
  405. 404 history -w
  406. 405 ls -la .bash_h*
  407. 406 history -w
  408. 407 awk -F : '/bob/ { print $4 }' /etc/passwd
  409. 408 sudo dnf install -y bash-completion
  410. 409 touch ugiiiuguiguygyufuytytyfyugiugiutyutfytfytftydtydtydtrdtrdfyguhhoijiuftrdfytfuygiuhihiohuyfuyfyufyugyuguy
  411. 410 ls
  412. 411 rm ugiiiuguiguygyufuytytyfyugiugiutyutfytfytftydtydtydtrdtrdfyguhhoijiuftrdfytfuygiuhihiohuyfuyfyufyugyuguy
  413. 412 echo $HISTSIZE
  414. 413 env
  415. 414 echo $PATH
  416. 415 echo $SHELL
  417. 416 echo $USER
  418. 417 alias
  419. 418 alias goedemiddag='echo goedemiddag'
  420. 419 goedemiddag
  421. 420 cls
  422. 421 alias cls=clear
  423. 422 cls
  424. 423 history
  425. 424 sleep 3000
  426. 425 COLOR=red
  427. 426 echo $COLOR
  428. 427 bash
  429. 428 echo $COLOR
  430. 429 sudo vim /etc/bashrc
  431. 430 vim .bashrc
  432. 431 history
  433. 432 vim regexes
  434. 433 sleep 300
  435. 434 bg
  436. 435 sleep 400 &
  437. 436 jobs
  438. 437 fg 1
  439. 438 while true; do true; done &
  440. 439 top
  441. 440 clear
  442. 441 top
  443. 442 ps faux
  444. 443 ps -aux
  445. 444 ls lrt
  446. 445 ls -lrt
  447. 446 sudo top
  448. 447 sudo echo 0 > /sys/bus/cpu/devices/cpu1/online
  449. 448 sudo sh -c "echo 0 > /sys/bus/cpu/devices/cpu1/online"
  450. 449 sudo top
  451. 450 sudo dd if=/dev/zero of=/dev/null &
  452. 451 sudo top
  453. 452 sudo killall dd
  454. 453 history
  455. 454 sudo sh -c "echo 1 > /sys/bus/cpu/devices/cpu1/online"
  456. 455 sudo dnf repolist
  457. 456 sudo dnf install nmap
  458. 457 sudo dnf search nmap
  459. 458 sudo dnf search seinfo
  460. 459 sudo dnf provides */seinfo
  461. 460 sudo dnf install setools-console
  462. 461 sudo dnf groups list
  463. 462 sudo groups install "Virtualization Host"
  464. 463 sudo dnf groups install "Virtualization Host"
  465. 464 sudo useradd linda
  466. 465 sudo sh -c "echo password | passwd --stdin linda"
  467. 466 su - linda
  468. 467 usermod -aG wheel linda
  469. 468 sudo usermod -aG wheel linda
  470. 469 su - linda
  471. 470 sudo journalctl
  472. 471 history
  473. 472 sudo groupadd sales
  474. 473 sudo usermod -aG sales linda
  475. 474 sudo mkdir /data/sales
  476. 475 sudo mkdir -p /data/sales
  477. 476 ls -ld /data/sales
  478. 477 sudo chgrp sales /data/sales
  479. 478 ls -ld /data/sales
  480. 479 sudo chmod g+w /data/sales
  481. 480 ls -ld /data/sales
  482. 481 id linda
  483. 482 su - linda
  484. 483 history
  485. 484 ip a
  486. 485 ip route show
  487. 486 ping nu.nl
  488. 487 cat /etc/resolv.conf
  489. 488 lsblk
  490. 489 sudo mount /dev/sr0 /mnt
  491. 490 ls -l /mnt
  492. 491 sudo umount /mnt
  493. 492 history
  494.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement