Advertisement
sandervanvugt

bash scripting jan23

Jan 31st, 2023
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.30 KB | None | 0 0
  1. [root@localhost bash-scripting]# history
  2. 1 history -w
  3. 2 history
  4. 3 cat /etc/os-release
  5. 4 git clone https://github.com/sandervanvugt/bash-scripting
  6. 5 echo $PATH
  7. 6 env
  8. 7 echo $USER
  9. 8 key=value
  10. 9 echo $key
  11. 10 bash
  12. 11 export key=value
  13. 12 bash
  14. 13 vim /etc/profile
  15. 14 vim /etc/bashrc
  16. 15 echo $key
  17. 16 echo $key1
  18. 17 echo ${key}1
  19. 18 echo $?
  20. 19 ls oihoiuhiu
  21. 20 echo $?
  22. 21 vim countdown
  23. 22 countdown
  24. 23 ./countdown
  25. 24 ls -l countdown
  26. 25 chmod +x countdown
  27. 26 ./countdown 1
  28. 27 vim countdown
  29. 28 nano countdown
  30. 29 history
  31. 30 cat countdown
  32. 31 vim countdown
  33. 32 ./countdown 12
  34. 33 vim countdown
  35. 34 ./countdown
  36. 35 ehco $?
  37. 36 echo $?
  38. 37 vim countdown
  39. 38 ./countdown
  40. 39 echo $?
  41. 40 ./countdown 12
  42. 41 which passwd
  43. 42 type passwd
  44. 43 type ls
  45. 44 type echo
  46. 45 help
  47. 46 strace -c ls *
  48. 47 strace -c echo *
  49. 48 echo the current $SHELL is set to $SHELL
  50. 49 echo the current '$SHELL' is set to $SHELL
  51. 50 echo the current \$SHELL is set to $SHELL
  52. 51 echo the current "$SHELL" is set to $SHELL
  53. 52 ls -l `which ls`
  54. 53 ls -l `which passwd`
  55. 54 ls -l $(which passwd)
  56. 55 which echo
  57. 56 type echo
  58. 57 declare -r ANSWER=yes
  59. 58 echo $ANSWER
  60. 59 ANSWER=no
  61. 60 cd bash-scripting/
  62. 61 history grep git
  63. 62 history | grep git
  64. 63 ls
  65. 64 vim readtit
  66. 65 chmod +x *
  67. 66 ./readtit
  68. 67 cat readtit
  69. 68 . readtit
  70. 69 . <(kubectl completion bash)
  71. 70 cd
  72. 71 cd bash-scripting/
  73. 72 ls
  74. 73 vim setcolor.sh
  75. 74 vim colors
  76. 75 vim setcolor.sh
  77. 76 chmod +x setcolor.sh
  78. 77 ./setcolor.sh
  79. 78 cat setcolor.sh
  80. 79 cat colors
  81. 80 cd /etc/sysconfig/
  82. 81 ls
  83. 82 cat selinux
  84. 83 cd
  85. 84 cd bash-scripting/
  86. 85 vim script3
  87. 86 ./script3 a b c d e f g h i j k l
  88. 87 true --help
  89. 88 true -h
  90. 89 vim script4
  91. 90 type true
  92. 91 /usr/bin/true --help
  93. 92 cp /usr/bin/true /usr/local/bin/sander
  94. 93 /usr/local/bin/sander --help
  95. 94 vim script4
  96. 95 ./script4 a b c d
  97. 96 cat script4
  98. 97 vim mkusers
  99. 98 chmod +x mkusers
  100. 99 ./mkusers bob bill anita
  101. 100 ./mkusers
  102. 101 echo $?
  103. 102 vim backmeup
  104. 103 chmod +x backmeup
  105. 104 ./backmeup
  106. 105 ls -l /tmp/etc*
  107. 106 uname -r
  108. 107 find / -type d -name $(uname -r)
  109. 108 cd /usr/lib/modules
  110. 109 ls -l
  111. 110 cd
  112. 111 ./countdown 12
  113. 112 cd bash-scripting/
  114. 113 ls
  115. 114 ls -l setup*
  116. 115 vim setupsvc
  117. 116 vim setupftp-test
  118. 117 systemctl disable --now firewalld
  119. 118 bash -x setupftp-test
  120. 119 vim /etc/vsftpd/vsftpd.conf
  121. 120 systemctl restart vsftpd
  122. 121 cp setupftp-test setupftpclient
  123. 122 vim setupftpclient
  124. 123 ./setupftpclient
  125. 124 ls
  126. 125 rm -f hosts
  127. 126 bash -x setupftpclient
  128. 127 ls -l hosts
  129. 128 vim script6
  130. 129 ./script6 /usr/bin/blah
  131. 130 vim script6
  132. 131 ./script6 /usr/bin/blah
  133. 132 vim script7
  134. 133 cd many
  135. 134 mkdir many
  136. 135 cd many
  137. 136 touch file{1..100}
  138. 137 ls
  139. 138 for i in *; do echo $1; done
  140. 139 for i in *; do echo $i; done
  141. 140 for i in *; do mv $i ${i#file}; done
  142. 141 ls
  143. 142 man test
  144. 143 test -f bogus
  145. 144 echo $?
  146. 145 test -f 12
  147. 146 echo $
  148. 147 echo $?
  149. 148 [ -f 12 ]
  150. 149 echo $?
  151. 150 [ -f 1eee2 ]
  152. 151 echo $?
  153. 152 [[ -f 1eee2 ]]
  154. 153 echo $?
  155. 154 [[ -f 12 ]]
  156. 155 echo $?
  157. 156 if [ -f /etc/host ]; then echo it exists; fi
  158. 157 if [ -f /etc/hosts ]; then echo it exists; fi
  159. 158 test -f /etc/hosts && echo it exists
  160. 159 test -f /etc/host && echo it exists
  161. 160 test -f /etc/host ; echo it exists
  162. 161 if [ -d /etc ] && [ -x /etc ]; then echo yes; fi
  163. 162 mkdir /blah
  164. 163 chmod -x /blah
  165. 164 ls -ld /blah
  166. 165 if [ -d /blah ] && [ -x /blah ]; then echo yes; fi
  167. 166 bash -x if [ -d /blah ] && [ -x /blah ]; then echo yes; fi
  168. 167 vim iftest
  169. 168 bash -x iftest
  170. 169 bash -x iftest /etc
  171. 170 bash -x iftest /blah
  172. 171 bash -xc 'if [ -d /tmp/etc ] && [ -x /tmp/etc ]; then echo yes; fi'
  173. 172 bash -c 'if [ -d /tmp/etc ] && [ -x /tmp/etc ]; then echo yes; fi'
  174. 173 bash -c 'if [ -d /tmp ] && [ -x /tmp ]; then echo yes; fi'
  175. 174 cd ..
  176. 175 ./countdown 12
  177. 176 vim multiline
  178. 177 vim multline
  179. 178 chmod +x multline
  180. 179 ./multline
  181. 180 vim multline
  182. 181 ./multline
  183. 182 cat multline
  184. 183 cd many/
  185. 184 touch 31-aug-99-file
  186. 185 touch 31.08.99-file
  187. 186 cd ..
  188. 187 vim else1
  189. 188 vim else2
  190. 189 vim numcheck
  191. 190 ./numcheck
  192. 191 bash -x numcheck
  193. 192 ls -la /usr/bin > binaries && cat binaries && cat /etc/hosts
  194. 193 vim for
  195. 194 ls
  196. 195 vim case
  197. 196 echo hgello | tr [:lower:] [:upper:]
  198. 197 echo hgello | tr [a-k] [l-z]
  199. 198 echo hgello | tr [a-z] [A-Z]
  200. 199 vim case
  201. 200 ./case
  202. 201 vim case
  203. 202 ./case
  204. 203 vim script11
  205. 204 ./script11 1
  206. 205 vim script11
  207. 206 ./script11
  208. 207 bash -x script11
  209. 208 vim script11
  210. 209 bash -x script11 1
  211. 210 vim script11
  212. 211 ./script11 1
  213. 212 vim script11
  214. 213 ./script11 1
  215. 214 vim backout
  216. 215 vim convert
  217. 216 history
  218.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement