diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 2511aab8a9..5ed1576227 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -20,6 +20,7 @@ alias _='sudo' alias vbrc='${VISUAL:-vim} ~/.bashrc' alias vbpf='${VISUAL:-vim} ~/.bash_profile' + # colored grep # Need to check an existing file for a pattern that will be found to ensure # 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 alias ...='cd ../..' # Go up two directories alias ....='cd ../../..' # Go up three directories alias -- -='cd -' # Go back +alias d='cd /home/$USER/Downloads' # Go to the Downloads directory # Shell History alias h='history' @@ -68,6 +70,9 @@ fi alias md='mkdir -p' alias rd='rmdir' +# Remove +alias rmrf='rm -rf' + # Shorten extract alias xt='extract' diff --git a/plugins/available/base.plugin.bash b/plugins/available/base.plugin.bash index 1a905163e4..8e3c2d1227 100644 --- a/plugins/available/base.plugin.bash +++ b/plugins/available/base.plugin.bash @@ -183,3 +183,16 @@ if ! _command_exists del; then mkdir -p /tmp/.trash && mv "$@" /tmp/.trash } fi + +# replace multiple file extensions at once +function rex() { + about 'mass replace of the extension of multiple files' + param '1: extension to replace' + param '2: new extenstion' + example 'rex txt md' + group 'base' + local ext2replace="${1:-}" + local newext="${2:-}" + local files=(`ls *.$ext2replace`) + for file in "${files[@]}"; do mv "$file" "${file/%.$ext2replace/.$newext}"; done +}