Advertisement
sandervanvugt

bash4h jun21

Jun 15th, 2021
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 KB | None | 0 0
  1. [student@localhost ~]$ history
  2. 1 env
  3. 2 echo $PATH
  4. 3 key=value
  5. 4 echo $key
  6. 5 echo ${key}1
  7. 6 echo $key1
  8. 7 KEY=another
  9. 8 echo $KEY
  10. 9 echo $key
  11. 10 env
  12. 11 ls
  13. 12 echo $?
  14. 13 ls uhkuh
  15. 14 echo $?
  16. 15 sudo yum install git vim bash-completion curl wget -y
  17. 16 git clone https://github.com/sandervanvugt/bash-scripting
  18. 17 cd bash-scripting/
  19. 18 ls
  20. 19 vim hello-world
  21. 20 history
  22. 21 ls
  23. 22 echo $PATH
  24. 23 hello-world
  25. 24 ./hello-world
  26. 25 ls -l hello-world
  27. 26 chmod +x hello-world
  28. 27 ./hello-world
  29. 28 history
  30. 29 bash hello-world
  31. 30 history
  32. 31 sudo cp hello-world /usr/local/bin
  33. 32 hello-world
  34. 33 ehco the current $SHELL is $SHELL
  35. 34 echo the current $SHELL is $SHELL
  36. 35 echo the current '$SHELL' is $SHELL
  37. 36 echo the current \$SHELL is $SHELL
  38. 37 whoami
  39. 38 echo `whoami`
  40. 39 echo $(whoami)
  41. 40 declare -r BLAH=yes
  42. 41 echo $BLAH
  43. 42 BLAH=no
  44. 43 color=red
  45. 44 echo $color
  46. 45 echo "$color"
  47. 46 echo ${color}
  48. 47 vim readi
  49. 48 ls
  50. 49 vim readtit
  51. 50 chmod +x readtit
  52. 51 ./readtit
  53. 52 cat readtit
  54. 53 pwd
  55. 54 ./readtit
  56. 55 . readtit
  57. 56 pwd
  58. 57 source readtit
  59. 58 cd -
  60. 59 source readtit
  61. 60 cd -
  62. 61 vim mycolor
  63. 62 chmod +x mycolor
  64. 63 ./mycolor
  65. 64 sudo -i
  66. 65 ./mycolor
  67. 66 cat mycolor
  68. 67 cat /etc/sysconfig/colors
  69. 68 sudo yum install network-scripts
  70. 69 vim /etc/init.d/network
  71. 70 ls
  72. 71 ./countdown 12
  73. 72 ls
  74. 73 chmod +x script*
  75. 74 vim script3
  76. 75 ./script3 a b c d e f g h i j k l m
  77. 76 cat script3
  78. 77 vim script4
  79. 78 ./script4 a b c d e
  80. 79 date +%d-%m-%y
  81. 80 TODAY=$(date +%d-%m-%Y)
  82. 81 echo $TODAY
  83. 82 cd /lib
  84. 83 ls
  85. 84 cd /lib64
  86. 85 ls
  87. 86 cd /usr/lib
  88. 87 ls
  89. 88 cd /usr/lib64
  90. 89 ls
  91. 90 cd
  92. 91 uname -r
  93. 92 find / -type d -n $(uname -r)
  94. 93 find / -type d -name $(uname -r)
  95. 94 cd /usr/lib/modules
  96. 95 ls
  97. 96 cd `uname -r`
  98. 97 cd -
  99. 98 cd $(uname -r)
  100. 99 cd
  101. 100 cd bash-scripting/
  102. 101 ls
  103. 102 vim setupftp
  104. 103 ./setupftp
  105. 104 ls
  106. 105 ls -l hosts
  107. 106 vim kube-setup.sh
  108. 107 grep '<<' *
  109. 108 vim setupftp
  110. 109 vim script10
  111. 110 echo $((1+1))
  112. 111 echo $(( 1+1 ))
  113. 112 vim script10
  114. 113 ./script10 5
  115. 114 cat psubst1
  116. 115 vim psubst1
  117. 116 ./psubst1
  118. 117 vim psubst2
  119. 118 ./psubst2
  120. 119 ./psubst3
  121. 120 vim psubst3
  122. 121 cat psubst4
  123. 122 ./psubst4
  124. 123 ./psubst4 hello
  125. 124 vim misvar
  126. 125 chmod +xmisvar
  127. 126 chmod +x misvar
  128. 127 ./misvar
  129. 128 vim misvar
  130. 129 ./misvar
  131. 130 echo $?
  132. 131 vim psubst4
  133. 132 ./psubst4
  134. 133 vim psubst4
  135. 134 ./script10 12
  136. 135 vim script10
  137. 136 ./script10 12
  138. 137 vim script6
  139. 138 ./script6 /usr/bin/blah
  140. 139 vim script6
  141. 140 ./script6
  142. 141 ./script6 /usr/bin/blah
  143. 142 vim pm
  144. 143 ./pm
  145. 144 vim script10
  146. 145 vim script7
  147. 146 man here
  148. 147 ./pm
  149. 148 vim pm
  150. 149 ./pm
  151. 150 vim patternglob
  152. 151 ./patternglob
  153. 152 touch zblah.txt
  154. 153 ./patternglob
  155. 154 vim removepattern
  156. 155 ./removepattern
  157. 156 ls
  158. 157 vim removepattern
  159. 158 vim countdown
  160. 159 ./countdown 1
  161. 160 echo "12/5" | bc
  162. 161 echo "12/5" | bc -l
  163. 162 man bc
  164. 163 man test
  165. 164 [ -f /etc/hosts ] && echo exists
  166. 165 [ -f /etc/hosts ] || echo exists
  167. 166 if [ -f /etc/hosts ]; then echo exists; fi
  168. 167 if test -f /etc/hosts; then echo exists; fi
  169. 168 [ -d /etc/hosts ] || [ -f /etc/hosts ] && echo exists
  170. 169 [ -d /etc/hosts ] || ( [ -f /etc/hosts ] && echo exists )
  171. 170 if useradd bob; then cp /etc/hosts /home/bob; fi
  172. 171 true
  173. 172 echo $?
  174. 173 [ -d /etc/hosts ] && echo yes || echo no
  175. 174 [ -d /etc/hosts ] || echo not && echo yes
  176. 175 vim /etc/init.d/network
  177. 176 ./countdown 12
  178. 177 ls
  179. 178 chmod +x else*
  180. 179 vim else1
  181. 180 vim else2
  182. 181 ./else2 /etc
  183. 182 ./else2 /etc/hosts
  184. 183 vim numcheck
  185. 184 ./numcheck
  186. 185 vim for
  187. 186 vim case
  188. 187 echo hello | tr [:lower:] [:upper:]
  189. 188 echo hello | tr [a-z] [A-Z]
  190. 189 echo hello | tr [a-z] [z-a]
  191. 190 echo hello | tr [a-m] [n-z]
  192. 191 vim case
  193. 192 ./case
  194. 193 vim case
  195. 194 ./case
  196. 195 vim case
  197. 196 vim /etc/init.d/network
  198. 197 vim script10
  199. 198 vim case
  200. 199 vim backout
  201. 200 df /etc
  202. 201 vim backout
  203. 202 ./backout
  204. 203 sudo ./backout
  205. 204 vim backout
  206. 205 sudo ./backout
  207. 206 ls /etc.backup/
  208. 207 vim convert
  209. 208 mkdir mydir
  210. 209 cd mydir/
  211. 210 touch abc aBc ABC
  212. 211 ../convert
  213. 212 ls
  214. 213 cd ..
  215. 214 vim convert
  216. 215 ls
  217. 216 vim reboot-test.sh
  218. 217 sudo reboot-test.sh
  219. 218 sudo ./reboot-test.sh
  220. 219 history
  221.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement