diff --git a/.bashrc b/.bashrc index c3e8aac..17eaee5 100644 --- a/.bashrc +++ b/.bashrc @@ -27,26 +27,27 @@ fi [[ $- != *i* ]] && return # Set default aliases -alias ls='ls -l --color=auto' -alias grep='grep --color=auto' -alias rs="sudo pacman -Rs" -alias s="sudo pacman -S" -alias sy="sudo pacman -Syy" -alias syyu="sudo pacman -Syyu" -alias lck="sudo rm /var/lib/pacman/db.lck" -alias vm="sudo systemctl enable --now vmtoolsd.service" -alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl" -alias ys="yay -S" -alias pas="paru -S" -alias wget="wget -c" -alias ..="cd .." -alias home="cd ~" -alias docs="cd ~/Documents" -alias dl="cd ~/Downloads" -alias music="cd ~/Music" -alias pics="cd ~/Pictures" -alias vids="cd ~/Videos" -alias desk="cd ~/Desktop" + +alias ls='ls -l --color=auto' # List directory contents in long format with colorized output +alias grep='grep --color=auto' # Enable colorized output for grep command +alias rs="sudo pacman -Rs" # Remove packages with dependencies using pacman +alias s="sudo pacman -S" # Install packages with pacman +alias sy="sudo pacman -Syy" # Sync package databases and update package list +alias syyu="sudo pacman -Syyu" # Sync package databases and update system packages +alias lck="sudo rm /var/lib/pacman/db.lck" # Remove pacman lock file (use with caution) +alias vm="sudo systemctl enable --now vmtoolsd.service" # Enable VMware Tools service at boot +alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl" # Display recently installed packages sorted by install date (last 200) +alias ys="yay -S" # Install packages with yay (AUR helper) +alias pas="paru -S" # Install packages with paru (another AUR helper) +alias wget="wget -c" # Download files using wget and continue partially downloaded files +alias ..="cd .." # Move up one directory in the filesystem +alias home="cd ~" # Go to the home directory +alias docs="cd ~/Documents" # Go to the Documents directory +alias dl="cd ~/Downloads" # Go to the Downloads directory +alias music="cd ~/Music" # Go to the Music directory +alias pics="cd ~/Pictures" # Go to the Pictures directory +alias vids="cd ~/Videos" # Go to the Videos directory +alias desk="cd ~/Desktop" # Go to the Desktop directory # Enhanced file manipulation aliases alias rm="rm -i" # Confirm before removing files @@ -62,26 +63,26 @@ bind "set completion-ignore-case on" # Function for extracting different types of archives ex () { - if [ -f "$1" ]; then - case "$1" in - *.tar.bz2) tar xjf "$1" ;; - *.tar.gz) tar xzf "$1" ;; - *.bz2) bunzip2 "$1" ;; - *.rar) unrar x "$1" ;; - *.gz) gunzip "$1" ;; - *.tar) tar xf "$1" ;; - *.tbz2) tar xjf "$1" ;; - *.tgz) tar xzf "$1" ;; - *.zip) unzip "$1" ;; - *.Z) uncompress "$1" ;; - *.7z) 7z x "$1" ;; - *.deb) ar x "$1" ;; - *.tar.xz) tar xf "$1" ;; - *.tar.zst) tar xf "$1" ;; - *) echo "'$1' cannot be extracted via ex()" ;; + if [ -f "$1" ]; then # Check if the argument is a valid file + case "$1" in # Case structure to match different file extensions + *.tar.bz2) tar xjf "$1" ;; # Extract .tar.bz2 files using tar + *.tar.gz) tar xzf "$1" ;; # Extract .tar.gz files using tar + *.bz2) bunzip2 "$1" ;; # Decompress .bz2 files + *.rar) unrar x "$1" ;; # Extract .rar files using unrar + *.gz) gunzip "$1" ;; # Decompress .gz files + *.tar) tar xf "$1" ;; # Extract .tar files using tar + *.tbz2) tar xjf "$1" ;; # Extract .tbz2 files using tar + *.tgz) tar xzf "$1" ;; # Extract .tgz files using tar + *.zip) unzip "$1" ;; # Extract .zip files using unzip + *.Z) uncompress "$1" ;; # Decompress .Z files + *.7z) 7z x "$1" ;; # Extract .7z files using 7z + *.deb) ar x "$1" ;; # Extract .deb package files using ar + *.tar.xz) tar xf "$1" ;; # Extract .tar.xz files using tar + *.tar.zst) tar xf "$1" ;; # Extract .tar.zst files using tar + *) echo "'$1' cannot be extracted via ex()" ;; # Print a message if the file type is unsupported esac else - echo "'$1' is not a valid file" + echo "'$1' is not a valid file" # Print an error if the argument is not a valid file fi } @@ -111,201 +112,226 @@ fi #fi # Additional useful aliases -alias cls="clear" -alias h="history" -alias upg="sudo pacman -Syu" -alias restart="sudo reboot" -alias shutdown="sudo shutdown -h now" -alias halt="sudo shutdown -h now" -alias lock="i3lock" -alias logs="journalctl -xe" -alias t="tmux" -alias top="htop" -alias cpu="lscpu" -alias mem="free -h" -alias battery="upower -i $(upower -e | grep 'BAT') | grep 'state\|percentage'" + +alias cls="clear" # Clear the terminal screen +alias h="history" # Show the command history +alias upg="sudo pacman -Syu" # Update the system with pacman (Arch-based) +alias restart="sudo reboot" # Restart the system +alias shutdown="sudo shutdown -h now" # Shutdown the system immediately +alias halt="sudo shutdown -h now" # Halt the system immediately (same as shutdown) +alias lock="i3lock" # Lock the screen using i3lock (for i3 users) +alias logs="journalctl -xe" # Show detailed logs from the system journal +alias t="tmux" # Start a new tmux session or attach to an existing one +alias top="htop" # Show interactive process viewer (htop) +alias cpu="lscpu" # Display CPU architecture information +alias mem="free -h" # Show memory usage in human-readable format +alias battery="upower -i $(upower -e | grep 'BAT') | grep 'state\|percentage'" # Show battery status (for laptops) + +# System monitoring +alias disk="df -h" # Disk space usage +alias du="du -h --max-depth=1" # Disk usage in human-readable format, one directory level +alias iostat="iostat -xz 1" # Disk I/O statistics +alias uptime="uptime" # Show system uptime +alias load="uptime | awk '{print $10, $11, $12}'" # Show system load averages +alias meminfo="cat /proc/meminfo" # Detailed memory information +alias netstat="netstat -tuln" # Network statistics +alias ss="ss -tuln" # Socket statistics +alias ifconfig="ifconfig -a" # Display network interfaces +alias ip="ip addr show" # Show IP addresses of interfaces + +# Package management (Arch-based) +alias pac="pacman" # Pacman package manager +alias paclist="pacman -Q" # List installed packages +alias pacsearch="pacman -Ss" # Search for packages +alias pacinfo="pacman -Qi" # Get detailed package information +alias pacclean="sudo pacman -Rns $(pacman -Qdtq)" # Remove orphaned packages +alias pacpurge="sudo pacman -Rns $(pacman -Qdtq); sudo pacman -Scc" # Remove unused packages and clean the cache + +# User management +alias users="who" # List currently logged in users +alias whoami="whoami" # Display the current logged-in user +alias groups="groups" # Show groups the user belongs to +alias lastlog="lastlog" # Show last login information # Navigate the system more efficiently -alias src="cd ~/src" -alias code="code ." +alias src="cd ~/src" # Change directory to ~/src +alias code="code ." # Open the current directory in VSCode # Git Aliases -alias gs="git status" -alias ga="git add" -alias gaa="git add --all" -alias gc="git commit" -alias gca="git commit --amend" -alias gcm="git commit -m" -alias gco="git checkout" -alias gbr="git branch" -alias gb="git branch" -alias gl="git log" -alias glg="git log --oneline --graph --all" -alias gst="git stash" -alias gpo="git push origin" -alias gpl="git pull" -alias gup="git pull --rebase" -alias gd="git diff" -alias gds="git diff --staged" -alias gls="git ls-files" -alias gcl="git clone" -alias gtag="git tag" - +alias gs="git status" # Show the status of the current git repository +alias ga="git add" # Stage changes for commit +alias gaa="git add --all" # Stage all changes, including new, modified, and deleted files +alias gc="git commit" # Commit staged changes +alias gca="git commit --amend" # Amend the last commit (modify the commit message or content) +alias gcm="git commit -m" # Commit with a message +alias gco="git checkout" # Switch branches or restore files +alias gbr="git branch" # List all branches in the repository +alias gb="git branch" # Alias for listing branches (same as gbr) +alias gl="git log" # View the commit history +alias glg="git log --oneline --graph --all" # View the commit history in a concise graphical format +alias gst="git stash" # Stash changes (save work in progress temporarily) +alias gpo="git push origin" # Push changes to the remote repository (origin) +alias gpl="git pull" # Pull changes from the remote repository +alias gup="git pull --rebase" # Pull changes and rebase (reapply local commits on top) +alias gd="git diff" # Show differences between files or commits +alias gds="git diff --staged" # Show differences for staged files (ready to commit) +alias gls="git ls-files" # List all tracked files in the repository +alias gcl="git clone" # Clone a remote repository +alias gtag="git tag" # List, create, or delete tags in the repository # npm Aliases -alias ni="npm install" -alias nis="npm install --save" -alias nisdev="npm install --save-dev" -alias nup="npm update" -alias nstart="npm start" -alias nrun="npm run" -alias ntest="npm test" -alias nls="npm ls" -alias nci="npm ci" -alias nfund="npm fund" -alias npublish="npm publish" -alias nversion="npm version" -alias nrm="npm run" -alias nout="npm outdated" +alias ni="npm install" # Install dependencies from package.json +alias nis="npm install --save" # Install and save dependencies to package.json (for regular dependencies) +alias nisdev="npm install --save-dev" # Install and save dependencies as devDependencies +alias nup="npm update" # Update all dependencies to the latest versions +alias nstart="npm start" # Run the start script defined in package.json +alias nrun="npm run" # Run a custom script defined in package.json +alias ntest="npm test" # Run tests defined in package.json +alias nls="npm ls" # List installed packages +alias nci="npm ci" # Install dependencies from package-lock.json (clean installation) +alias nfund="npm fund" # Show funding information for the installed packages +alias npublish="npm publish" # Publish the package to npm registry +alias nversion="npm version" # Show or change the version of the current package +alias nrm="npm run" # Alias to run any custom script, same as `npm run` +alias nout="npm outdated" # Show which installed packages are outdated # pnpm Aliases -alias pni="pnpm install" -alias pnis="pnpm install --save" -alias pnisdev="pnpm install --save-dev" -alias pnm="pnpm manager" -alias pnup="pnpm update" -alias pnstart="pnpm start" -alias pnrun="pnpm run" -alias pntest="pnpm test" -alias pnls="pnpm list" -alias pnci="pnpm ci" -alias pnpublish="pnpm publish" -alias pnversion="pnpm version" -alias pnout="pnpm outdated" +alias pni="pnpm install" # Install dependencies from package.json +alias pnis="pnpm install --save" # Install and save dependencies to package.json (for regular dependencies) +alias pnisdev="pnpm install --save-dev" # Install and save dependencies as devDependencies +alias pnm="pnpm manager" # Manage pnpm (usually refers to actions like pnpm install, update, etc.) +alias pnup="pnpm update" # Update all dependencies to the latest versions +alias pnstart="pnpm start" # Run the start script defined in package.json using pnpm +alias pnrun="pnpm run" # Run a custom script defined in package.json with pnpm +alias pntest="pnpm test" # Run tests defined in package.json using pnpm +alias pnls="pnpm list" # List installed packages in the current project +alias pnci="pnpm ci" # Clean install (similar to npm ci), installs dependencies from lockfile +alias pnpublish="pnpm publish" # Publish the package to a registry using pnpm +alias pnversion="pnpm version" # Show or change the version of the current package using pnpm +alias pnout="pnpm outdated" # Show which installed packages are outdated in a pnpm-managed project # Python Aliases -alias py="python" -alias py3="python3" -alias pip="pip3" -alias pipup="pip install --upgrade" -alias pyvenv="python3 -m venv" -alias pyactivate="source venv/bin/activate" -alias pydeactivate="deactivate" -alias pyrun="python" -alias pycheck="python -m py_compile" -alias pytest="python -m pytest" -alias pydoc="python -m pydoc" -alias pylist="pip list" -alias pyfreeze="pip freeze" -alias pyinstall="pip install" -alias pyuninstall="pip uninstall" +alias py="python" # Run Python (default version) +alias py3="python3" # Run Python 3 +alias pip="pip3" # Use pip3 for installing Python packages +alias pipup="pip install --upgrade" # Upgrade installed Python packages +alias pyvenv="python3 -m venv" # Create a virtual environment in Python 3 +alias pyactivate="source venv/bin/activate" # Activate a Python virtual environment +alias pydeactivate="deactivate" # Deactivate the Python virtual environment +alias pyrun="python" # Run a Python script with the default Python +alias pycheck="python -m py_compile" # Check the syntax of a Python file (compile it) +alias pytest="python -m pytest" # Run tests using pytest +alias pydoc="python -m pydoc" # Access Python documentation via pydoc +alias pylist="pip list" # List installed Python packages +alias pyfreeze="pip freeze" # Show installed Python packages and their versions +alias pyinstall="pip install" # Install Python packages +alias pyuninstall="pip uninstall" # Uninstall Python packages # C++ Aliases -alias cpp-compile="g++ -std=c++17 -Wall -Wextra -o output" -alias cpp-run="g++ -std=c++17 -Wall -Wextra -o output && ./output" -alias cpp-compile-opt="g++ -std=c++17 -O2 -Wall -Wextra -o output" -alias cpp-clean="rm -f output" -alias cpp-build-all="g++ -std=c++17 -Wall -Wextra *.cpp -o output" -alias cpp-edit="nano" -alias cpp-exec="./output" +alias cpp-compile="g++ -std=c++17 -Wall -Wextra -o output" # Compile C++ code with g++ (C++17 standard) +alias cpp-run="g++ -std=c++17 -Wall -Wextra -o output && ./output" # Compile and run C++ code +alias cpp-compile-opt="g++ -std=c++17 -O2 -Wall -Wextra -o output" # Compile C++ code with optimization +alias cpp-clean="rm -f output" # Remove the compiled output file +alias cpp-build-all="g++ -std=c++17 -Wall -Wextra *.cpp -o output" # Compile all C++ files in the directory +alias cpp-edit="nano" # Open C++ code in the nano editor +alias cpp-exec="./output" # Execute the compiled C++ output # Rust Aliases -alias rustc="rustc" -alias rust-run="cargo run" -alias rust-build="cargo build" -alias rust-build-rel="cargo build --release" -alias rust-test="cargo test" -alias rust-clean="cargo clean" -alias rust-fmt="cargo fmt" -alias rust-clippy="cargo clippy" -alias rust-doc="cargo doc --open" -alias rust-new="cargo new" -alias rust-init="cargo init" -alias rust-add="cargo add" -alias rust-upd="rustup update" -alias rust-ver="rustc --version" -alias rust-watch="cargo watch -x run" -alias rust-deps="cargo tree" -alias rust-check="cargo check" -alias rust-ls="ls -alh --color=auto" +alias rustc="rustc" # Run the Rust compiler +alias rust-run="cargo run" # Build and run a Rust project with Cargo +alias rust-build="cargo build" # Build the Rust project with Cargo +alias rust-build-rel="cargo build --release" # Build the Rust project in release mode +alias rust-test="cargo test" # Run tests in a Rust project +alias rust-clean="cargo clean" # Clean up build artifacts in a Rust project +alias rust-fmt="cargo fmt" # Format Rust code using Cargo's built-in formatter +alias rust-clippy="cargo clippy" # Run Clippy for Rust code linting +alias rust-doc="cargo doc --open" # Build and open Rust documentation +alias rust-new="cargo new" # Create a new Rust project with Cargo +alias rust-init="cargo init" # Initialize an existing directory as a Rust project +alias rust-add="cargo add" # Add dependencies to a Rust project +alias rust-upd="rustup update" # Update Rust toolchain with rustup +alias rust-ver="rustc --version" # Display the installed Rust version +alias rust-watch="cargo watch -x run" # Run a Rust project with automatic rebuilds on code changes +alias rust-deps="cargo tree" # Display the dependency tree of a Rust project +alias rust-check="cargo check" # Check the Rust code without building +alias rust-ls="ls -alh --color=auto" # List files in a directory with color # Web Developer Aliases -## Frontend Frameworks ### React -alias react-create="npx create-react-app my-app --template typescript" -alias react-build="npm run build" -alias react-start="npm start" -alias react-test="npm test" -alias react-lint="npm run lint" +alias react-create="npx create-react-app my-app --template typescript" # Create a new React app with TypeScript template +alias react-build="npm run build" # Build the React app for production +alias react-start="npm start" # Start the React app in development mode +alias react-test="npm test" # Run tests in the React app +alias react-lint="npm run lint" # Lint the React app's code ### Angular -alias ng-create="ng new my-app" -alias ng-serve="ng serve" -alias ng-build="ng build" -alias ng-test="ng test" -alias ng-lint="ng lint" +alias ng-create="ng new my-app" # Create a new Angular project +alias ng-serve="ng serve" # Serve the Angular app in development mode +alias ng-build="ng build" # Build the Angular app for production +alias ng-test="ng test" # Run tests in the Angular app +alias ng-lint="ng lint" # Lint the Angular app's code ### Vue -alias vue-create="vue create my-app" -alias vue-serve="npm run serve" -alias vue-build="npm run build" -alias vue-test="npm run test" -alias vue-lint="npm run lint" +alias vue-create="vue create my-app" # Create a new Vue app +alias vue-serve="npm run serve" # Serve the Vue app in development mode +alias vue-build="npm run build" # Build the Vue app for production +alias vue-test="npm run test" # Run tests in the Vue app +alias vue-lint="npm run lint" # Lint the Vue app's code ## Backend Frameworks ### Node.js -alias node-init="npm init -y" -alias node-start="node index.js" +alias node-init="npm init -y" # Initialize a new Node.js project with default settings +alias node-start="node index.js" # Start a Node.js app (index.js) ### Express -alias express-create="npm install express" -alias express-start="node index.js" +alias express-create="npm install express" # Install Express.js for a project +alias express-start="node index.js" # Start an Express app (index.js) ### Django -alias django-create="django-admin startproject myproject" -alias django-run="python manage.py runserver" -alias django-migrate="python manage.py migrate" -alias django-app="python manage.py startapp myapp" -alias django-shell="python manage.py shell" +alias django-create="django-admin startproject myproject" # Create a new Django project +alias django-run="python manage.py runserver" # Start the Django development server +alias django-migrate="python manage.py migrate" # Run database migrations in Django +alias django-app="python manage.py startapp myapp" # Create a new Django app within the project +alias django-shell="python manage.py shell" # Open Django shell for interactive work ### Flask -alias flask-run="flask run" -alias flask-env="export FLASK_ENV=development" -alias flask-app="export FLASK_APP=app.py" +alias flask-run="flask run" # Run a Flask app in development mode +alias flask-env="export FLASK_ENV=development" # Set Flask environment to development +alias flask-app="export FLASK_APP=app.py" # Set the entry point for Flask app (app.py) # Miscellaneous Web Development Tools -alias webpack-build="webpack --mode production" -alias webpack-dev="webpack --mode development" -alias sass-watch="sass --watch src/scss:dist/css" -alias tailwind-init="npx tailwindcss init" -alias tailwind-build="npx tailwindcss build src/styles.css -o dist/styles.css" +alias webpack-build="webpack --mode production" # Build project using Webpack in production mode +alias webpack-dev="webpack --mode development" # Build project using Webpack in development mode +alias sass-watch="sass --watch src/scss:dist/css" # Watch and compile SASS files to CSS +alias tailwind-init="npx tailwindcss init" # Initialize Tailwind CSS configuration file +alias tailwind-build="npx tailwindcss build src/styles.css -o dist/styles.css" # Build Tailwind CSS styles # Database Management -alias mysql-start="sudo systemctl start mysql" -alias mysql-stop="sudo systemctl stop mysql" -alias psql-start="sudo systemctl start postgresql" -alias psql-stop="sudo systemctl stop postgresql" -alias mongo-start="sudo systemctl start mongod" -alias mongo-stop="sudo systemctl stop mongod" +alias mysql-start="sudo systemctl start mysql" # Start MySQL service +alias mysql-stop="sudo systemctl stop mysql" # Stop MySQL service +alias psql-start="sudo systemctl start postgresql" # Start PostgreSQL service +alias psql-stop="sudo systemctl stop postgresql" # Stop PostgreSQL service +alias mongo-start="sudo systemctl start mongod" # Start MongoDB service +alias mongo-stop="sudo systemctl stop mongod" # Stop MongoDB service # Docker Aliases -alias docker-start="sudo systemctl start docker" -alias docker-stop="sudo systemctl stop docker" -alias docker-ps="docker ps" -alias docker-build="docker build -t" -alias docker-run="docker run -d -p" -alias docker-exec="docker exec -it" +alias docker-start="sudo systemctl start docker" # Start Docker service +alias docker-stop="sudo systemctl stop docker" # Stop Docker service +alias docker-ps="docker ps" # List running Docker containers +alias docker-build="docker build -t" # Build a Docker image with the specified tag +alias docker-run="docker run -d -p" # Run a Docker container in detached mode with port binding +alias docker-exec="docker exec -it" # Execute commands inside a running Docker container # Kubernetes Aliases -alias k-start="kubectl apply -f" -alias k-stop="kubectl delete -f" -alias k-get-pods="kubectl get pods" -alias k-get-services="kubectl get services" -alias k-logs="kubectl logs" -alias k-exec="kubectl exec -it" +alias k-start="kubectl apply -f" # Apply Kubernetes configuration from a file +alias k-stop="kubectl delete -f" # Delete Kubernetes resources defined in a file +alias k-get-pods="kubectl get pods" # Get the list of Kubernetes pods +alias k-get-services="kubectl get services" # Get the list of Kubernetes services +alias k-logs="kubectl logs" # View logs of a specific Kubernetes pod +alias k-exec="kubectl exec -it" # Execute commands inside a Kubernetes pod # DevOps and CI/CD -alias ansible-play="ansible-playbook" -alias terraform-init="terraform init" -alias terraform-apply="terraform apply" -alias terraform-plan="terraform plan" \ No newline at end of file +alias ansible-play="ansible-playbook" # Run an Ansible playbook +alias terraform-init="terraform init" # Initialize Terraform project +alias terraform-apply="terraform apply" # Apply Terraform configuration to provision resources +alias terraform-plan="terraform plan" # Preview changes Terraform will make to infrastructure