sandervanvugt

linfun day2 dec20

Dec 17th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.58 KB | None | 0 0
  1. 1 echo hello >> myhosts
  2. 2 ls -il /etc/hosts myhosts
  3. 3 pwd
  4. 4 cd /home/student/
  5. 5 echo hello >> myhosts
  6. 6 ls -il /etc/hosts myhosts
  7. 7 cd mydir/
  8. 8 ls
  9. 9 echo hello >> myhosts
  10. 10 ls -il /etc/hosts myhosts
  11. 11 ln /etc myetc
  12. 12 ln -s /etc myetc
  13. 13 ln -s myhosts symhosts
  14. 14 ls -il /etc/hosts myhosts symhosts
  15. 15 rm myhosts
  16. 16 ls -il /etc/hosts myhosts symhosts
  17. 17 cat symhosts
  18. 18 ln /etc/hosts myhosts
  19. 19 ls -il /etc/hosts myhosts symhosts
  20. 20 cd /
  21. 21 ls -l
  22. 22 find / -name hosts
  23. 23 find / -name "*hosts*"
  24. 24 useradd -m linda
  25. 25 find / -user "linda"
  26. 26 find / -user "linda" 2>/dev/null
  27. 27 find / -size +1G
  28. 28 find / -user linda -exec ls -al {} \;
  29. 29 mkdir /root/linda/ ; find / -user linda -exec cp {} /root/linda/ \;
  30. 30 ls -al /root/linda
  31. 31 cd
  32. 32 tar cvf backup.tar /etc /home
  33. 33 tar cvf backup.tar /etc /tmp
  34. 34 ls -l backup.tar
  35. 35 tar czvf backup.tgz /etc /tmp
  36. 36 ls -l back*
  37. 37 tar cjvf backup.tar.bz2 /etc /tmp
  38. 38 ls -l back*
  39. 39 mv backup.tar backup
  40. 40 file backup
  41. 41 tar tvf backup
  42. 42 ls
  43. 43 tar xvf backup.tgz
  44. 44 ls
  45. 45 tar xvf backup.tgz -C /tmp
  46. 46 ls /tmp
  47. 47 rm -rf /tmp/tmp /tmp/etc
  48. 48 history | grep ssh
  49. 49 ip a
  50. 50 ssh 192.168.4.42
  51. 51 man rsync
  52. 52 rsync 192.168.4.42:/etc .
  53. 53 ls
  54. 54 rm -rf etc tmp
  55. 55 rsync -r 192.168.4.42:/etc .
  56. 56 ls
  57. 57 ls etc
  58. 58 cat etc/centos-release
  59. 59 ssh 192.168.4.42
  60. 60 rsync -r 192.168.4.42:/etc .
  61. 61 ssh 192.168.4.42
  62. 62 ssh-keygen
  63. 63 ssh-copy-id 192.168.4.42
  64. 64 ssh 192.168.4.42
  65. 65 rsync -r 192.168.4.42:/etc .
  66. 66 history
  67. 67 nano myfile
  68. 68 vi myfile
  69. 69 apt install vim
  70. 70 ssh 192.168.4.42
  71. 71 tail /etc/passwd
  72. 72 tail /etc/passwd -5
  73. 73 tail -5 /etc/passwd
  74. 74 tail -5 /etc/passwd | head -1
  75. 75 vim
  76. 76 vim myfile
  77. 77 cat myfile
  78. 78 tac myfile
  79. 79 ps aux
  80. 80 ps aux | grep ssh
  81. 81 grep linda /etc/*
  82. 82 grep linda /etc/* 2>/dev/null
  83. 83 grep -i linda /etc/* 2>/dev/null
  84. 84 ps aux | grep ssh
  85. 85 ps aux | grep ssh | grep -v grep
  86. 86 apt install apache2
  87. 87 find / -name "httpd.conf"
  88. 88 find / -name "apache.conf"
  89. 89 grep root /etc/ssh/sshd_config
  90. 90 grep -A 2 root /etc/ssh/sshd_config
  91. 91 grep -B 2 root /etc/ssh/sshd_config
  92. 92 grep -B 3 -A 3 root /etc/ssh/sshd_config
  93. 93 grep root /etc/* 2>/dev/null
  94. 94 grep -R root /etc/* 2>/dev/null
  95. 95 vim users
  96. 96 grep '^a' users
  97. 97 grep 'anna$' users
  98. 98 grep '^anna$' users
  99. 99 vim users
  100. 100 grep '^lea\b' users
  101. 101 grep '^lea ' users
  102. 102 grep 'bo*t' users
  103. 103 grep 'bo+t' users
  104. 104 grep -E 'bo+t' users
  105. 105 egrep 'bo+t' users
  106. 106 egrep 'bo?t' users
  107. 107 egrep 'bo\{3\}t' users
  108. 108 egrep 'bo\{2\}t' users
  109. 109 grep 'bo\{2\}t' users
  110. 110 egrep 'bo.t' users
  111. 111 alias s='ssh 192.168.4.42'
  112. 112 s
  113. 113 ls -a
  114. 114 vim .profile
  115. 115 vim .bashrc
  116. 116 ls -l $(which vi) $(which vim)
  117. 117 s
  118. 118 vim /etc/profile
  119. 119 vim /etc/bashrc
  120. 120 tail /etc/passwd
  121. 121 tail /etc/passwd | cut -d : -f 1
  122. 122 tail /etc/passwd | awk -F : '{ print $1 }'
  123. 123 tail /etc/passwd | awk -F : '{ print $1 }' | sort
  124. 124 tail /etc/passwd | awk -F : '{ print $1 }' | sort | tr [:lower:] [:upper:]
  125. 125 tail /etc/passwd | awk -F : '{ print $1 }' | sort | tr a-z A-Z
  126. 126 sed -n p5 /etc/passwd
  127. 127 sed -n 5p /etc/passwd
  128. 128 sed -i s/lea/bea/ users
  129. 129 grep bea users
  130. 130 vim users
  131. 131 sed -i s/bea/lea/ users
  132. 132 grep lea users
  133. 133 sed -i s/bea/lea/g users
  134. 134 s
  135. 135 exit
  136. 136 history
  137. 137 cat .bash_history
  138. 138 history
  139. 139 history
  140. 140 history -d 139
  141. 141 history
  142. 142 history | grep egrep
  143. 143 ip addrr
  144. 144 echo $PATH
  145. 145 export PATH=$PATH:/usr/local/bin
  146. 146 echo $PATH
  147. 147 env
  148. 148 echo $LANG
  149. 149 export LANG=fr_FR.UTF-8
  150. 150 ls --help
  151. 151 sleep 3600
  152. 152 sleep 3600 &
  153. 153 sleep 5000
  154. 154 bg
  155. 155 jobs
  156. 156 ps aux
  157. 157 jobs
  158. 158 fg
  159. 159 ps aux
  160. 160 kill 16817
  161. 161 ps aux | grep ssh
  162. 162 systemctl status sshd
  163. 163 systemctl stop sshd
  164. 164 systemctl status sshd
  165. 165 systemctl start sshd
  166. 166 dd if=/dev/zero of=/dev/null &
  167. 167 top
  168. 168 killall dd
  169. 169 top
  170. 170 top -u student
  171. 171 ps aux | less
  172. 172 ps -ef
  173. 173 ps -ef | less
  174. 174 top
  175. 175 apt install powertop
  176. 176 powertop
  177. 177 s
  178. 178 lscpu
  179. 179 cd /sys/
  180. 180 ls
  181. 181 cd bus/
  182. 182 ls
  183. 183 cd cpu/
  184. 184 ls
  185. 185 cd devices/
  186. 186 tree
  187. 187 apt install tree
  188. 188 tree
  189. 189 ls cpu0 cpu1
  190. 190 cat cpu1/online
  191. 191 echo 0 > cpu1/online
  192. 192 lscpu
  193. 193 cd
  194. 194 dd if=/dev/zero of=/dev/null &
  195. 195 top
  196. 196 killall dd
  197. 197 s
  198. 198 useradd -m linda
  199. 199 id linda
  200. 200 groupadd sales
  201. 201 usermod -aG sales linda
  202. 202 id linda
  203. 203 mkdir -p /data/sales
  204. 204 cd /data
  205. 205 ls -l
  206. 206 chgrp sales sales
  207. 207 ls -l
  208. 208 chmod 770 sales
  209. 209 ls -l
  210. 210 su - linda
  211. 211 cd
  212. 212 cd /home/linda
  213. 213 touch afile
  214. 214 su - linda
  215. 215 ip a
  216. 216 ip route show
  217. 217 ifconfig
  218. 218 s
  219. 219 lsblk
  220. 220 umount /media/student/D4E3-88A0
  221. 221 mount /dev/sdb1 /mnt
  222. 222 mount
  223. 223 cd /mnt
  224. 224 ls
  225. 225 touch gggg
  226. 226 mount
  227. 227 cd
  228. 228 cd /mnt
  229. 229 umount /dev/sdb1
  230. 230 cd
  231. 231 umount /dev/sdb1
  232. 232 history
  233.  
Advertisement
Add Comment
Please, Sign In to add comment