sandervanvugt

LinuxFundamentals day2 aug20

Aug 5th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.02 KB | None | 0 0
  1. 1 pwd
  2. 2 whoami
  3. 3 id student
  4. 4 usermod -aG wheel student
  5. 5 id student
  6. 6 exit
  7. 7 id student
  8. 8 reboot
  9. 9 echo hello >> /etc/hosts
  10. 10 ls -li /etc/hosts /tmp/myhosts
  11. 11 ln -s /tmp/myhosts mysymlink
  12. 12 ls -li /etc/hosts /tmp/myhosts mysymlink
  13. 13 cat mysymlink
  14. 14 rm /tmp/myhosts
  15. 15 cat mysymlink
  16. 16 ls -l
  17. 17 ln /etc/hosts /tmp/myhosts
  18. 18 exit
  19. 19 history
  20. 20 ln /etc/motd mymessage
  21. 21 ls -il /etc/motd mymessage
  22. 22 echo welcome to this computer
  23. 23 echo welcome to this computer > mymessage
  24. 24 ls -il /etc/motd mymessage
  25. 25 ln -s /etc/motd mewothermessage
  26. 26 ls -il /etc/motd mymessage mewothermessage
  27. 27 rm -f /etc/motd
  28. 28 ls -il /etc/motd mymessage mewothermessage
  29. 29 cat mewothermessage
  30. 30 cat mymessage
  31. 31 ln mymessage /etc/motd
  32. 32 ls -il /etc/motd mymessage mewothermessage
  33. 33 df -h
  34. 34 ln /boot/vmlinuz-4.18.0-193.el8.x86_64 mykernel
  35. 35 ln -s /boot/vmlinuz-4.18.0-193.el8.x86_64 mykernel
  36. 36 ln /etc myetc
  37. 37 ln -s /etc myetc
  38. 38 ls
  39. 39 ls -l
  40. 40 find / -name "hosts"
  41. 41 find / -name "*hosts*"
  42. 42 find / -user student
  43. 43 cat /etc/passwd
  44. 44 find / -user bob
  45. 45 find / -size +200M
  46. 46 find / -size +200M 2>/dev/null
  47. 47 mkdir /root/bob; find / -user bob -exec cp {} /root/bob/ \;
  48. 48 echo $PATH
  49. 49 echo \$PATH
  50. 50 echo '$PATH'
  51. 51 du -hf /home
  52. 52 du -hs /home
  53. 53 du -s /home
  54. 54 tar -cvf my_home.tar /home
  55. 55 ls -l
  56. 56 du -hs /home
  57. 57 du -s /home
  58. 58 tar -czvf my_home.tgz /home
  59. 59 ls -l my*
  60. 60 tar -cJvf my_home.txz /home
  61. 61 ls -l my*
  62. 62 tar -tvf my_home.txz
  63. 63 tar -xvf my_home.txz
  64. 64 ls
  65. 65 yum install -y tree
  66. 66 tree home/
  67. 67 tar -xvf my_home.txz -C /tmp
  68. 68 ls -l /tmp/home/
  69. 69 history
  70. 70 man find
  71. 71 history
  72. 72 ls
  73. 73 gzip mymessage
  74. 74 gzip initial-setup-ks.cfg
  75. 75 ls -l
  76. 76 gunzip initial-setup-ks.cfg.gz
  77. 77 ls -l
  78. 78 file my_home.tgz
  79. 79 vimtutor
  80. 80 vim myfile
  81. 81 history
  82. 82 /usr/local/bin/countdown 12
  83. 83 more /var/log/messages
  84. 84 head /etc/passwd
  85. 85 head -5 /etc/passwd
  86. 86 tail /etc/passwd
  87. 87 tail -5 /etc/passwd
  88. 88 head -19 /etc/passwd | tail -1
  89. 89 cat /etc/hosts
  90. 90 tac /etc/hosts
  91. 91 man type
  92. 92 type ls
  93. 93 type passwd
  94. 94 grep bob /etc/*
  95. 95 grep bob /etc/* 2>/dev/null
  96. 96 grep -i bob /etc/* 2>/dev/null
  97. 97 ps aux | grep dbus
  98. 98 ps aux | grep dbus | grep -v grep
  99. 99 useradd linda
  100. 100 grep -R linda /etc/*
  101. 101 grep -R root /etc/*
  102. 102 grep -A 5 Allow /etc/ssh/sshd_config
  103. 103 grep -B 5 Allow /etc/ssh/sshd_config
  104. 104 vim users
  105. 105 grep linda users
  106. 106 grep 'linda' users
  107. 107 grep '^linda' users
  108. 108 grep 'linda$' users
  109. 109 grep '^linda$' users
  110. 110 vim /etc/passwd
  111. 111 man semanage-fcontext
  112. 112 echo hello
  113. 113 tail /etc/passwd
  114. 114 cut -f 1 -d : /etc/passwd
  115. 115 cut -f 1 -d : /etc/passwd | sort
  116. 116 echo hello
  117. 117 echo hello | tr [:lower:] [:upper:]
  118. 118 sed -n 5p /etc/passwd
  119. 119 cat users
  120. 120 sed -i s/linda/lisa/g users
  121. 121 cat user
  122. 122 cat users
  123. 123 sed -i -e '2d' users
  124. 124 cat users
  125. 125 echo old a.conf
  126. 126 echo old b.conf
  127. 127 echo old c.conf
  128. 128 echo old> a.conf
  129. 129 echo old>\ c.conf
  130. 130 echo old >b.conf
  131. 131 ls
  132. 132 mv ' c.conf' c.conf
  133. 133 cat a.conf b.conf c.conf
  134. 134 for i in *conf; do sed -i 's/old/new/g' $i; done
  135. 135 cat a.conf b.conf c.conf
  136. 136 awk -F : '{ print $4 }' /etc/passwd
  137. 137 awk -F : '/linda/ { print $4 }' /etc/passwd
  138. 138 pinfo sed
  139. 139 sort </etc/services
  140. 140 sort /etc/services
  141. 141 ls > outfile
  142. 142 cat outfile
  143. 143 w
  144. 144 w > outfile
  145. 145 cat outfile
  146. 146 ls >> outfile
  147. 147 grep -R root /proc
  148. 148 grep -R root /proc 2>/dev/null
  149. 149 grep -R root /proc 2>errorfile
  150. 150 cat errorfile
  151. 151 grep -R root /etc &> outputfile
  152. 152 less outputfile
  153. 153 ps aux | grep ssh
  154. 154 ps aux | tee psfile | grep ssh
  155. 155 cat psfile
  156. 156 history
  157. 157 w
  158. 158 ps aux | tee psfile | grep ssh
  159. 159 history
  160. 160 history --help
  161. 161 history -d 159
  162. 162 history
  163. 163 history -w
  164. 164 env
  165. 165 env | grep HIST
  166. 166 touch 'wlkrhkgwhkuhgiuguewrgubgwukrgbkugwukrgbkugwukergbkugwkebgwlibhe ilrhwbilhblw'
  167. 167 ls
  168. 168 rm wlkrhkgwhkuhgiuguewrgubgwukrgbkugwukrgbkugwukergbkugwkebgwlibhe\ ilrhwbilhblw
  169. 169 echo $HISTFILESIZE
  170. 170 yum install bash-completion
  171. 171 nmcli connection show ens33
  172. 172 find / -name countdown
  173. 173 echo $PATH
  174. 174 ln /usr/local/bin/countdown /lusr/local/sbin/countdown
  175. 175 ln /usr/local/bin/countdown /usr/local/sbin/countdown
  176. 176 countdown 12
  177. 177 env
  178. 178 alias
  179. 179 alias reboot='echo why are you doing that'
  180. 180 reboot
  181. 181 dir
  182. 182 type dir
  183. 183 alias dir=ls
  184. 184 dir
  185. 185 vim /etc/profile
  186. 186 clear
  187. 187 less
  188. 188 less /etc/passwd
  189. 189 cd /etc/profile.d/
  190. 190 ls
  191. 191 ls -l /etc/profile
  192. 192 cd
  193. 193 ls -a
  194. 194 cat .bash_profile
  195. 195 cat .bash_logout
  196. 196 vim /etc/bashrc
  197. 197 vim .bashrc
  198. 198 alias
  199. 199 unalias reboot
  200. 200 alias
  201. 201 sleep 1000
  202. 202 sleep 1000 &
  203. 203 jobs
  204. 204 fg
  205. 205 bg
  206. 206 jobs
  207. 207 fg
  208. 208 dd if=/dev/zero of=/dev/null &
  209. 209 top
  210. 210 top -u student
  211. 211 man signals
  212. 212 man signal
  213. 213 man 7 signal
  214. 214 top
  215. 215 cd /var/log
  216. 216 cd /usr/share/doc/blktrace/
  217. 217 cd -
  218. 218 cd /var/tmp
  219. 219 mkdir '-'
  220. 220 cd '-'
  221. 221 pwd
  222. 222 ls
  223. 223 ps aux | less
  224. 224 ps -ef
  225. 225 ps fax
  226. 226 ps -e -o pid,args --forest
  227. 227 ps aux --sort pmem | less
  228. 228 top
  229. 229 dd if=/dev/zero of=/dev/null &
  230. 230 top
  231. 231 ps aux
  232. 232 killall dd
  233. 233 top
  234. 234 cd
  235. 235 countdown 12
  236. 236 useradd lisa
  237. 237 id lisa
  238. 238 su - lisa
  239. 239 groupadd sales
  240. 240 usermod -aG sales lisa
  241. 241 id lisa
  242. 242 usermod -aG wheel lisa
  243. 243 passwd lisa
  244. 244 mkdir -p /data/sales
  245. 245 cd /data
  246. 246 ls -l
  247. 247 chgrp sales sales
  248. 248 ls -l
  249. 249 chown lisa sales
  250. 250 ls -l
  251. 251 chmod 750 sales
  252. 252 ls -l
  253. 253 chmod +x /home/student/countdown
  254. 254 su - lisa
  255. 255 cd
  256. 256 ping nu.nl
  257. 257 ip addr show
  258. 258 ifconfig
  259. 259 man ifconfig
  260. 260 ip route show
  261. 261 ip route del default via 192.168.4.2
  262. 262 ping nu.nl
  263. 263 ip route add default via 192.168.4.2
  264. 264 ping nu.nl
  265. 265 cat /etc/resolv.conf
  266. 266 lsblk
  267. 267 mount /dev/sdb1 /mnt
  268. 268 yum install epel-release
  269. 269 yum search exfat
  270. 270 yum provides */exfat
  271. 271 mount -t vfat /dev/sdb1 /mnt
  272. 272 history
  273. 273 systemctl status sshd.service
  274. 274 yum install -y httpd
  275. 275 systemctl status httpd
  276. 276 systemctl start httpd
  277. 277 systemctl status httpd
  278. 278 systemctl enable httpd
  279. 279 systemctl status httpd
  280. 280 history
  281.  
Add Comment
Please, Sign In to add comment