File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ alias _='sudo'
2020alias vbrc=' ${VISUAL:-vim} ~/.bashrc'
2121alias vbpf=' ${VISUAL:-vim} ~/.bash_profile'
2222
23+
2324# colored grep
2425# Need to check an existing file for a pattern that will be found to ensure
2526# that the check works when on an OS that supports the color option
@@ -55,6 +56,7 @@ alias cd..='cd ..' # Common misspelling for going up one directory
5556alias ...=' cd ../..' # Go up two directories
5657alias ....=' cd ../../..' # Go up three directories
5758alias -- -=' cd -' # Go back
59+ alias dow=' cd /home/$USER/Downloads' # Go to the Downloads directory
5860
5961# Shell History
6062alias h=' history'
6870alias md=' mkdir -p'
6971alias rd=' rmdir'
7072
73+ # Remove
74+ alias rmrf=' rm -rf'
75+
7176# Shorten extract
7277alias xt=' extract'
7378
Original file line number Diff line number Diff line change @@ -183,3 +183,19 @@ if ! _command_exists del; then
183183 mkdir -p /tmp/.trash && mv " $@ " /tmp/.trash
184184 }
185185fi
186+
187+ # replace multiple file extensions at once
188+ function renex() {
189+ about ' mass replace of the extension of multiple files'
190+ param ' 1: extension to replace'
191+ param ' 2: new extenstion'
192+ example ' rex txt md'
193+ group ' base'
194+ local ext2replace=" ${1:- } "
195+ local newext=" ${2:- } "
196+ local files=(* ." $ext2replace " )
197+ for file in " ${files[@]} " ; do
198+ local dst=${file/% ." $ext2replace " / ." $newext " }
199+ mv " $file " " $dst "
200+ done
201+ }
You can’t perform that action at this time.
0 commit comments