Linux 创建自定义命令

2021-12-27  本文已影响0人  木偶跳舞

以创建ll命令为例

步骤:

1、在/home目录用户文件夹下打开.profile文件

vim ~/.profile

ubuntu系统是~/.profile, centos系统用 ~/.bashrc

2、在.profile文件中写入

语法: alias[别名]=[指令名称]

alias ll="ls -alh" 

3、 然后执行

source ~/.profile

若系统启动时不会自动加载 ~/.profile 文件,则将 source ~/.profile 命令添加到要自动加载的文件中即可,如~/.bash.profile 文件

source ~/.profile

————————————————
本文由木偶笔记发表于 2021-11-07
转载请务必保留本文链接:https://www.muouseo.com/article/n2oegzv73m.html

上一篇 下一篇

猜你喜欢

热点阅读