简体   繁体   English

在Ubuntu中使用bashrc定义别名

[英]Using bashrc to define an alias in Ubuntu

I need to define an alias for ls -al named parisan. 我需要为ls -al定义一个名为parisan的别名。

I tried: 我试过了:

nano .bashrc

i defined : 我定义了:

alias parisan = ls -al

but when i call it using alias parian in terminal i get this error: 但是当我在终端中使用别名parian调用它时,出现此错误:

the alias parisan not found 找不到别名parisan

语法为:

alias parisan='ls -al'

To define an alias you have to use the syntax: 要定义别名,您必须使用以下语法:

alias parisan='ls -al'
              ^^      ^
              |-quotes-
              | 
              |___ no spaces around =

And then source the file so that you can start using parisan as an alias: 然后获取文件,以便您可以开始使用parisan作为别名:

source .bashrc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM