sandervanvugt

linfun day2 april21

Apr 8th, 2021
145
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. 113 history
  114. 114 history -d 100
  115. 115 ls -a
  116. 116 less .bash_history
  117. 117 history -w
  118. 118 less .bash_history
  119. 119 yum install bash-completion
  120. 120 echo $HISTSIZE
  121. 121 env
  122. 122 LANG=ru_RU.UTF-8
  123. 123 ls --help
  124. 124 echo $PATH
  125. 125 bash
  126. 126 history | grep local
  127. 127 alias
  128. 128 alias help='echo how can i help you'
  129. 129 help
  130. 130 vim /etc/bashrc
  131. 131 su -
  132. 132 sander
  133. 133 echo 'hello
  134. 134 cd /etc/profile.d/
  135. 135 l;s
  136. 136 ls
  137. 137 cd
  138. 138 vim .bash_profile
  139. 139 vim .bash_logout
  140. 140 sleep 1000
  141. 141 bg
  142. 142 sleep 900 &
  143. 143 jobs
  144. 144 fg
  145. 145 while true; do true; done &
  146. 146 jobs
  147. 147 top
  148. 148 ps fax
  149. 149 ps -e -o pid,args --forest
  150. 150 ps -C java -L -o pid,tid,pcpu,state,nlwp,args
  151. 151 ps aux
  152. 152 ps aux --sort pmem | less
  153. 153 dd if=/dev/zero of=/dev/null &
  154. 154 top
  155. 155 cd /sys
  156. 156 ls
  157. 157 cd bus
  158. 158 ls
  159. 159 cd pu
  160. 160 cd cpu
  161. 161 ls
  162. 162 cd devices/
  163. 163 ls
  164. 164 pwd
  165. 165 ls cpu1
  166. 166 cat cpu1/online
  167. 167 echo 0 > cpu1/online
  168. 168 lscpu
  169. 169 top
  170. 170 killall dd
  171. 171 echo 1 > cpu1/online
  172. 172 lscpu
  173. 173 cd
  174. 174 sleep 1000
  175. 175 bg
  176. 176 ps aux | grep sleep
  177. 177 kill 51912
  178. 178 countdown 12
  179. 179 yum search nmap
  180. 180 yum search seinfo
  181. 181 yum provides */seinfo
  182. 182 useradd anna
  183. 183 su - anna
  184. 184 groupadd sales
  185. 185 usermod -aG sales anna
  186. 186 id anna
  187. 187 useradd -G sales lisa
  188. 188 mkdir -p /data/sales
  189. 189 cd /data
  190. 190 ls
  191. 191 ls -l
  192. 192 chgrp sales sales
  193. 193 ls -l
  194. 194 chmod 770 sales
  195. 195 su - lisa
  196. 196 ip a
  197. 198 ip a
  198. 199 ifconfig
  199. 200 man ifconfig
  200. 201 ip addr add dev ens33 10.0.0.10/24
  201. 202 ip a
  202. 203 ifconfig
  203. 204 ip route show
  204. 205 ping nu.nl
  205. 206 vim /etc/resolv.conf
  206. 207 nmtui
  207. 208 lsblk
  208. 210 yum install -y vsftpd
  209. 211 systemctl status vsftpd
  210. 212 systemctl start vsftpd
  211. 213 systemctl status vsftpd
  212. 214 systemctl enable vsftpd
  213. 215 systemctl status vsftpd
  214. 216 journalctl
  215. 217 journalctl -u sshd
  216. 218 journalctl --dmesg
  217. 219 history
  218. 116 history
  219. 117 alias
  220. 118 man ls
  221. 119 dircolors --helo
  222. 120 dircolors --help
  223. 121 sudo -i
  224. 122 vim countdown
  225. 123 countdown 12
  226. 124 echo $PATH
  227. 125 ./countdown 12
  228. 126 ls -l countdown
  229. 127 chmod +x countdown
  230. 128 ls -l countdown
  231. 129 ./countdown 12
  232. 130 cp countdown /usr/local/bin/
  233. 131 ls -ld /usr/local/bin
  234. 132 sudo cp countdown /usr/local/bin/
  235. 133 countdown 0
  236. 134 history
  237. 135 cat countdown
  238. 136 cd /var
  239. 137 ls -l log/messages
  240. 138 cd cache/
  241. 139 ls
  242. 140 pwd
  243. 141 ls -l ..
  244. 142 ls -l ../var/messages
  245. 143 ls -l ../log/messages
  246. 144 ls -l /var/log/messages
  247. 145 ls ../../usr/local/bin/
  248. 146 pwd
  249. 147 ls /usr/local/bin/
  250. 148 cd
  251. 149 cp countdown bin
  252. 150 ls -l
  253. 151 rm bin
  254. 152 cp countdown bin/
  255. 153 mkdir bin
  256. 154 cp countdown bin/
  257. 155 mkdir /tmp/sander
  258. 156 cp -a ~/.* /tmp/sander/
  259. 157 ls /tmp/sander
  260. 158 ls -a /tmp/sander
  261. 159 cp /etc/* /tmp/sander/
  262. 160 cp -R /etc/* /tmp/sander/
  263. 161 cp -R /etc/* /tmp/sander/ 2> /dev/null
  264. 162 echo hello
  265. 163 echo hello > hellofile
  266. 164 cat hellofile
  267. 165 ls
  268. 166 mv hello ola
  269. 167 ls
  270. 168 mv ola /tmp/
  271. 169 ls
  272. 170 ls -l
  273. 171 cat hellofile
  274. 172 ls -il hellofile
  275. 173 ln hellofile olafile
  276. 174 ls -il hellofile olafile
  277. 175 echo ola >> olafile
  278. 176 ls -il hellofile olafile
  279. 177 cat hellofile
  280. 178 ln -s olafile bonjourfile
  281. 179 ls -il hellofile olafile bonjourfile
  282. 180 cat bonjourfile
  283. 181 echo bonjour >> bonjourfile
  284. 182 ls -il hellofile olafile bonjourfile
  285. 183 rm olafile
  286. 184 ls -il hellofile olafile bonjourfile
  287. 185 cat bonjourfile
  288. 186 ln hellofile olafile
  289. 187 ls -il hellofile olafile bonjourfile
  290. 188 sudo find / -name "hosts"
  291. 189 sudo find / -name "*hosts*"
  292. 190 tail /etc/passwd
  293. 191 su - linda
  294. 192 find / -user linda
  295. 193 sudo find / -user linda 2>/dev/null
  296. 194 sudo find / -size +1G 2>/dev/null
  297. 195 sudo mkdir /root/linda; sudo find / -user linda -exec cp {} /root/linda/ \;
  298. 196 ls -la /root/linda
  299. 197 sudo ls -la /root/linda/
  300. 198 sudo -i
  301. 199 history
Advertisement
Add Comment
Please, Sign In to add comment