Advertisement
sandervanvugt

linfun day2 april21

Apr 8th, 2021
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.45 KB | None | 0 0
  1. [root@localhost data]# history
  2. 1 exit
  3. 2 cd /
  4. 3 cd/
  5. 4 ls
  6. 5 cd /usr
  7. 6 ls
  8. 7 cd /
  9. 8 ls -ld /bin /sbin
  10. 9 cd /usr/local/
  11. 10 ls
  12. 11 cd /var
  13. 12 ls
  14. 13 cd log
  15. 14 ls
  16. 15 ls -lrt
  17. 16 cd /boot
  18. 17 ls
  19. 18 cd
  20. 19 exit
  21. 20 tar -cvf my_archive.tar /home
  22. 21 ls -l my_archive.tar
  23. 22 tar -tvf my_archive.tar
  24. 23 tar -xvf my_archive.tar
  25. 24 ls
  26. 25 rm -fr home
  27. 26 tar -czvf my_archive.tar.gz /home
  28. 27 tar -cjvf my_archive.tar.bz /home
  29. 28 tar -cJvf my_archive.tar.xz /home
  30. 29 ls -l
  31. 30 tar -xvf my_archive.tar -C /tmp/
  32. 31 ls /tmp
  33. 32 echo $PATH
  34. 33 export PATH=$PATH:/usr/local/bin
  35. 34 countdown 12
  36. 35 head /etc/passwd
  37. 36 head -5 /etc/passwd
  38. 37 tail /etc/passwd
  39. 38 head -5 /etc/passwd | tail -1
  40. 39 echo 1 > textfile
  41. 40 echo 2 >> textfile
  42. 41 cat textfile
  43. 42 tac textfile
  44. 43 cd /etc
  45. 44 grep 'lisa' *
  46. 45 grep 'lisa' * 2>/dev/null
  47. 46 ps aux | grep ssh
  48. 47 ps aux | grep -i ssh | grep -v grep
  49. 48 grep root *
  50. 49 grep root * 2>/dev/null
  51. 50 grep -l root * 2>/dev/null
  52. 51 grep -lR root * 2>/dev/null
  53. 52 grep root /etc/passwd
  54. 53 grep -A 5 root /etc/passwd
  55. 54 cd
  56. 55 vim regfile
  57. 56 grep 'bit' regfile
  58. 57 grep 'bi?t' regfile
  59. 58 grep -E 'bi?t' regfile
  60. 59 vim regfile
  61. 60 grep anna regfile
  62. 61 grep '^anna' regfile
  63. 62 grep 'anna$' regfile
  64. 63 grep '^anna$' regfile
  65. 64 vim regfile
  66. 65 grep 'anna\b' regfile
  67. 66 grep 'bi*t' regfile
  68. 67 grep 'b.*t' regfile
  69. 68 grep 'b.+t' regfile
  70. 69 grep -E 'b.+t' regfile
  71. 70 grep -E 'b.?t' regfile
  72. 71 grep -E 'b.\{3\}t' regfile
  73. 72 grep 'b.\{3\}t' regfile
  74. 73 egrep 'b.\{3\}t' regfile
  75. 74 man semanage-fcontext
  76. 75 man grep
  77. 76 cut -f 1 -d : /etc/passwd
  78. 77 cut -f 1 -d : /etc/passwd | head
  79. 78 tail /etc/passwd
  80. 79 cut -f 1 -d : /etc/passwd | head | sort
  81. 80 cut -f 1 -d : /etc/passwd | head | sort | tr [a-z] [A-Z]
  82. 81 cut -f 1 -d : /etc/passwd | head | sort | tr [a-m] [n-z]
  83. 82 cut -f 1 -d : /etc/passwd | head | sort | tr [:lower:] [:upper:]
  84. 83 sed -n 5p /etc/passwd
  85. 84 ls
  86. 85 sed -i s/bit/not/g regfile
  87. 86 cat regfile
  88. 87 sed -i -e '2d' regfile
  89. 88 sed -i -e '13d' regfile
  90. 89 echo hello >afile
  91. 90 echo hello >bfile
  92. 91 echo hello >cfile
  93. 92 echo hello >dfile
  94. 93 cat *file
  95. 94 for i in *file; do sed -i 's/hello/bonjour/g' $i; done
  96. 95 cat cfile
  97. 96 awk -F : '{ print $4 }' /etc/passwd
  98. 97 awk -F : '{ print $3 }' /etc/passwd
  99. 98 awk -F : '/linda/ { print $3 }' /etc/passwd
  100. 99 awk -F : '$3 > 999 { print $1 }' /etc/passwd
  101. 100 countdown 13
  102. 101 sort < /etc/services
  103. 102 grep -R root /proc
  104. 103 grep -R root /etc 2>/dev/null
  105. 104 grep -R root /etc &>/dev/null
  106. 105 ps aux | tee psfile | grep ssh
  107. 106 ls
  108. 107 cat psfile
  109. 108 find / -xtype l
  110. 109 history
  111. 110 history | grep awk
  112. 111 awk -F : '{ print $4 }' /etc/passwd
  113. 112 ssh sander@192.168.50.136
  114. 113 history
  115. 114 history -d 100
  116. 115 ls -a
  117. 116 less .bash_history
  118. 117 history -w
  119. 118 less .bash_history
  120. 119 yum install bash-completion
  121. 120 echo $HISTSIZE
  122. 121 env
  123. 122 LANG=ru_RU.UTF-8
  124. 123 ls --help
  125. 124 echo $PATH
  126. 125 bash
  127. 126 history | grep local
  128. 127 alias
  129. 128 alias help='echo how can i help you'
  130. 129 help
  131. 130 vim /etc/bashrc
  132. 131 su -
  133. 132 sander
  134. 133 echo 'hello
  135. 134 cd /etc/profile.d/
  136. 135 l;s
  137. 136 ls
  138. 137 cd
  139. 138 vim .bash_profile
  140. 139 vim .bash_logout
  141. 140 sleep 1000
  142. 141 bg
  143. 142 sleep 900 &
  144. 143 jobs
  145. 144 fg
  146. 145 while true; do true; done &
  147. 146 jobs
  148. 147 top
  149. 148 ps fax
  150. 149 ps -e -o pid,args --forest
  151. 150 ps -C java -L -o pid,tid,pcpu,state,nlwp,args
  152. 151 ps aux
  153. 152 ps aux --sort pmem | less
  154. 153 dd if=/dev/zero of=/dev/null &
  155. 154 top
  156. 155 cd /sys
  157. 156 ls
  158. 157 cd bus
  159. 158 ls
  160. 159 cd pu
  161. 160 cd cpu
  162. 161 ls
  163. 162 cd devices/
  164. 163 ls
  165. 164 pwd
  166. 165 ls cpu1
  167. 166 cat cpu1/online
  168. 167 echo 0 > cpu1/online
  169. 168 lscpu
  170. 169 top
  171. 170 killall dd
  172. 171 echo 1 > cpu1/online
  173. 172 lscpu
  174. 173 cd
  175. 174 sleep 1000
  176. 175 bg
  177. 176 ps aux | grep sleep
  178. 177 kill 51912
  179. 178 countdown 12
  180. 179 yum search nmap
  181. 180 yum search seinfo
  182. 181 yum provides */seinfo
  183. 182 useradd anna
  184. 183 su - anna
  185. 184 groupadd sales
  186. 185 usermod -aG sales anna
  187. 186 id anna
  188. 187 useradd -G sales lisa
  189. 188 mkdir -p /data/sales
  190. 189 cd /data
  191. 190 ls
  192. 191 ls -l
  193. 192 chgrp sales sales
  194. 193 ls -l
  195. 194 chmod 770 sales
  196. 195 su - lisa
  197. 196 ip a
  198. 197 ssh sander@192.168.50.136
  199. 198 ip a
  200. 199 ifconfig
  201. 200 man ifconfig
  202. 201 ip addr add dev ens33 10.0.0.10/24
  203. 202 ip a
  204. 203 ifconfig
  205. 204 ip route show
  206. 205 ping nu.nl
  207. 206 vim /etc/resolv.conf
  208. 207 nmtui
  209. 208 lsblk
  210. 209 ssh sander@192.168.50.136
  211. 210 yum install -y vsftpd
  212. 211 systemctl status vsftpd
  213. 212 systemctl start vsftpd
  214. 213 systemctl status vsftpd
  215. 214 systemctl enable vsftpd
  216. 215 systemctl status vsftpd
  217. 216 journalctl
  218. 217 journalctl -u sshd
  219. 218 journalctl --dmesg
  220. 219 history
  221. 116 history
  222. 117 alias
  223. 118 man ls
  224. 119 dircolors --helo
  225. 120 dircolors --help
  226. 121 sudo -i
  227. 122 vim countdown
  228. 123 countdown 12
  229. 124 echo $PATH
  230. 125 ./countdown 12
  231. 126 ls -l countdown
  232. 127 chmod +x countdown
  233. 128 ls -l countdown
  234. 129 ./countdown 12
  235. 130 cp countdown /usr/local/bin/
  236. 131 ls -ld /usr/local/bin
  237. 132 sudo cp countdown /usr/local/bin/
  238. 133 countdown 0
  239. 134 history
  240. 135 cat countdown
  241. 136 cd /var
  242. 137 ls -l log/messages
  243. 138 cd cache/
  244. 139 ls
  245. 140 pwd
  246. 141 ls -l ..
  247. 142 ls -l ../var/messages
  248. 143 ls -l ../log/messages
  249. 144 ls -l /var/log/messages
  250. 145 ls ../../usr/local/bin/
  251. 146 pwd
  252. 147 ls /usr/local/bin/
  253. 148 cd
  254. 149 cp countdown bin
  255. 150 ls -l
  256. 151 rm bin
  257. 152 cp countdown bin/
  258. 153 mkdir bin
  259. 154 cp countdown bin/
  260. 155 mkdir /tmp/sander
  261. 156 cp -a ~/.* /tmp/sander/
  262. 157 ls /tmp/sander
  263. 158 ls -a /tmp/sander
  264. 159 cp /etc/* /tmp/sander/
  265. 160 cp -R /etc/* /tmp/sander/
  266. 161 cp -R /etc/* /tmp/sander/ 2> /dev/null
  267. 162 echo hello
  268. 163 echo hello > hellofile
  269. 164 cat hellofile
  270. 165 ls
  271. 166 mv hello ola
  272. 167 ls
  273. 168 mv ola /tmp/
  274. 169 ls
  275. 170 ls -l
  276. 171 cat hellofile
  277. 172 ls -il hellofile
  278. 173 ln hellofile olafile
  279. 174 ls -il hellofile olafile
  280. 175 echo ola >> olafile
  281. 176 ls -il hellofile olafile
  282. 177 cat hellofile
  283. 178 ln -s olafile bonjourfile
  284. 179 ls -il hellofile olafile bonjourfile
  285. 180 cat bonjourfile
  286. 181 echo bonjour >> bonjourfile
  287. 182 ls -il hellofile olafile bonjourfile
  288. 183 rm olafile
  289. 184 ls -il hellofile olafile bonjourfile
  290. 185 cat bonjourfile
  291. 186 ln hellofile olafile
  292. 187 ls -il hellofile olafile bonjourfile
  293. 188 sudo find / -name "hosts"
  294. 189 sudo find / -name "*hosts*"
  295. 190 tail /etc/passwd
  296. 191 su - linda
  297. 192 find / -user linda
  298. 193 sudo find / -user linda 2>/dev/null
  299. 194 sudo find / -size +1G 2>/dev/null
  300. 195 sudo mkdir /root/linda; sudo find / -user linda -exec cp {} /root/linda/ \;
  301. 196 ls -la /root/linda
  302. 197 sudo ls -la /root/linda/
  303. 198 sudo -i
  304. 199 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement