Useful bash scripts to save time
- filefind.sh
- Script iterates through my computer (directories and subdirectories), finds all the files and folders that match the name I input and returns their path
- Case insensitive, so lowercase, UPPERCASE and camelCase all work
- Should be made executable using $ "chmod +x find_lecture.sh" before running it.
- Does NOT require root privileges, but it might not be able to access certain directories due to permission restrictions
- In case of permission restriction, the terminal prompts the user for password access
- custom_screenshot_mac.sh
- Script makes a graphical interface using an applescript command to prompt the user for the name of the screenshot
- One has 2 seconds to go to the window they want to take a screenshot of
- The screenshot is story on the desktop in the format "CustomName Year-Month-Day"
- Make executable my running $ "chmod +x custom_screenshot_mac.sh"
- sleep.sh
- Script to sleep mac
- $ "chmod +x sleep.sh"
- lock.sh
- Script to lock mac screen
- $ "chmod +x lock.sh"
- empty_trash.sh
- Script to empty the trash
- colored_test.sh
- Script to print colored welcome in my terminal everytime I open it
- Calls python scripts to print the top 5 hacker news headers and links, some stocks, and a task list (alias: task_add "ADD TASK", task_remove task_index, task_list)
$ cd ~ $ code ~/.zshrc
In the .zshrc file, at the end of the file write
$ ss
$ find lifeeasyscripts
$ find lifeEASYscripts
alias vim='nvim'
# Git
alias gaa='git add --all'
alias gcm='git commit -m'
alias gca='git add --all && git commit -m'
alias gpl='git pull'
alias gp='git push'
alias gsw='git switch'
alias gswc='git switch -c'
# Docker
alias dps='docker ps'
alias dpa='docker system prune --volumes'
alias ds='docker stop'
alias drm='docker rm'
# General
alias now='date +"%T"'
alias nowdate='date +"%d-%m-%Y"'
alias f='find . |grep '
# Rust
alias cr='cargo run'
alias ct='cargo test'
alias cb='cargo build'
alias cc='cargo check'
alias cclip='cargo clippy'
alias cfmt='cargo fmt'
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
eval "$(starship init zsh)"