Table of Contents
.bashrc
The .bashrc file is a script that runs every time a new Linux terminal session is started in Unix-like operating systems. It is used to configure the shell session, set up Bash aliases, define Bash functions, and more, making the terminal easier to use and more powerful. Below is a summary of the key sections and functionalities defined in the provided .bashrc file.
Setup
This sets up mybash for you. It will backup your current bashrc if you already have one.
mkdir -p ~/build
cd ~/build
git clone https://github.com/christitustech/mybash
cd mybash
./setup.sh
Copy
Aliases and Functions
Aliases: Shortcuts for common commands are set up to enhance productivity. For example, alias cp='cp -i' makes the cp command interactive, asking for confirmation before overwriting files. Functions: Custom functions for complex operations like extract() for extracting various archive types, and cpp() for copying files with a progress bar.
Prompt Customization and History Management
Prompt Command: The PROMPT_COMMAND variable is set to automatically save the command history after each command.
- History Control: Settings to manage the size of the history file and how duplicates are handled.
System-Specific Aliases and Settings
Editor Settings: Sets nvim (NeoVim) as the default editor.
Conditional Aliases: Depending on the system type (like Fedora), it sets specific aliases, e.g., replacing cat with bat. Enhancements and Utilities Color and Formatting: Enhancements for command output readability using colors and formatting for tools like ls, grep, and man. Navigation Shortcuts: Aliases to simplify directory navigation, e.g., alias ..='cd ..' to go up one directory. Safety Features: Aliases for safer file operations, like using trash instead of rm for deleting files, to prevent accidental data loss. Extensive Zoxide support: Easily navigate with z, zi, or pressing Ctrl+f to launch zi to see frequently used navigation directories. Advanced Functions System Information: Functions to display system information like distribution() to identify the Linux distribution. Networking Utilities: Tools to check internal and external IP addresses. Resource Monitoring: Commands to monitor system resources like disk usage and open ports. Installation and Configuration Helpers Auto-Install: A function install_bashrc_support() to automatically install necessary utilities based on the system type. Configuration Editors: Functions to edit important configuration files directly, e.g., apacheconfig() for Apache server configurations.
Conclusion
This .bashrc file is a comprehensive setup that not only enhances the shell experience with useful aliases and functions but also provides system-specific configurations and safety features to cater to different user needs and system types. It is designed to make the terminal more user-friendly, efficient, and powerful for an average user.
Walkthrough Video
Bash Vocabulary List (Sorted by Popularity)
Bash Programming Language, Bash Shell, Bash Scripting, Bash Command Line, Bash Command, Bash Variable, Bash Environment Variable, Bash PATH Variable, Bash cd Command, Bash ls Command, Bash echo Command, Bash if Statement, Bash for Loop, Bash while Loop, Bash until Loop, Bash case Statement, Bash function Definition, Bash array Variable, Bash associative Array, Bash declare Command, Bash typeset Command, Bash local Variable, Bash global Variable, Bash positional Parameters, Bash $0 Variable, Bash $1 Variable, Variable, Bash $* Variable, Bash $@ Variable, Bash $, Bash $$ Variable, Bash $! Variable, Bash $- Variable, Bash IFS Variable, Bash PS1 Prompt, Bash PS2 Prompt, Bash PS4 Prompt, Bash HOME Variable, Bash USER Variable, Bash HOSTNAME Variable, Bash OSTYPE Variable, Bash SHELL Variable, Bash TERM Variable, Bash exit Command, Bash return Command, Bash break Command, Bash continue Command, Bash read Command, Bash printf Command, Bash test Command, Bash [ Command, Bash [[ Command], Bash builtin Command, Bash type Command, Bash command Command, Bash hash Command, Bash alias Command, Bash unalias Command, Bash set Command, Bash shopt Command, Bash export Command, Bash unset Command, Bash readonly Command, Bash trap Command, Bash wait Command, Bash kill Command, Bash jobs Command, Bash fg Command, Bash bg Command, Bash disown Command, Bash exec Command, Bash time Command, Bash times Builtin, Bash source Command, Bash . Command (Dot Command), Bash eval Command, Bash complete Command, Bash compgen Command, Bash compopt Command, Bash history Command, Bash fc Command, Bash pushd Command, Bash popd Command, Bash dirs Command, Bash pwd Command, Bash oldpwd Variable, Bash command Substitution, Bash $( ) Syntax, Bash Backticks `...`, Bash Variable Substitution, Bash Parameter Expansion, Bash ${var} Syntax, -default}, =default}, Bash ${var, +replacement}, var}, Bash ${var%pattern}, Bash ${var%%pattern}, pattern}, #pattern}, length}, Bash Arithmetic Expansion, Bash $(( expression )) Syntax, Bash (( ... )) Arithmetic, Bash Globbing, Bash Filename Expansion, Bash Wildcard *, Bash Wildcard , Bash Character Class [...], Bash Brace Expansion, Bash {1..10} Expansion, Bash {a,b,c} Expansion, Bash Tilde Expansion, Bash ~ User Home Expansion, Bash ~+ Expansion ($PWD), Bash ~- Expansion ($OLDPWD), Bash aliasing Commands, Bash .bashrc File, Bash .bash_profile File, Bash .profile File, Bash .bash_login File, Bash .bash_history File, Bash /etc/bashrc File, Bash /etc/profile File, Bash elif Keyword, Bash else Keyword, Bash fi Keyword, Bash Arithmetic Conditions (( )), Bash String Comparisons, Bash Integer Comparisons (-eq, -ne, -gt, -lt), Bash File Conditions (-f, -d, -e, -r, -w, -x), | !, Bash Pipeline Operator, Bash pipefail Option, Bash Redirection >, Bash Redirection >>, Bash Redirection <, Bash Redirection << (Here-Doc), Bash Redirection <<< (Here-String), Bash Redirection &>, Bash Redirection 2>, Bash Redirection &>>, Bash Redirection 2>>, Bash Redirection >, Bash noclobber Option, Bash Built-in Commands, Bash test Builtin, Bash Arithmetic Command (( )), Bash compgen Builtin, Bash environment Files, Bash read -p Prompt, Bash read -r Raw Input, Bash mapfile Command, Bash mapfile -t Option, Bash shopt -s histappend, Bash shopt -s cdspell, Bash shopt -s checkwinsize, Bash shopt -s cmdhist, Bash shopt -s dotglob, Bash shopt -s extglob, Bash shopt -s extdebug, Bash shopt -s globstar, Bash shopt -s histreedit, Bash shopt -s histverify, Bash shopt -s hostcomplete, Bash shopt -s interactive_comments, Bash shopt -s login_shell, Bash shopt -s mailwarn, Bash shopt -s nocaseglob, Bash shopt -s nocasematch, Bash shopt -s nullglob, Bash shopt -s progcomp, Bash shopt -s promptvars, Bash shopt -s sourcepath, Bash shopt -s xpg_echo, Bash BASH_VERSION Variable, Bash BASH_VERSINFO Array, Bash BASHOPTS Variable, Bash BASH_ALIASES Array, Bash BASH_ARGC Array, Bash BASH_ARGV Array, Bash BASH_CMDS Array, Bash BASH_LINENO Array, Bash BASH_SOURCE Array, Bash BASH_SUBSHELL Variable, Bash BASH_XTRACEFD Variable, Bash BASH_REMATCH Array, Bash COMP_CWORD Variable, Bash COMP_LINE Variable, Bash COMP_POINT Variable, Bash COMP_WORDS Array, Bash COMP_KEY Variable, Bash COMP_TYPE Variable, Bash COMP_REPLY Array, Bash COLUMNS Variable, Bash EUID Variable, Bash GROUPS Array, Bash HISTCMD Variable, Bash HOSTTYPE Variable, Bash LINENO Variable, Bash MACHTYPE Variable, Bash OPTARG Variable, Bash OPTIND Variable, Bash PPID Variable, Bash PWD Variable, Bash RANDOM Variable, Bash SECONDS Variable, Bash SHELLOPTS Variable, Bash SHLVL Variable, Bash UID Variable, Bash set -e Option, Bash set -u Option, Bash set -x Option, Bash set -o pipefail, Bash set -o nounset, Bash set -o errexit, Bash set -o xtrace, Bash set -o noglob, Bash set -o ignoreeof, Bash set -o vi, Bash set -o emacs, Bash PROMPT_COMMAND Variable, Bash PROMPT_DIRTRIM Variable, Bash completion (Tab Completion), Bash arithmetic $(( )) again for clarity, Bash (( ... )) Double Paren, Bash coproc Command, Bash co-processes, Bash read -s Silent Input, Bash read -n N Characters, Bash exec Redirection, Bash exec >file, Bash exec <file, Bash exec 3>file, Bash exec 3<file, Bash exec 3<>file, Bash test -f Check, Bash test -d Check, Bash test -r Check, Bash test -w Check, Bash test -x Check, Bash test -s Check, Bash test -z Empty String Check, Bash test -n Non-empty String, Bash test -eq Integer Equal, Bash test -ne Integer Not Equal, Bash test -gt Greater Than, Bash test -lt Less Than, Bash test -ge Greater Equal, Bash test -le Less Equal, Bash declare -i Integer Variable, Bash declare -r Read-only, Bash declare -x Export Variable, Bash printf Formatting, Bash shift Command, (Colon) No-Op, Bash true Command Builtin, Bash false Command Builtin, Bash export -f Function Export, Bash read -a Read into Array, Bash read -d Delimiter, Bash read -t Timeout, Bash compgen -A function, Bash compgen -A alias, Bash compgen -A builtin, Bash compgen -A command, Bash compgen -A file, Bash ulimit Command, Bash dirs stack Command, Bash fc -s Redo Command, Bash globstar ** Pattern, Bash extglob @(), !(), *(), +(), , Bash suspend Command, Bash jobs -l Option, Bash jobs -p Option, Bash kill -l List Signals, Bash kill -s Send Signal By Name, Bash disown -r Option, Bash fc -e Editor Mode, Bash readarray Command, Bash cd -P Option, Bash cd -L Option, Bash set +o Disable Option, Bash BASH_ENV Variable, Bash shopt -s cdable_vars, Bash shopt -s autocd, Bash shopt -s dirspell, Bash globstar ** repeated concept for emphasis, Bash SIGINT Trap, Bash SIGTERM Trap, Bash cd oldpwd with cd - used conceptually, Bash read -s for password input, Bash read -n for limited chars, Bash exec 3>&1 duplicate fd, Bash exec 2>&1 redirect stderr to stdout, Bash command substitution in $( ) repeated concept, Bash arrays indexing ${array[0]}, array[@]}, Bash associative arrays declare -A, Bash indexing associative arrays ${assoc[key]}, Bash advanced completion with complete command, Bash bind Keybindings, Bash bind -P Show Keybindings, Bash bind -S Show Settable Options, Bash bind -X Show Keyseq Functions, Bash line editing vi mode repeated concept, Bash line editing emacs mode repeated concept, Bash fc -l List history range, Bash fc -r Reverse order history listing, Bash dirs +N Switch Stacks, Bash dirs -N Switch Stacks, Bash dirs -p Print One per Line, Bash dirs -l Long Listing, Bash kill -9 Hard Kill, Bash kill -INT Interrupt, Bash kill -TERM Terminate
Bash: bashrc, Bash Fundamentals, Bash Inventor - Bash Language Designer: Brian Fox on June 8, 1989 at urging of Richard Stallman of Free Software Foundation (FSF); Chet Ramey is now the maintainer. Bash Scripting, Bash DevOps - Bash SRE, Cloud Native Bash (Bash on Kubernetes - Bash on AWS - Bash on Azure - Bash on GCP), Bash Microservices, Bash Containerization (Bash Docker - Bash on Docker Hub), Serverless Bash, Bash Data Science - Bash DataOps - Bash and Databases (Bash ORM), Bash ML - Bash DL, Functional Bash (1. Bash Immutability, 2. Bash Purity - Bash No Side-Effects, 3. Bash First-Class Functions - Bash Higher-Order Functions, Bash Lambdas - Bash Anonymous Functions - Bash Closures, Bash Lazy Evaluation, 4. Bash Recursion), Reactive Bash), Bash Concurrency - Bash Parallel Programming - Async Bash, Bash Networking, Bash Security - Bash DevSecOps - Bash OAuth, Bash Memory Allocation (Bash Heap - Bash Stack - Bash Garbage Collection), Bash CI/CD - Bash Dependency Management - Bash DI - Bash IoC - Bash Build Pipeline, Bash Automation - Bash Scripting, Bash Package Managers, Bash Modules - Bash Packages, Bash Installation (Bash Windows - Chocolatey Bash, Bash macOS - Homebrew Bash, Bash on Linux), Bash Configuration, Bash Observability (Bash Monitoring, Bash Performance - Bash Logging), Bash Language Spec - Bash RFCs - Bash Roadmap, Bash Keywords, Bash Operators, Bash Functions, Bash Data Structures - Bash Algorithms, Bash Syntax, Bash OOP (1. Bash Encapsulation - 2. Bash Inheritance - 3. Bash Polymorphism - 4. Bash Abstraction), Bash Design Patterns - Bash Best Practices - Bash Style Guide - Clean Bash - Bash BDD, Bash Generics, Bash I/O, Bash Serialization - Bash Deserialization, Bash APIs, Bash REST - Bash JSON - Bash GraphQL, Bash gRPC, Bash Virtualization, Bash Development Tools: Bash SDK, Bash Compiler - Bash Transpiler, Bash Interpreter - Bash REPL, Bash IDEs (JetBrains Bash, Bash Visual Studio Code), Bash Linter, Bash Community - Bashaceans - Bash User, Bash Standard Library - Bash Libraries - Bash Frameworks, Bash Testing - Bash TDD, Bash History, Bash Research, Bash Topics, Bash Uses - List of Bash Software - Written in Bash - Bash Popularity, Bash Bibliography - Bash Courses, Bash Glossary - Bash Official Glossary, Bash GitHub, Awesome Bash. (navbar_bash)
Linux, kernel, systemd, init, GRUB (GRand Unified Bootloader), initramfs, ext4 (Fourth Extended Filesystem), XFS, Btrfs (B-Tree File System), zram, zswap, cgroups (Control Groups), namespaces, selinux (Security-Enhanced Linux), AppArmor, iptables, nftables, firewalld, auditd, journald, syslog, logrotate, dmesg, udev, eBPF (Extended Berkeley Packet Filter), KVM (Kernel-based Virtual Machine), QEMU (Quick Emulator), VirtIO, LXC (Linux Containers), Docker, Podman, CRI-O, Kubernetes Integration, etcd, Linux Control Groups, LXD (Linux Daemon), Snap, Flatpak, AppImage, RPM (Red Hat Package Manager), dpkg (Debian Package Manager), APT (Advanced Package Tool), YUM (Yellowdog Updater, Modified), DNF (Dandified YUM), Pacman, Zypper, Portage, emerge, Nix, pkg-config, ldconfig, make, cmake, autoconf, automake, configure, GCC (GNU Compiler Collection), Clang, glibc (GNU C Library), musl, libstdc++, libc, binutils, GNU Coreutils, Bash (Bourne Again Shell), Zsh (Z Shell), Fish Shell, dash, sh, SSH (Secure Shell), sshd (SSH Daemon), scp (Secure Copy), rsync, SCP (Secure Copy Protocol), wget, curl, ftp, sftp, TFTP (Trivial File Transfer Protocol), NFS (Network File System), CIFS (Common Internet File System), Samba, autofs, mount, umount, lsblk, blkid, parted, fdisk, gdisk, mkfs, fsck, tune2fs, xfs_repair, btrfs-progs, mdadm (Multiple Device Admin), RAID (Redundant Array of Independent Disks), LVM (Logical Volume Manager), thin provisioning, lvcreate, lvremove, vgcreate, vgremove, pvcreate, pvremove, multipath-tools, ISCSI (Internet Small Computer Systems Interface), nvme-cli, dm-crypt, cryptsetup, LUKS (Linux Unified Key Setup), dracut, GRUB Customizer, PXE (Preboot Execution Environment), tftpboot, Syslinux, LiveCD, LiveUSB, mkbootdisk, dd, cpio, tar, gzip, bzip2, xz, 7zip, zstd, rsyslog, sysctl, lsmod, modprobe, depmod, modinfo, insmod, rmmod, kmod, dkms (Dynamic Kernel Module Support), kernel tuning, kernel headers, kernel modules, patch, diff, strace, ltrace, ptrace, perf, htop, top, iotop, atop, vmstat, mpstat, sar, dstat, iostat, uptime, free, df, du, ps, pidstat, nice, renice, kill, pkill, killall, jobs, bg, fg, wait, nohup, screen, tmux, cron, crontab, at, anacron, systemctl, service, chkconfig, rc-update, update-rc.d, ntpd (Network Time Protocol Daemon), chronyd, hwclock, timedatectl, ntpdate, ufw (Uncomplicated Firewall), iptables-save, iptables-restore, fail2ban, denyhosts, tcp_wrappers, libcap, setcap, getcap, auditctl, ausearch, kernel parameters, boot parameters, sysfs, procfs, debugfs, tmpfs, ramfs, overlayfs, aufs, bind mounts, chroot, pivot_root, overlay2, network namespaces, bridge-utils, iproute2, ip, ifconfig, route, netstat, ss, arp, ping, traceroute, mtr, tcpdump, ngrep, nmap, arp-scan, ethtool, iwconfig, iw, wpa_supplicant, hostapd, dnsmasq, networkmanager, nmcli, nmtui, system-config-network, dhclient, dhcpd, isc-dhcp-server, bind9, named, unbound, nslookup, dig, resolvconf, iptables, nftables, firewalld, conntrack, ipset, snort, suricata, tcp_wrappers, rkhunter, chkrootkit, clamav, lynis, openvpn, strongswan, libreswan, openconnect, network namespaces, virtual ethernet, veth, tap interfaces, tun interfaces, vlan, bridge, brctl, ovs-vsctl, openvswitch, macvlan, ipvlan, bonding, teamd, network teaming, multipath, multipath-tools, route tables, ip rule, ip route, policy routing, qos, tc (Traffic Control), htb, fq_codel, cake, iptables NAT, iptables MASQUERADE, squid, socks5, privoxy, tor, iptables DNAT, iptables SNAT, iptables REDIRECT, conntrack, stateful firewall, stateless firewall, tcp_window_scaling, tcp_timestamps, tcp_sack, tcp_rmem, tcp_wmem, tcp_no_metrics_save, tcp_ecn, netem, ip6tables, ipset, ebtables, arptables, bridge-nf, br_netfilter, openvswitch, gre tunnels, ipip tunnels, vxlan, gretap, macsec, macvlan, ipvlan, wireguard, strongswan, libreswan, xfrm, ipsec, isakmpd, racoon, openswan, ikev2, ikev1, vpn tunnels, gre tunnels, vxlan tunnels, fou tunnels, ipip tunnels.
Linux Core Utilities commands - GNU Core Utilities command-line interface programs
This list should really only include standard universal commands that come with GNU Core Utilities.
- tac
This should really only include standard universal commands that come with all Linux distributions adhering to the Single UNIX Specification.
Really this is “Unix programs”, since there are no commands in Unix, they are programs except for shell builtins.
Unix command-line interface programs and shell builtins:
Unix user environment commands:
[[env]]
Unix text processing commands:
[[alias (command) ]] | [[ alias]]
Note: Networking is not part of SUS
Unix network utility commands:
Unix software development commands: Note: There are a huge number of Linux software development tools / Unix software development tools; this list should be restricted to ones that are standardized as part of Unix, i.e., those marked SD, CD], or FD (http://pubs.opengroup.org/onlinepubs/9699919799/help/codes.html) within the Unix/POSIX specifications
See also
References
Linux Commands (ls, cd, pwd, cp, mv, rm, mkdir, rmdir, touch, cat, less, head, tail, grep, find, chmod, chown, chgrp, tar, gzip, gunzip, df, du, ps, top, kill, man, ssh, scp, rsync, vim, nano, sed, awk, ping, ifconfig, netstat, route, traceroute, dig), Linux Fundamentals, Linux Inventor: Linus Torvalds says “Linux sucks | Linux just sucks less.”, Linux Best Practices - Linux Anti-Patterns, Linux kernel, Linux commands-Linux Shells-Linux CLI-GNU-Linux GUI-X11, Linux DevOps-Linux development-Linux system programming-Bash-zsh-Linux API, Linux package managers, Linux configuration management (Ansible on Linux, Chef on Linux, Puppet on Linux, PowerShell on Linux), Linux Distros (RHEL-Rocky Linux-CentOS (CentOS Stream)-Oracle Linux-Fedora, Ubuntu-Debian-Linux Mint-Raspberry Pi OS-Kali Linux-Tails, openSUSE - SUSE Linux Enterprise Server (SLES), Arch Linux-Manjaro Linux, Alpine Linux-BusyBox - Slackware - Android-Chrome OS); UNIX-UNIX Distros (FreeBSD-OpenBSD, BSD, macOS), Linux networking, Linux storage, Linux secrets, Linux security (Linux IAM-LDAP-Linux Firewall-Linux Proxy), Linux docs, Linux GitHub, Linux Containers, Linux VM, Linux on AWS, Linux on Azure, Linux on GCP, Linux on Windows (WSL), Linux on IBM, Linux on Mainframe (Linux on IBM Z mainframe - Linux for System z - IBM LinuxONE), Embedded Linux, Linus IoT-Linux on Raspberry Pi, LinuxOps-Linux sysadmin, systemd-userland-kernel space-POSIX-SUS-Linux filesystem-Linux architecture, Linux books-UNIX books, Linux courses, Linux Foundation, Linux history, Linux philosophy, Linux adoption, Linux Glossary - Glossaire de Linux - French, Linux topics (navbar_linux and navbar_unix - see also navbar_fedora, navbar_rhel, navbar_centos, navbar_debian, navbar_ubuntu, navbar_linux_mint, navbar_freebsd, navbar_opensuse, navbar_manjaro, navbar_kali_linux, navbar_nixos, navbar_alpine_linux, navbar_tails_linux, navbar_slackware, navbar_rocky_linux, navbar_arch_linux, navbar_oracle_linux)
Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.