linux下自定义指令alias
发布时间:2024-11-19 04:26
学习Linux命令行:'The Linux Command Line' 是经典教材 #生活技巧# #工作学习技巧# #编程学习资源#
alias指令 alias <新的命令>='<原始命令>'例如:alias cp='cp -i'
注意:使用这种方法,重启后就会失效。可以尝试用systemd或者 /etc/rc.local的办法设置成永久有效,宁外还可以使用编辑用户目录下的.bashrc文件的办法设置成永久有效。
编辑 source ./.bashrc,设置成永久有效 指令 :source ./.bashrc首先打开用户目录下的.bashrc文件进行修改
内容如下:(以下是我对VSCode的示例)
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias vscode='/home/wind/My-Software/VScode/visual-studio-code/code'
fi
最后执行:
网址:linux下自定义指令alias https://www.yuejiaxmz.com/news/view/130280
下一篇:一、网络是把双刃剑.doc
相关内容
从开发者角度入门Linux世界资料整理=Linux介绍+Ubuntu系统安装(视频+文字)如何基于Linux SDK开发Link Visual视频设备的功能
Linux基础之查看、添加、修改、删除用户
Linux学习进阶路线图
如何配置家庭自动化系统
手机语音助手控制自己开发的物联网设备方法
Halcon linux makefile 配置
在linux上运行mysql客户端时报错unknown variable 'basedir=/usr/local/mysql
Command: 环境变量
自学黑客的11个步骤