Give me a complete list of aliases to put into my .bashrc, including q for exit and c…
- User
Give me a complete list of aliases to put into my .bashrc, including q for exit and c for clear, and also don't forget yt-dlp aliases (480p resolution, 720, 1080, just the audio, etc). Also add an alias for using reflector to save the most recently updated (not fastest connection) arch repo mirrors to mirrorlist.
- Assistant
Okay, here is a comprehensive list of aliases you can add to your
~/.bashrcfile. I've grouped them by category and added comments to explain what each one does.Instructions:
- Open your
~/.bashrcfile in a text editor (e.g.,nano ~/.bashrc,vim ~/.bashrc). - Copy and paste the entire block of aliases below into the file.
- Save the file.
- Apply the changes by either closing and reopening your terminal or running
source ~/.bashrc.
# ========================================= # Custom Aliases # Add your custom aliases here # ========================================= # ----------------------------------------- # Basic Navigation & File Management # ----------------------------------------- # Short aliases for basic commands alias c='clear' # Clear the terminal screen alias q='exit' # Exit the current shell session # Enhanced file listing alias ls='ls --color=auto' # Always use color output for ls alias ll='ls -lh' # Long list format with human-readable sizes alias la='ls -a' # List all files including hidden ones alias lla='ls -alh' # Long list of all files including hidden ones alias lt='ls -lht' # Long list sorted by modification time (newest first) # Easier directory navigation alias ..='cd ..' # Go up one directory alias ...='cd ../..' # Go up two directories alias ....='cd ../../..' # Go up three directories alias -- -='cd -' # Go to the previous directory (handy built-in, aliased for clarity) # Make commands more informative alias dfh='df -h' # Show disk space in human-readable format alias duh='du -sh' # Show disk usage of current directory in human-readable format # Safety first alias rm='rm -i' # Always prompt before removing files (use \rm to force without prompt) alias mv='mv -i' # Always prompt before overwriting (use \mv to force without prompt) alias cp='cp -i' # Always prompt before overwriting (use \cp to force without prompt) # grep with color alias grep='grep --color=auto' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' # ----------------------------------------- # System Updates & Package Management (Arch Linux) # Adjust these if you use a different distribution # ----------------------------------------- # Update system alias update='sudo pacman -Syu' # Full system update alias updateforce='sudo pacman -Syyu' # Force refresh and update # Package management alias install='sudo pacman -S' # Install a package alias remove='sudo pacman -Rns' # Remove a package and its dependencies not needed by others, plus config files alias search='pacman -Ss' # Search for packages alias info='pacman -Qi' # Show info about an installed package alias files='pacman -Qo' # Show which package owns a file alias orphans='sudo pacman -Qtdq' # List orphaned packages (dependencies not needed by anything) alias cleanup='sudo pacman -Rns $(pacman -Qtdq)' # Remove orphaned packages # Reflector alias: Update mirrorlist with most recently updated mirrors # This finds the 20 most recently updated mirrors and sorts them by age. # Adjust --latest 20 to the number of mirrors you want. # Requires sudo and assumes you are on Arch Linux with reflector installed. alias updatemirrors='sudo reflector --latest 20 --sort age --save /etc/pacman.d/mirrorlist' # ----------------------------------------- # yt-dlp Aliases # Download videos/audio from YouTube and other sites # Ensure you have yt-dlp installed # ----------------------------------------- # Note: These aliases use format codes to select specific quality/type. # The syntax bestvideo[height<=N]+bestaudio selects the best video stream # with a height up to N pixels and merges it with the best audio stream. alias ytbest='yt-dlp -f "bestvideo+bestaudio/best"' # Download the best quality video and audio alias yt480='yt-dlp -f "bestvideo[height<=480]+bestaudio"' # Download video up to 480p and best audio alias yt720='yt-dlp -f "bestvideo[height<=720]+bestaudio"' # Download video up to 720p (HD) and best audio alias yt1080='yt-dlp -f "bestvideo[height<=1080]+bestaudio"' # Download video up to 1080p (Full HD) and best audio alias ytaudio='yt-dlp -x --audio-format mp3' # Download only the audio, converted to mp3 alias ytaudiobest='yt-dlp -x --audio-quality 0 --audio-format best' # Download only the audio in best available format # Utility aliases for yt-dlp alias ytformats='yt-dlp --list-formats' # List available formats for a video alias ytinfo='yt-dlp --print-json' # Print video info in JSON format alias ytthumb='yt-dlp --write-thumbnail --skip-download' # Download only the thumbnail image # ----------------------------------------- # Git Aliases (Optional but Recommended) # Basic aliases for common git commands # ----------------------------------------- alias gs='git status' alias ga='git add' alias gall='git add .' # Add all changes in the current directory alias gc='git commit -v' # -v shows diff of commit alias gca='git commit -av' # Add all tracked changes and commit alias gp='git push' alias gl='git pull' alias gco='git checkout' alias gb='git branch' alias gd='git diff' alias gdc='git diff --cached' # Diff against staging area alias gm='git merge' alias gr='git rebase' alias gstash='git stash' alias glog='git log --oneline --graph --decorate --all' # Pretty git log # ----------------------------------------- # Editor Alias (Example) # Change 'nano' to your preferred editor like 'vim', 'emacs', 'code', etc. # ----------------------------------------- alias edit='nano' # ----------------------------------------- # End of Custom Aliases # =========================================Explanation of Key Aliases:
- Basic:
c(clear),q(exit), enhancedlscommands (ll,la,lla,lt), directory navigation (..,...,....), disk usage (dfh,duh), safety (rm,mv,cpwith-i), coloredgrep. - System (Arch):
update,updateforce,install,remove,search,info,files,orphans,cleanupforpacman. - Reflector:
updatemirrorsrunssudo reflector --latest 20 --sort age --save /etc/pacman.d/mirrorlist. This finds the 20 most recently synchronized mirrors and sorts them by age (recency) before saving the list. You might need to adjust--latest 20. - yt-dlp:
ytbest: Downloads the highest quality video and audio available.yt480,yt720,yt1080: Download video up to the specified height, merged with the best audio.ytaudio: Extracts and converts the audio to MP3.ytaudiobest: Extracts the audio in its best available format.ytformats,ytinfo,ytthumb: Utility aliases to inspect or download specific parts (like thumbnails) without the full video.
- Git: A selection of common Git commands shortened for convenience.
- Editor: A simple alias to open your preferred text editor.
Remember to
source ~/.bashrcor open a new terminal after adding these aliases for them to take effect. Enjoy your more efficient command line! - Open your
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.