alias mycommand='original command with arguments' 例如: 代码语言:txt 复制 alias gits='git status' 永久设置别名 要使别名在每次登录时都生效,需要将其添加到用户的shell配置文件中。通常这个文件是~/.bashrc或~/.bash_profile。 编辑配置文件:
假设脚本中想要调用这个alias,该如何设计? 用shopt 开启和关闭 alias 扩展 来看一下shopt的帮助文档: $ help shopt shopt: shopt [-pqsu] [-o] [optname ...] Set and unset shell options. Change the setting of each shell option OPTNAME. Without any option arguments, list each supplied OPTNAME, o...
alias [-p] [name[=value] ... ] DESCRIPTION Define or display aliases. Without arguments, `alias' prints the list of aliases in the reusable form `alias NAME=VALUE' on standard output. Otherwise, an alias is defined for each NAME whose VALUE is given. A trailing space in VALUE causes ...
51CTO博客已为您找到关于linux命令alias的相关内容,包含IT学习相关文档代码介绍、相关教程视频课程,以及linux命令alias问答内容。更多linux命令alias相关解答可以来51CTO博客参与分享和学习,帮助广大IT技术人实现成长和进步。
作用:一键操作,通过SSH为远程主机添加alias别名引用,免去手动添加自加载配置文件~/.bash_profile和~/.bashrc的麻烦;通用的需要频繁使用的alias可以预先在本地模板文件/v/bin/server_alias内进行定义,脚本会推送到服务器后自动进行source引用。 另:自动修改~/.inputrc配置,以便自动响应上下箭头搜索历史命令,比如 输入wget...
Rebuilds mail alias database. newgrp Log-in to a new group. newusers Update/create new users in batch. nfsd Special filesystem for controlling Linux NFS server. nfsstat List NFS statistics. nice Run a program with modified scheduling priority. nl Show numbered line while displaying the content...
[arguments] jobs [-lnprs] [jobspec ...] or jobs -x command [args]: kill [-s sigspec | -n signum | -sigspec] pid | jobspec .>[ arg... ] let arg [arg ...][[ expression ]] local [option] name[=value] ...alias [-p] [name[=value] ... ] logout [n]bg [job_spec ...
[root@localhost test]# alias rm='myrm'[root@localhost test]# touch1.log2.log3.log [root@localhost test]# ll 总计16-rw-r--r--1root root010-2615:081.log-rw-r--r--1root root010-2615:082.log-rw-r--r--1root root010-2615:083.log ...
User_Alias ADMINS = user1, user2 ADMINS ALL = NOPASSWD: ALL root ALL=(ALL) ALL The first line defines an ADMINS user alias with the two users, and the second line grants the privileges. The ALL = NOPASSWD: ALL part means that the users in the ADMINS alias can use sudo to execut...
03_Linux基础-文件类型-主辅提示符-第1提示符-Linux命令-内外部命令-快捷键-改为英文编码-3个时间-stat-{1…100}-du-cd-cp-file-mv-echo-id-shell-ln-env-set-which-rpm-/usr-/与/root-hostname-vim-cat-pwd-alias-unalias-ls-ASCII-wc-chmod ...