Some times, setting alias may save a lot of time.
Setting alias is very simple.
1. Go to your home folder
2. Open .bashrc file with vim or other editors (vim .bashrc and enter)
3. At the end of the file, type: alias vi='vim'
4. Exit the editor after saving
5. On the terminal, type: source .bashrc (enter)
Now your alias is set.
To see the list of alias in your system, type at the terminal: alias
This will list all the alias.
Here is some useful aliases.
alias grep='grep --color'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias vi='vim'
You can comment on more useful aliases.
Here is another useful tip on alias.
In the above example, if you type 'ls', it will execute 'ls --color=auto'
However, sometime you may want to use unaliased 'ls'. This can be performed by using
backslash + comment.
Example.
\ls will execute just ls.
Hope this is useful.
Setting alias is very simple.
1. Go to your home folder
2. Open .bashrc file with vim or other editors (vim .bashrc and enter)
3. At the end of the file, type: alias vi='vim'
4. Exit the editor after saving
5. On the terminal, type: source .bashrc (enter)
Now your alias is set.
To see the list of alias in your system, type at the terminal: alias
This will list all the alias.
Here is some useful aliases.
alias grep='grep --color'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias vi='vim'
You can comment on more useful aliases.
Here is another useful tip on alias.
In the above example, if you type 'ls', it will execute 'ls --color=auto'
However, sometime you may want to use unaliased 'ls'. This can be performed by using
backslash + comment.
Example.
\ls will execute just ls.
Hope this is useful.
No comments:
Post a Comment