shell alias添加别名使用
shell 添加 别名 Alias 使用
2023-09-27 14:28:05 时间
大家一定知道SHELL的基本用法,那么著名的命令:`ll`是代表`ls -l`,那么是怎么实现的哪?其实是添加了一个别名alias ll="ls -l"
我使用alias最多的地方是需要运维的服务器特别多,又都需要登录跳板机才能使用,所以在跳板机的目录.bashrc里面添加如下命令:
# .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi #某某预发 alias lzyf="ssh 123456.cm3" #日志文件 alias lzlog="ssh ********.cm4" #某某分析 alias lzweb4="ssh ********.cm4" alias lzzxfxadmin="ssh ********.cm4" alias lzzxfx1="ssh ********.cm4" alias lzzxfx2="ssh ********.cm4" alias lzyy="ssh ********.cm6" # User specific aliases and functions
这样在命令行直接执行命令`lzyf`就是直接登录服务器了,如果在配合screen使用就更是方便
相关文章
- Linux中编写Shell脚本
- Shell整数型变量自增自减的实现方式(+1,-1,++,--)
- shell 清空文件方法
- python 执行shell 命令,自动化添加***IP地址到iptables
- linux shell中如何批量添加一行内容到某些文件的末尾?
- linux shell中如何往所有行尾添加内容
- shell脚本每行后面多了一个^M的原因和解决办法
- Shell变量
- Shell中的特殊符号
- wish - 简单的窗口式(windowing) shell
- Shell编程常见问题
- macOS查看切换当前用户和shell
- shell中在可执行程序后面添加&作用、nohup作用
- Linux shell中一些参数与变量简介
- Shell命令_smem
- 你可能不知道的shell、bash二三事(Centos 7)
- 《Linux命令行与shell脚本编程大全 第3版》Linux命令行---25
- 《Linux命令行与shell脚本编程大全 第3版》Linux命令行---24
- 《Linux命令行与shell脚本编程大全 第3版》Linux命令行---23