随笔 shell
Post
Cancel

shell

  1. 自定义命令

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    bichengfeideMacBook-Pro:~ bichengfei$ cd
    bichengfeideMacBook-Pro:~ bichengfei$ pwd
    /Users/bichengfei
    bichengfeideMacBook-Pro:~ bichengfei$ vi .bash_profile
    #····编辑文件···
    bichengfeideMacBook-Pro:~ bichengfei$ cat .bash_profile | grep alias
    alias ll='ls -lF'
    bichengfeideMacBook-Pro:~ bichengfei$ source .bash_profile
    bichengfeideMacBook-Pro:~ bichengfei$ ll
    
  2. grep

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    bichengfeideMacBook-Pro:~ bichengfei$ cat .bash_profile | grep 'alias ll'
    alias ll='ls -lF'
       
    # 或
    bichengfeideMacBook-Pro:~ bichengfei$ cat .bash_profile | grep 'alias\|ls'
    alias ll='ls -lF'
    alias ssh_gf='/Users/bichengfei/opt/ssh/guangfa_dev/connect.sh'
       
    # 且
    bichengfeideMacBook-Pro:~ bichengfei$ cat .bash_profile | grep 'alias' | grep 'ls'
    alias ll='ls -lF'
    
  3. expect 插件

    https://blog.csdn.net/succing/article/details/120580232

转载请注明出处。