5

How I can add ll alias to ls -l command.

I can not find .bashrc file in my home. I tried to add into .bashrc.user file, but it does not work.

Yaron
  • 12,828
  • 7
  • 42
  • 55
  • 5
    something's not right if you don't have `.bashrc`. What's your setup and environment? – Zanna Feb 21 '18 at 12:23

3 Answers3

11

The package bash is installed by default on every Ubuntu version and flavour and contains the file /etc/skel/.bashrc, which is copied into every new user's home directory, so you should definitely have a file ~/.bashrc. If you accidentally removed it you can restore it by copying it again:

cp /etc/skel/.bashrc ~/

The file already by default contains these lines:

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

Your alias is available when you source the bashrc with . ~/.bashrc or just open a new session.

dessert
  • 39,392
  • 12
  • 115
  • 163
0

If the .bashrc file doesn't exist, you can create it in your home :

nano ~/.bashrc

then you can add your alias inside :

alias ll='ls -l'

But as Zanna is suggesting, this is not normal if you don't have this file

Félicien
  • 1,163
  • 1
  • 10
  • 18
  • 1
    `ll` is actually a default Ubuntu alias btw: `grep 'alias ll=' .bashrc` output: `alias ll='ls -alF'` – Zanna Feb 21 '18 at 12:39
0

You can create .bashrc file in your home directory. $vim ~/.bashrc $alias ll="ls -l" :wq To bring all modification in effect run following command $source .bashrc To see all alias you created run following command $alias