.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

[Bash] Create Aliases in .bash_profile for Common Bash Commands的更多相关文章

  1. Bash脚本编程之脚本基础和bash配置文件

    脚本基础 参考资料:Shell Scripts (Bash Reference Manual) 不严谨地说,编程语言根据代码运行的方式,可以分为两种方式: 编译运行:需要先将人类可识别的代码文件编译成 ...

  2. Common administrative commands in Red Hat Enterprise Linux 5, 6, and 7

    https://access.redhat.com/articles/1189123 Common administrative commands in Red Hat Enterprise Linu ...

  3. [Bash] Create nested folder in Bash

    We can create a single folder by doing: mkdir onefolder If we want to create nested folder we need t ...

  4. bash參考手冊之六(Bash特性)

    6 Bash 特性 这部分描写叙述Bash独有的特性. *  调用Bash : Bash能够接受的命令行选项. *  Bash启动文件 : Bash何时及怎样运行脚本. *  交互Shell : 什么 ...

  5. bash帮助文档简单学习;bash手册翻译

    关于bash的四种工作方式的不同,可以参考:http://feihu.me/blog/2014/env-problem-when-ssh-executing-command-on-remote/,但是 ...

  6. windows的cmd下的find命令比bash(win10下的Ubuntu的bash)下的grep比较

    同样的一个catalina文件,windows的cmd下的find命令比bash下的grep要慢,windows确实占下风啊

  7. [Shell]Bash基本功能:历史命令 & 别名 & Bash快捷键

    /*----------------------------------------------------------------------------------------------- @黑 ...

  8. [Cypress] Create Aliases for DOM Elements in Cypress Tests

    We’ll often need to access the same DOM elements multiple times in one test. Your first instinct mig ...

  9. The common Linux Commands

    Linux的命令总结 1. man:在线请求系统帮助 例:man mkdir NAME:这个命令的完整全名 mk(make directories) SYNOPSIS:这个命令的基本语法 mkdir ...

随机推荐

  1. 【Python3】【树形dp】uva10253 Series-Parallel Networks

    设“共n个叶子,且每个非叶节点至少有两个子节点”的树的数量为f[n],再乘2就是本题答案. 设状态d(i,j)表示每棵子树最多包含i个叶子.一共有j个叶子的树的个数.于是f(n)=d(n-1,n).假 ...

  2. 2 Spring4 之Bean的配置

    Spring4 之Bean的配置 1 IOC & DI 概述 IOC(Inversion of Control):其思想是反转资源获取的方向. 传统的资源查找方式要求组件向容器发起请求查找资源 ...

  3. Codeforces Round #196 (Div. 2) A. Puzzles 水题

    A. Puzzles Time Limit: 2 Sec  Memory Limit: 60 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/showProblem ...

  4. UVALive 4868 Palindrometer 暴力

    F - Palindrometer Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit ...

  5. spring---aop(4)---Spring AOP的CGLIB动态代理

    写在前面 前面介绍了Spring AOP的JDK动态代理的过程,这一篇文章就要介绍下Spring AOP的Cglib代理过程. CGLib全称为Code Generation Library,是一个强 ...

  6. Git_安装Git

    最早Git是在Linux上开发的,很长一段时间内,Git也只能在Linux和Unix系统上跑.不过,慢慢地有人把它移植到了Windows上.现在,Git可以在Linux.Unix.Mac和Window ...

  7. linux内核源码中常见宏定义

    http://blog.csdn.net/yangdelong/article/details/5508057

  8. strace_for_windows

    http://drmemory.org/strace_for_windows.html https://github.com/intellectualheaven/stracent/releases

  9. PL/SQL的下载与安装

    注意,为了更好的通用性,最好安装32位的. 下载地址为:https://www.allroundautomations.com/bodyplsqldevreg.html 当前最新正式版本为PL/SQL ...

  10. ASP.NET Core 1.0基础之依赖注入

      来源https://docs.asp.net/en/latest/fundamentals/dependency-injection.html ASP.NET Core 1.0在设计上原生就支持和 ...