Linux alias创建快捷访问地址

有时候我们有好多地址需要访问,不想全路径去切换,那我们就需要一些快捷命令跳到目标地址
可以用如下alias命令添加快捷地址

[sandwich@centos-elk ~]$ cd ~
[sandwich@centos-elk ~]$ echo 'alias elk="cd /home/sandwich/app/elk"'>>.bash_profile
[sandwich@centos-elk ~]$ echo 'alias es="cd /home/sandwich/app/elk/elasticsearch-7.17.1"'>>.bash_profile
[sandwich@centos-elk ~]$ echo 'alias logstash="cd /home/sandwich/app/elk/logstash-7.17.1"'>>.bash_profile
[sandwich@centos-elk ~]$ echo 'alias kibana="cd /home/sandwich/app/elk/kibana-7.17.1-linux-x86_64"'>>.bash_profile
[sandwich@centos-elk ~]$ echo 'alias logs="cd /log"'>>.bash_profile
[sandwich@centos-elk ~]$ source .bash_profile
[sandwich@centos-elk ~]$ pwd
/home/sandwich
[sandwich@centos-elk ~]$ elk
[sandwich@centos-elk elk]$ pwd
/home/sandwich/app/elk
[sandwich@centos-elk elk]$ es
[sandwich@centos-elk elasticsearch-7.17.1]$ pwd
/home/sandwich/app/elk/elasticsearch-7.17.1

你可能感兴趣的:(Linux alias创建快捷访问地址)