Last active
August 17, 2023 15:11
-
-
Save RFullum/d29c675b0e1c99f5df4aff069a9ff5af to your computer and use it in GitHub Desktop.
.bash_profile .bashrc custom functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just a collection of functions i add to my .bash_profile (mac) and .bashrc (linux) on almost every device i have. | |
# Simultaneously create and switch to new directory | |
function mkcd () { mkdir -p "$@" && cd "$@"; } | |
# Simultaneously change into directory and list files | |
function cdls () { cd "$@" && ls -ah "."; } | |
# Repleace spaces in filenames in a directory with an underscore | |
function repspace () { find . -type f -name "* *" -exec bash -c 'mv "$0" "${0// /_}"' {} ";" ; } | |
# Prompt | |
export PS1="\[\033[1;31m\]\u:\W$\[\033[0m\] " | |
# Add my ~/Scripts folder to PATH | |
export PATH=$PATH:$HOME/Scripts | |
# My aliases | |
alias aptUpgrade="sudo apt update && sudo apt upgrade && sudo apt autoclean" | |
alias aptUpdate="aptUpgrade" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment