Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
49
rated 0 times [  49] [ 0]  / answers: 1 / hits: 53134  / 3 Years ago, tue, september 21, 2021, 11:36:45

I want to save my alias commands forever like the default ones when I type "alias" so I don't retype them every time I leave my bash


More From » bash

 Answers
0

In Ubuntu, the default .bashrc skeleton file looks for a .bash_aliases file in your home directory when you log in and sources it. So if you just create a .bash_aliases file and put any aliases you want in it, it should be sourced automatically when you open a new bash shell (no need to log out of desktop and back in, just open a new terminal). Here's the relevant part in the default .bashrc file:



# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

[#35264] Thursday, September 23, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
housecoarmer

Total Points: 434
Total Questions: 116
Total Answers: 120

Location: Albania
Member since Sun, Nov 22, 2020
4 Years ago
;