Advertisement
Guest User

Untitled

a guest
Feb 13th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.28 KB | None | 0 0
  1. sam@sam-VirtualBox ~/scripts $ nano doc-backup
  2. sam@sam-VirtualBox ~/scripts $ doc-backup
  3. doc-backup: command not found
  4. sam@sam-VirtualBox ~/scripts $ doc-backup
  5. doc-backup: command not found
  6. sam@sam-VirtualBox ~/scripts $ nano doc-backup
  7. sam@sam-VirtualBox ~/scripts $ doc-backup
  8. doc-backup: command not found
  9. sam@sam-VirtualBox ~/scripts $ chmod 764 doc-backup
  10. sam@sam-VirtualBox ~/scripts $ doc-backup
  11. doc-backup: command not found
  12. sam@sam-VirtualBox ~/scripts $ nano doc-backup
  13. sam@sam-VirtualBox ~/scripts $ doc-backup
  14. doc-backup: command not found
  15. sam@sam-VirtualBox ~/scripts $ ls -l
  16. total 44
  17. -rw-rw-r-- 1 sam sam 81 Feb 13 16:09 cat6
  18. -rwxrw-r-- 1 sam sam 274 Feb 13 17:04 doc-backup
  19. -rwxrw-r-- 1 sam sam 112 Feb 13 15:34 fs.sh
  20. -rwxrw-r-- 1 sam sam 96 Feb 13 15:40 s2
  21. -rwxrw-r-- 1 sam sam 215 Feb 13 16:24 test10
  22. -rwxrw--w- 1 sam sam 152 Feb 13 15:48 test3
  23. -rw-rw-r-- 1 sam sam 248 Feb 13 15:50 test4
  24. -rwxrw-r-- 1 sam sam 101 Feb 13 15:55 test5
  25. -rwxrw-r-- 1 sam sam 81 Feb 13 16:09 test6
  26. -rwxrw-r-- 1 sam sam 100 Feb 13 16:12 test7
  27. -rwxrw-r-- 1 sam sam 88 Feb 13 16:18 test9
  28. sam@sam-VirtualBox ~/scripts $ chmod u+x doc-backup
  29. sam@sam-VirtualBox ~/scripts $ doc-backup
  30. doc-backup: command not found
  31. sam@sam-VirtualBox ~/scripts $ ls -l
  32. total 44
  33. -rw-rw-r-- 1 sam sam 81 Feb 13 16:09 cat6
  34. -rwxrw-r-- 1 sam sam 274 Feb 13 17:04 doc-backup
  35. -rwxrw-r-- 1 sam sam 112 Feb 13 15:34 fs.sh
  36. -rwxrw-r-- 1 sam sam 96 Feb 13 15:40 s2
  37. -rwxrw-r-- 1 sam sam 215 Feb 13 16:24 test10
  38. -rwxrw--w- 1 sam sam 152 Feb 13 15:48 test3
  39. -rw-rw-r-- 1 sam sam 248 Feb 13 15:50 test4
  40. -rwxrw-r-- 1 sam sam 101 Feb 13 15:55 test5
  41. -rwxrw-r-- 1 sam sam 81 Feb 13 16:09 test6
  42. -rwxrw-r-- 1 sam sam 100 Feb 13 16:12 test7
  43. -rwxrw-r-- 1 sam sam 88 Feb 13 16:18 test9
  44. sam@sam-VirtualBox ~/scripts $ chmod u+g doc-backup
  45. sam@sam-VirtualBox ~/scripts $ ls -l
  46. total 44
  47. -rw-rw-r-- 1 sam sam 81 Feb 13 16:09 cat6
  48. -rwxrw-r-- 1 sam sam 274 Feb 13 17:04 doc-backup
  49. -rwxrw-r-- 1 sam sam 112 Feb 13 15:34 fs.sh
  50. -rwxrw-r-- 1 sam sam 96 Feb 13 15:40 s2
  51. -rwxrw-r-- 1 sam sam 215 Feb 13 16:24 test10
  52. -rwxrw--w- 1 sam sam 152 Feb 13 15:48 test3
  53. -rw-rw-r-- 1 sam sam 248 Feb 13 15:50 test4
  54. -rwxrw-r-- 1 sam sam 101 Feb 13 15:55 test5
  55. -rwxrw-r-- 1 sam sam 81 Feb 13 16:09 test6
  56. -rwxrw-r-- 1 sam sam 100 Feb 13 16:12 test7
  57. -rwxrw-r-- 1 sam sam 88 Feb 13 16:18 test9
  58. sam@sam-VirtualBox ~/scripts $ ls -l
  59. total 44
  60. -rw-rw-r-- 1 sam sam 81 Feb 13 16:09 cat6
  61. -rwxrw-r-- 1 sam sam 274 Feb 13 17:04 doc-backup
  62. -rwxrw-r-- 1 sam sam 112 Feb 13 15:34 fs.sh
  63. -rwxrw-r-- 1 sam sam 96 Feb 13 15:40 s2
  64. -rwxrw-r-- 1 sam sam 215 Feb 13 16:24 test10
  65. -rwxrw--w- 1 sam sam 152 Feb 13 15:48 test3
  66. -rw-rw-r-- 1 sam sam 248 Feb 13 15:50 test4
  67. -rwxrw-r-- 1 sam sam 101 Feb 13 15:55 test5
  68. -rwxrw-r-- 1 sam sam 81 Feb 13 16:09 test6
  69. -rwxrw-r-- 1 sam sam 100 Feb 13 16:12 test7
  70. -rwxrw-r-- 1 sam sam 88 Feb 13 16:18 test9
  71. sam@sam-VirtualBox ~/scripts $ nano doc-backup
  72. sam@sam-VirtualBox ~/scripts $ doc-backup
  73. doc-backup: command not found
  74. sam@sam-VirtualBox ~/scripts $ $PATH
  75. bash: /home/sam/bin:/home/sam/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/sam/test:/home/sam/sam/scripts: No such file or directory
  76. sam@sam-VirtualBox ~/scripts $ chmod u=rwx,g=rwx,o=rwx doc-backup
  77. sam@sam-VirtualBox ~/scripts $ doc-backup
  78. doc-backup: command not found
  79. sam@sam-VirtualBox ~/scripts $ nano doc-backup
  80. sam@sam-VirtualBox ~/scripts $ ls
  81. cat6 doc-backup fs.sh s2 test10 test3 test4 test5 test6 test7 test9
  82. sam@sam-VirtualBox ~/scripts $ ls -l
  83. total 44
  84. -rw-rw-r-- 1 sam sam 81 Feb 13 16:09 cat6
  85. -rwxrwxrwx 1 sam sam 293 Feb 13 17:09 doc-backup
  86. -rwxrw-r-- 1 sam sam 112 Feb 13 15:34 fs.sh
  87. -rwxrw-r-- 1 sam sam 96 Feb 13 15:40 s2
  88. -rwxrw-r-- 1 sam sam 215 Feb 13 16:24 test10
  89. -rwxrw--w- 1 sam sam 152 Feb 13 15:48 test3
  90. -rw-rw-r-- 1 sam sam 248 Feb 13 15:50 test4
  91. -rwxrw-r-- 1 sam sam 101 Feb 13 15:55 test5
  92. -rwxrw-r-- 1 sam sam 81 Feb 13 16:09 test6
  93. -rwxrw-r-- 1 sam sam 100 Feb 13 16:12 test7
  94. -rwxrw-r-- 1 sam sam 88 Feb 13 16:18 test9
  95. sam@sam-VirtualBox ~/scripts $ nano doc-backup
  96. sam@sam-VirtualBox ~/scripts $ doc-backup
  97. doc-backup: command not found
  98. sam@sam-VirtualBox ~/scripts $ doc-backup
  99. doc-backup: command not found
  100. sam@sam-VirtualBox ~/scripts $ nano doc-backup
  101. sam@sam-VirtualBox ~/scripts $ $PATH
  102. bash: /home/sam/bin:/home/sam/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/sam/test:/home/sam/sam/scripts: No such file or directory
  103. sam@sam-VirtualBox ~/scripts $ echo $PATH
  104. /home/sam/bin:/home/sam/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/sam/test:/home/sam/sam/scripts
  105. sam@sam-VirtualBox ~/scripts $ cat ~/.bashrc
  106.  
  107. # ~/.bashrc: executed by bash(1) for non-login shells.
  108. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  109. # for examples
  110.  
  111. # If not running interactively, don't do anything
  112. case $- in
  113. *i*) ;;
  114. *) return;;
  115. esac
  116.  
  117. # don't put duplicate lines or lines starting with space in the history.
  118. # See bash(1) for more options
  119. HISTCONTROL=ignoreboth
  120.  
  121. # append to the history file, don't overwrite it
  122. shopt -s histappend
  123.  
  124. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  125. HISTSIZE=1000
  126. HISTFILESIZE=2000
  127.  
  128. # check the window size after each command and, if necessary,
  129. # update the values of LINES and COLUMNS.
  130. shopt -s checkwinsize
  131.  
  132. # If set, the pattern "**" used in a pathname expansion context will
  133. # match all files and zero or more directories and subdirectories.
  134. #shopt -s globstar
  135.  
  136. # make less more friendly for non-text input files, see lesspipe(1)
  137. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  138.  
  139. # set variable identifying the chroot you work in (used in the prompt below)
  140. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  141. debian_chroot=$(cat /etc/debian_chroot)
  142. fi
  143.  
  144. # set a fancy prompt (non-color, unless we know we "want" color)
  145. case "$TERM" in
  146. xterm|xterm-color|*-256color) color_prompt=yes;;
  147. esac
  148.  
  149. # uncomment for a colored prompt, if the terminal has the capability; turned
  150. # off by default to not distract the user: the focus in a terminal window
  151. # should be on the output of commands, not on the prompt
  152. #force_color_prompt=yes
  153.  
  154. if [ -n "$force_color_prompt" ]; then
  155. if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  156. # We have color support; assume it's compliant with Ecma-48
  157. # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  158. # a case would tend to support setf rather than setaf.)
  159. color_prompt=yes
  160. else
  161. color_prompt=
  162. fi
  163. fi
  164.  
  165. if [ "$color_prompt" = yes ]; then
  166. if [[ ${EUID} == 0 ]] ; then
  167. PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
  168. else
  169. PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '
  170. fi
  171. else
  172. PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
  173. fi
  174. unset color_prompt force_color_prompt
  175.  
  176. # If this is an xterm set the title to user@host:dir
  177. case "$TERM" in
  178. xterm*|rxvt*)
  179. PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h \w\a\]$PS1"
  180. ;;
  181. *)
  182. ;;
  183. esac
  184.  
  185. # enable color support of ls and also add handy aliases
  186. if [ -x /usr/bin/dircolors ]; then
  187. test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  188. alias ls='ls --color=auto'
  189. #alias dir='dir --color=auto'
  190. #alias vdir='vdir --color=auto'
  191.  
  192. alias grep='grep --color=auto'
  193. alias fgrep='fgrep --color=auto'
  194. alias egrep='egrep --color=auto'
  195. fi
  196.  
  197. # colored GCC warnings and errors
  198. #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
  199.  
  200. # some more ls aliases
  201. alias ll='ls -alF'
  202. alias la='ls -A'
  203. alias l='ls -CF'
  204.  
  205. # Add an "alert" alias for long running commands. Use like so:
  206. # sleep 10; alert
  207. alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
  208.  
  209. # Alias definitions.
  210. # You may want to put all your additions into a separate file like
  211. # ~/.bash_aliases, instead of adding them here directly.
  212. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  213.  
  214. if [ -f ~/.bash_aliases ]; then
  215. . ~/.bash_aliases
  216. fi
  217.  
  218. # enable programmable completion features (you don't need to enable
  219. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  220. # sources /etc/bash.bashrc).
  221. if ! shopt -oq posix; then
  222. if [ -f /usr/share/bash-completion/bash_completion ]; then
  223. . /usr/share/bash-completion/bash_completion
  224. elif [ -f /etc/bash_completion ]; then
  225. . /etc/bash_completion
  226. fi
  227. fi
  228.  
  229. if [ -x /usr/bin/mint-fortune ]; then
  230. /usr/bin/mint-fortune
  231. fi
  232.  
  233. # append my favorite directory to the PATH
  234. PATH=$PATH:$HOME/test
  235. PATH=$PATH:$HOME/sam/scripts
  236. sam@sam-VirtualBox ~/scripts $ chmod 700 doc-backup
  237. sam@sam-VirtualBox ~/scripts $ doc-backup
  238. doc-backup: command not found
  239. sam@sam-VirtualBox ~/scripts $ ./doc-backup
  240. tar: Removing leading `/' from member names
  241. tar: Removing leading `/' from hard link targets
  242. Backups
  243. total 8
  244. -rw-rw-r-- 2 sam sam 8 Jan 23 15:48 sam1b
  245. drwxrwxr-x 3 sam sam 4096 Jan 23 16:43 Week2
  246. sam@sam-VirtualBox ~/scripts $ $PATH
  247. bash: /home/sam/bin:/home/sam/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/sam/test:/home/sam/sam/scripts: No such file or directory
  248. sam@sam-VirtualBox ~/scripts $ grep PATH ./bashrc
  249. grep: ./bashrc: No such file or directory
  250. sam@sam-VirtualBox ~/scripts $ grep PATH /.bashrc
  251. grep: /.bashrc: No such file or directory
  252. sam@sam-VirtualBox ~/scripts $ grep PATH ./.bashrc
  253. grep: ./.bashrc: No such file or directory
  254. sam@sam-VirtualBox ~/scripts $ grep PATH ~/.bashrc
  255. # append my favorite directory to the PATH
  256. PATH=$PATH:$HOME/test
  257. PATH=$PATH:$HOME/sam/scripts
  258. sam@sam-VirtualBox ~/scripts $ echo $PATH
  259. /home/sam/bin:/home/sam/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/sam/test:/home/sam/sam/scripts
  260. sam@sam-VirtualBox ~/scripts $ ls
  261. cat6 doc-backup doc-backup.180213-1518563840.tar fs.sh s2 test10 test3 test4 test5 test6 test7 test9
  262. sam@sam-VirtualBox ~/scripts $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement