Advertisement
sandervanvugt

bash june23

Jun 1st, 2023
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.55 KB | None | 0 0
  1. 1 echo $SHELL
  2. 2 env
  3. 3 echo $USER
  4. 4 echo $PATH
  5. 5 key=value
  6. 6 echo $key
  7. 7 bash
  8. 8 export key=vlaue
  9. 9 echo $key
  10. 10 bash
  11. 11 echo ${key}
  12. 12 echo ${key}1
  13. 13 echo $key1
  14. 14 ls
  15. 15 echo $?
  16. 16 ls uhiuhgiuiuh
  17. 17 echo $?
  18. 18 vim hello
  19. 19 ls -l hello
  20. 20 ./hello
  21. 21 chmod +x hello
  22. 22 ./hello
  23. 23 history
  24. 24 hello
  25. 25 echo $PATH
  26. 26 ./hello
  27. 27 history
  28. 28 cat hello
  29. 29 echo $PATH
  30. 30 echo $SHELL
  31. 31 chsh --help
  32. 32 #chsh -s /bin/bash
  33. 33 help
  34. 34 type ls
  35. 35 type useradd
  36. 36 type shift
  37. 37 which tcsh
  38. 38 which csh
  39. 39 sudo dnf install zsh
  40. 40 chsh -s /bin/zsh
  41. 41 echo $SHELL
  42. 42 grep student /etc/passwd
  43. 43 history
  44. 44 chsh -s /bin/bash
  45. 45 grep student /etc/passwd
  46. 46 vim changeshell
  47. 47 chmod +x changeshell
  48. 48 ./changeshell
  49. 49 mkdir newdir
  50. 50 cd newdir/
  51. 51 touch my file
  52. 52 ls -l
  53. 53 touch "my file"
  54. 54 ls
  55. 55 echo "the current $SHELL is $SHELL"
  56. 56 echo 'the current $SHELL is $SHELL'
  57. 57 echo "the current \$SHELL is $SHELL"
  58. 58 cd
  59. 59 sudo dnf install git -y
  60. 60 git clone https://github.com/sandervanvugt/bash-scripting
  61. 61 cd bash-scripting/
  62. 62 ls
  63. 63 du -hs
  64. 64 cat countdown
  65. 65 ./countdown 12
  66. 66 vim countdown
  67. 67 $((2+4))
  68. 68 echo $((2+4))
  69. 69 vim countdown
  70. 70 echo (( 2 + 4 ))
  71. 71 echo $(( 2 + 4 ))
  72. 72 set a=3
  73. 73 set a=3; $(( a * 2 ))
  74. 74 a=3
  75. 75 $((a * 2))
  76. 76 echo $((a * 2))
  77. 77 echo $(($a * 2))
  78. 78 declare -r STATE=yes
  79. 79 echo $STATE
  80. 80 STATE=green
  81. 81 ls
  82. 82 vim readit
  83. 83 ./readit
  84. 84 chmod +x *
  85. 85 ./readit
  86. 86 pwd
  87. 87 vim sourceit
  88. 88 chmod +x sourceit
  89. 89 ./sourceit
  90. 90 vim vars
  91. 91 ./sourceit
  92. 92 vim vars
  93. 93 ./sourceit
  94. 94 ls -l /etc/sysconfig/
  95. 95 cat /etc/sysconfig/raid-check
  96. 96 history
  97. 97 vim script3
  98. 98 ./script3 a b c d e f g h i j k l m n
  99. 99 cat script3
  100. 100 export AWS_SECRET_KEY=abcde
  101. 101 vim script4
  102. 102 ./script4 a b c d
  103. 103 vim script4
  104. 104 for user in bob bill betty; do echo the username is $user; done
  105. 105 history
  106. 106 tar -czvf /tmp/backup-$(date +%d-%m-%y).tgz /etc
  107. 107 ls -l /tmp
  108. 108 history
  109. 109 man date
  110. 110 cd /usr/lib
  111. 111 ls
  112. 112 cd ../lib64
  113. 113 ls
  114. 114 cd ..
  115. 115 cd lib
  116. 116 ls
  117. 117 cd mod
  118. 118 cd modules
  119. 119 ls
  120. 120 uname -r
  121. 121 ls -l $(uname -r)
  122. 122 ls -l `uname -r`
  123. 123 cd
  124. 124 cd bash-scripting/
  125. 125 ./countdown 12
  126. 126 ls
  127. 127 vim setupftp
  128. 128 ./setupftp
  129. 129 ls
  130. 130 cd ..
  131. 131 git clone https://github.com/sandervanvugt/cka
  132. 132 cd cka/
  133. 133 ls
  134. 134 vim setup-container.sh
  135. 135 cd ..
  136. 136 history
  137. 137 cd bash-scripting/
  138. 138 vim script6
  139. 139 ./script6 /usr/bin/whatever
  140. 140 vim script6
  141. 141 ./script6 /usr/bin/blah
  142. 142 vim script7
  143. 143 echo $(( 2 * 19 ))
  144. 144 man test
  145. 145 test -f /etc/hosts
  146. 146 echo $?
  147. 147 [ -f /etc/hosts ]
  148. 148 echo $?
  149. 149 [ -f /etc/hostwegwegs ]
  150. 150 echo $?
  151. 151 if [ -f /etc/hosts ]; then it exists; fi
  152. 152 if [ -f /etc/hosts ]; then echo it exists; fi
  153. 153 if [-f /etc/hosts]; then echo it exists; fi
  154. 154 cd/etc
  155. 155 if [ -f /etc/hosts]; then echo it exists; fi
  156. 156 if [ -f /etc/hostwergers ]; then echo it exists; fi
  157. 157 [ -f /etc/hosts ] && echo it exists
  158. 158 [ -f /etc/hosts ] || echo it exists
  159. 159 [ -f /etc/hoguyfguysts ] || echo it exists
  160. 160 vim /etc/bashrc
  161. 161 ./countdown 12
  162. 162 ls
  163. 163 vim else1
  164. 164 ./else1
  165. 165 ./else1 hh
  166. 166 vim else2
  167. 167 ./else2 h
  168. 168 ./else2 /etc/hosts
  169. 169 vim else2
  170. 170 ./else2 uguiiug
  171. 171 ./else2 /etc/hosts
  172. 172 vim numcheck
  173. 173 ./numcheck
  174. 174 vim script10
  175. 175 ./script10 5
  176. 176 man true
  177. 177 vim script11
  178. 178 ./script11
  179. 179 bash -x script11
  180. 180 vim script11
  181. 181 ./script11
  182. 182 bash -x ./script11
  183. 183 vim script11
  184. 184 ./script11
  185. 185 ./script11 1
  186. 186 vim script11
  187. 187 ./script11 1
  188. 188 ls
  189. 189 vim 1_cpu-hog
  190. 190 ps -eo pcpu,pid -o comm=
  191. 191 vim 1_cpu-hog
  192. 192 ./1_cpu-hog
  193. 193 vim 1_cpu-hog
  194. 194 ./1_cpu-hog
  195. 195 vim 1_cpu-hog
  196. 196 ./1_cpu-hog
  197. 197 vim 1_cpu-hog
  198. 198 ./1_cpu-hog
  199. 199 vim 1_cpu-hog
  200. 200 ls
  201. 201 vim case
  202. 202 ./case
  203. 203 vim case
  204. 204 ./case
  205. 205 vim /etc/bashrc
  206. 206 history
  207.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement