参考: https://www.digitalocean.com/community/tutorials/an-introduction-to-useful-bash-aliases-and-functions https://www.educba.com/bash-alias/ https://linuxize.com/post/how-to-create-bash-aliases/
There is an alternative to aliases that is more robust and can help you bridge the gap between bash aliases and full shell scripts. These are called shell functions. They work in almost the same way as aliases but are more programmatic and accept input in a standard way. We won’t go i...
This is an oh-my-zsh plugin (or sourcekube-aliases.plugin.zshfor bash) to make working with kubernetes easier. It provides a bunch of bash aliases and zsh functions. Docs can be foundhere, which clarifies all aliases. Usage There are a few main features of this plugin. First, there are...
#/etc/profile # System wide environment and startup programs,forlogin setup # Functions and aliases goin/etc/bashrc # It'sNOTa good idea to changethisfile unless you know what you # are doing.It's much better to create a custom.sh shell scriptin#/etc/profile.d/to make custom changes ...
[root@localhost ~]# cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH unset USERNAME // PATH变量添加了用户家目录下的~/bin/为额外的执行文件放...
# Functions and aliases go in /etc/bashrc # It's NOT a good idea to change this file unless you know what you # are doing. It's much better to create a custom.sh shell script in # /etc/profile.d/ to make custom changes to your environment, as this ...
# Functions and aliases go in /etc/bashrc # It's NOT a good idea to change this file unless you know what you # are doing. It's much better to create a custom.sh shell script in # /etc/profile.d/ to make custom changes to your environment, as this ...
5 # Functions and aliases go in /etc/bashrc 6 7 pathmunge () { 8 if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then 9 if [ "$2" = "after" ] ; then 10 PATH=$PATH:$1 11 else 12 PATH=$1:$PATH 13 fi
# User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi #注意:假如在A窗口设定了别名,然后打开B窗口,不能使用该别名。需要将别名定义在文件中,才可以永久使用 ...
[root@192 ~]#vi /root/.bashrc[root@192 ~]#source /root/.bashrc[root@192 ~]#vi /root/.bashrc[root@192 ~]#cat /root/.bashrc#.bashrc#User specific aliases and functionsalias rm='rm -i' alias cp='cp -i' alias mv='mv -i' ...