A simple script to manage and synchronize personal aliases across multiple Linux machines using Git.
This repository contains a setup script and aliases configuration that allows you to:
- Maintain a consistent set of aliases across all your Linux machines
- Version control your aliases using Git
- Easily deploy your aliases to new machines
- Keep your personal aliases separate from system/user existing configurations
- Fork this repository or create a new one
- Clone the repository to your local machine:
git clone https://github.com/eolasd/linux_aliases.git my-aliases
- Run the setup script:
chmod +x setup-aliases.sh ./setup-aliases.sh
- Source your
.bashrc
or start a new terminal session:source ~/.bashrc
.
├── README.md
├── setup-aliases.sh
└── aliases.sh
The setup-aliases.sh
script performs the following actions:
- Creates a
.personal_config
directory in your home folder - Clones your aliases repository (if not already present)
- Adds a source line to your
.bashrc
that won't interfere with existing settings - Creates an example
aliases.sh
if it doesn't exist
The default aliases.sh
includes these commonly used aliases:
alias ll='ls -la' # Detailed directory listing
alias ..='cd ..' # Move up one directory
alias ...='cd ../..' # Move up two directories
alias gst='git status' # Git status shorthand
alias gl='git log' # Git log shorthand
alias update='sudo apt update && sudo apt upgrade -y' # System update
alias timestamp='date "+%Y%m%d_%H%M%S"' # Current timestamp
alias myip='curl -s ifconfig.me' # Show public IP
-
Clone this repository:
git clone https://github.com/eolasd/my-aliases.git
-
Run the setup script:
cd my-aliases chmod +x setup-aliases.sh ./setup-aliases.sh
-
Start using your aliases:
source ~/.bashrc
-
Edit the
aliases.sh
file with your preferred aliases -
Commit and push your changes:
git add aliases.sh git commit -m "Updated aliases" git push origin main
-
On other machines, pull the updates:
cd ~/.personal_config/my-aliases git pull
-
Source your
.bashrc
to apply changes:source ~/.bashrc
To add your own aliases, edit the aliases.sh
file. Add your aliases below the existing ones:
# My custom aliases
alias project='cd ~/projects'
alias serve='python3 -m http.server'
# Add more aliases here
- If changes don't take effect immediately, make sure to source your
.bashrc
:source ~/.bashrc
- Check that the repository was cloned correctly:
ls ~/.personal_config/my-aliases
- Verify the source line in your
.bashrc
:grep "personal_config" ~/.bashrc
Feel free to fork this repository and customize it for your needs. If you develop improvements that might be useful to others, please submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.