zoukankan      html  css  js  c++  java
  • [Bash] Create Aliases in .bash_profile for Common Bash Commands

    .bash_profile is a file that bash invokes (or more technically sources) before the start of a new bash session. In .bash_profile, we have the opportunity to add variables, functions, and aliases to customize our bash environment and provide reusable functionality.

    In this lesson, we’ll look at adding a git_sync alias as well as a ll alias. Aliases act like shortcuts and save us time and typing at the terminal. .bash_profile is a good spot for smaller functions and aliases.

    Note that on most linux distributions you'll use .bashrc instead of .bash_profile.

    1. cd ~

    2. touch .bash_profile

    3. Add alias

    alias ll="ls -laG"
    alias git_sync="git pull -r && git push"

    4. To check what the alias does:

    type ll
  • 相关阅读:
    Win7 安装
    线上java排查
    spring boot
    redisson
    Jcaptca 图片
    URL重写
    gradle导出依赖的jar包
    Redis tomcat
    flex 通过htmlservices链接moss的rest(rest 的get post方式)
    java语言MySQL批处理
  • 原文地址:https://www.cnblogs.com/Answer1215/p/10531959.html
Copyright © 2011-2022 走看看