Skip to main content
Markup and corrections
Source Link
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k

(MacOS Mojave Example)

  1. Go to your home directory:

    $ cd $HOME

  2. Then openOpen the hidden .bash_profile.bash_profile file in the viVim editor:

    $ vim .bash_profile

     vim ~/.bash_profile 
  3. Jump to the last character of the file by pressing capital GG and then $$.

  4. Press Io to be ableadd a new line to insert text in the vi editorfile.

  5. insertInsert your new alias like:

    $ alias ll='ls -lG'

     alias ll='ls -lG' 
  6. press control + cPress Esc to quitexit insert mode of viVim.

  7. typeType following to write and quite your new changes:

    $ and exit the editor:wq

  8. restart your terminal

     :wq 
  9. reopenReopen terminal and you should be able to use the alias llll

(MacOS Mojave Example)

  1. Go to your home directory:

    $ cd $HOME

  2. Then open the hidden .bash_profile file in the vi editor:

    $ vim .bash_profile

  3. Jump to the last character of the file by pressing capital G and then $

  4. Press I to be able to insert text in the vi editor

  5. insert your new alias like:

    $ alias ll='ls -lG'

  6. press control + c to quit insert mode of vi

  7. type following to write and quite your new changes:

    $ :wq

  8. restart your terminal

  9. reopen terminal and you should be able to use the alias ll

(MacOS Mojave Example)

  1. Open the hidden .bash_profile file in the Vim editor:

     vim ~/.bash_profile 
  2. Jump to the last character of the file by pressing capital G and then $.

  3. Press o to add a new line to the file.

  4. Insert your new alias like:

     alias ll='ls -lG' 
  5. Press Esc to exit insert mode of Vim.

  6. Type following to write your new changes and exit the editor:

     :wq 
  7. Reopen terminal and you should be able to use the alias ll

Source Link

(MacOS Mojave Example)

  1. Go to your home directory:

    $ cd $HOME

  2. Then open the hidden .bash_profile file in the vi editor:

    $ vim .bash_profile

  3. Jump to the last character of the file by pressing capital G and then $

  4. Press I to be able to insert text in the vi editor

  5. insert your new alias like:

    $ alias ll='ls -lG'

  6. press control + c to quit insert mode of vi

  7. type following to write and quite your new changes:

    $ :wq

  8. restart your terminal

  9. reopen terminal and you should be able to use the alias ll