sandervanvugt

bash jan24

Jan 18th, 2024
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.05 KB | None | 0 0
  1. [student@localhost bash-scripting]$ vim 1_cpu-hog
  2. [student@localhost bash-scripting]$ history
  3. 1 sudo dnf install -y git
  4. 2 git clone https://github.com/sandervanvugt/bash-scripting
  5. 3 cd bash-scripting/
  6. 4 ls
  7. 5 vim network
  8. 6 vim script1
  9. 7 script1
  10. 8 echo $PATH
  11. 9 ./script1
  12. 10 ls -l script1
  13. 11 chmod +x script1
  14. 12 ./script1
  15. 13 echo $PATH
  16. 14 env
  17. 15 echo $USER
  18. 16 echo $PATH
  19. 17 env
  20. 18 food=apple
  21. 19 echo $food
  22. 20 echo $food1
  23. 21 echo ${food}1
  24. 22 echo "${food}"1
  25. 23 echo '${food}'1
  26. 24 echo that's right
  27. '
  28. 25 echo that\'s right
  29. 26 echo 'that'\''s right'
  30. 27 ls
  31. 28 echo $?
  32. 29 ls uiguyguyfuy
  33. 30 echo $?
  34. 31 vim script1
  35. 32 ./script1
  36. 33 echo $?
  37. 34 vim script1
  38. 35 echo "what a lovely day; and sunny too"
  39. 36 echo what a lovely day and sunny too
  40. 37 echo what a lovely day; and sunny too
  41. 38 print "|%20s |%20s |%20s |\n" $(ls)
  42. 39 printf "|%20s |%20s |%20s |\n" $(ls)
  43. 40 git pull
  44. 41 vim lab5-grade.sh
  45. 42 echo -e "\033[32m[OK]\033[0m\t\t The deployment salesweb is running"
  46. 43 ./lab5-grade.sh
  47. 44 printf "hello"\n
  48. 45 printf "hello\n"
  49. 46 printf "b%st\n" 0 0a 00 i e
  50. 47 printf "warning\n\a"
  51. 48 ls
  52. 49 echo *
  53. 50 strace -c echo *
  54. 51 strace -c ls
  55. 52 type echo
  56. 53 echo useradd
  57. 54 type useradd
  58. 55 compgen -b
  59. 56 compgen -k
  60. 57 declare -r WHAT=coffee
  61. 58 echo $WHAT
  62. 59 WHAT=no
  63. 60 vim script2
  64. 61 ./countdown 12
  65. 62 echo $SHELL
  66. 63 echo "that\'s right"
  67. 64 echo that\'s right
  68. 65 vim script2
  69. 66 ./script2
  70. 67 ls -l
  71. 68 chmod +s *
  72. 69 chmod -s *
  73. 70 chmod +x *
  74. 71 ./script2
  75. 72 vim script2
  76. 73 source script2
  77. 74 cd -
  78. 75 . script2
  79. 76 pwd
  80. 77 cd -
  81. 78 vim sourceit
  82. 79 chmod +x sourceit
  83. 80 ./sourceit
  84. 81 vim colors
  85. 82 ./sourceit
  86. 83 cat sourceit
  87. 84 cat colors
  88. 85 vim network
  89. 86 ls -l /home
  90. 87 vim script3
  91. 88 ./script3 a b c d
  92. 89 ./script3 a b c d e f g h i j k l
  93. 90 vim script3
  94. 91 ./script3 a b c d e f g h i j k l
  95. 92 vim script3
  96. 93 vim script4
  97. 94 ./script4 a b c d
  98. 95 date +%d-%m-%y
  99. 96 sudo crontab -e
  100. 97 cd /lib
  101. 98 ls
  102. 99 cd /lib64
  103. 100 ls
  104. 101 cd /
  105. 102 sudo find / -name "$(uname -r)" -type d
  106. 103 uname -r
  107. 104 cd -
  108. 105 cd
  109. 106 cd bash-scripting/
  110. 107 vim network
  111. 108 vim myusers
  112. 109 vim createmyusers.sh
  113. 110 chmod +x createmyusers.sh
  114. 111 ./createmyusers.sh
  115. 112 vim createmyusers.sh
  116. 113 cat /etc/os-release
  117. 114 cat createmyusers.sh
  118. 115 mkdir one two
  119. 116 touch one/{one,two,three}
  120. 117 touch two/{two,three,four}
  121. 118 diff <(ls one) <(ls two)
  122. 119 ls
  123. 120 vim setupftp
  124. 121 ls -l hosts
  125. 122 ./setupftp
  126. 123 ls -l hosts
  127. 124 vim kube-setup.sh
  128. 125 history
  129. 126 echo "hello world" | read first second
  130. 127 echo "first second"
  131. 128 echo "$first $second"
  132. 129 read first second <<< "hello world"
  133. 130 echo "first second"
  134. 131 echo "$first $second"
  135. 132 vim script6
  136. 133 ./script6 /usr/bin/blah
  137. 134 vim script6
  138. 135 ./script6 /usr/bin/lah
  139. 136 vim script7
  140. 137 vim countdown
  141. 138 ./countdown
  142. 139 vim countdown
  143. 140 ./countdown
  144. 141 vim countdown
  145. 142 ./countdown
  146. 143 vim countdown
  147. 144 man test
  148. 145 if [ -f /etc/hosts]; then echo file exists; fi
  149. 146 if [ -f /etc/hosts ]; then echo file exists; fi
  150. 147 if [ -x /etc/hosts ]; then echo file exists; fi
  151. 148 [ -f /etc/hosts ] && echo file exists
  152. 149 [ -f /etc/hosts ] || echo file not exists
  153. 150 [ -f /etc/hos ] || echo file not exists
  154. 151 vim network
  155. 152 file exists
  156. 153 touch exists
  157. 154 file exists
  158. 155 type file
  159. 156 vim someargs1
  160. 157 vim someargs2
  161. 158 ./someargs1
  162. 159 ./someargs2
  163. 160 vim someargs1
  164. 161 ./someargs2
  165. 162 ./someargs1
  166. 163 ./someargs1 blah
  167. 164 vim script7
  168. 165 vim script8
  169. 166 tail -1 /etc/passwd
  170. 167 vim script8
  171. 168 ./script8 alex
  172. 169 ./script8 student
  173. 170 ./script8 root
  174. 171 vim script8
  175. 172 ./script8 root
  176. 173 vim script8
  177. 174 bash -x script8 student
  178. 175 vim script8
  179. 176 bash -x script8 student
  180. 177 vim script8
  181. 178 bash -x script8 student
  182. 179 history
  183. 180 bash --debugger script8 student
  184. 181 cat /etc/os-release
  185. 182 history
  186. 183 vim else1
  187. 184 ./else1
  188. 185 echo $?
  189. 186 ./else1 qwe
  190. 187 vim else1
  191. 188 ./else1 qwe
  192. 189 ./else1
  193. 190 vim else1
  194. 191 vim else2
  195. 192 ./else2
  196. 193 ./else2 /etc/hosts
  197. 194 ./else2 /etc/gugikg
  198. 195 vim else2
  199. 196 ./else2
  200. 197 ./else2 /etc/hosts
  201. 198 ./else2 /etc/uygiu
  202. 199 vim else2
  203. 200 ./else2 /etc/uygiu
  204. 201 ./else2 /etc/hosts
  205. 202 vim else2
  206. 203 grep elif *
  207. 204 vim numcheck
  208. 205 ./numcheck
  209. 206 vim for
  210. 207 for i in 1 2 3; do ping -c 1 192.168.29.$i; done
  211. 208 for i in (1..10); do ping -c 1 192.168.29.$i; done
  212. 209 for i in {1..10}; do ping -c 1 192.168.29.$i; done
  213. 210 for i in {1..10}; do echo $i; done
  214. 211 vim case
  215. 212 ./case
  216. 213 vim case
  217. 214 ./case
  218. 215 vim case
  219. 216 ./case
  220. 217 vim case
  221. 218 ./case
  222. 219 vim case
  223. 220 ./case
  224. 221 cat case
  225. 222 vim network
  226. 223 vim script10
  227. 224 ./script10 5
  228. 225 vim script11
  229. 226 ./script11
  230. 227 vim script11
  231. 228 ./script11
  232. 229 ./script11 1
  233. 230 vim script11
  234. 231 ./script11 1
  235. 232 bash -x script11 1
  236. 233 vim script11
  237. 234 bash -x script11 1
  238. 235 vim script11
  239. 236 ls
  240. 237 vim 1_cpu-hog
  241. 238 ps -eo pcpu,pid -o comm=
  242. 239 ps -eo pcpu,pid -o comm= | less
  243. 240 while true; do true; done &
  244. 241 vim 1_cpu-hog
  245. 242 ps -eo pcpu,pid -o comm= | sort -k1 -n -r | head -1
  246. 243 vim 1_cpu-hog
  247. 244 ./1_cpu-hog
  248. 245 sudo journalctl
  249. 246 vim 1_cpu-hog
  250. 247 ./1_cpu-hog
  251. 248 vim 1_cpu-hog
  252. 249 ./1_cpu-hog
  253. 250 vim 1_cpu-hog
  254. 251 history
  255.  
Advertisement
Add Comment
Please, Sign In to add comment