-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Luis Miguel P. Freitas edited this page Mar 23, 2025
·
10 revisions
Welcome to the DXS Bash Documentation
The .bashrc file is a script that runs every time a new terminal session is started in Unix-like operating systems. It is used to configure the shell session, set up aliases, define 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.
- Environment Checks: The script checks if it is running in an interactive mode and sets up the environment accordingly.
-
System Utilities: It checks for the presence of utilities like
fastfetch,bash-completion, and system-specific configurations (/etc/bashrc).
-
Aliases: Shortcuts for common commands are set up to enhance productivity. For example,
alias cp='cp -i'makes thecpcommand interactive, asking for confirmation before overwriting files. -
Functions: Custom functions for complex operations like
extract()for extracting various archive types, andcpp()for copying files with a progress bar.
-
Prompt Command: The
PROMPT_COMMANDvariable 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.
-
Editor Settings: Sets
nanoas the default editor. -
Conditional Aliases: Depending on the system type (like Fedora), it sets specific aliases, e.g., replacing
catwithbat.
-
Color and Formatting: Enhancements for command output readability using colors and formatting for tools like
ls,grep, andman. -
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
trashinstead ofrmfor 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.
-
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.
-
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.
To uninstall, execute the following commands:
cd ~
sudo ./reset-bash-profile.sh [username]
To update all files on dxsbash, execute the following commands:
cd ~
./update-dxsbash.sh
DigitalXS - Programming and Development (2025) - By Luis Miguel P. Freitas