.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. android 视频 2017

    韩梦飞沙  韩亚飞  313134555@qq.com  yue31313  han_meng_fei_sha

  2. lua协程----ngx-lua线程学习笔记

    --[[ - @desc lua数据输出 - @param string 字符串 - return string --]] function dump(v) if not __dump then fu ...

  3. 1、安装Redis的PHP扩展

    1.安装Redis的PHP扩展 1.1 安装phpize yum install php-devel 1.2 下载扩展源码包,直接用wget #wget下载github上的文件 wget https: ...

  4. php-curl小记

    用jQuery: $.ajax({ url:url, type:"POST", data:data, contentType:"application/json; cha ...

  5. UCS UTF UTF-7 UTF-8 UTF-16

    Unicode也是一种字符编码方法,不过它是由国际组织设计,可以容纳全世界所有语言文字的编码方案.Unicode的学名是"Universal Multiple-Octet Coded Cha ...

  6. 将代码库从 SVN 迁移至 Git 并保留所有 commit 记录

    公司内部原本使用 SVN 进行版本控制,但随着 Github 的流行我个人的代码管理习惯逐渐转变.虽然公司项目并非开源,SVN 所具有的标准 trunk / branches / tags 结构完全够 ...

  7. PLSQL Developer 配置Oralce11g连接 转

    PLSQL Developer因为没有对应的64位程序,所以用该程序连接Oracle时只能对应x86的Oracle客户端.本示例为Oracle11g,去官网下载instantclient_11_2的x ...

  8. SQLite 客户端管理工具

    SQLite 客户端管理工具 SQLite Expert Personal 3.5.79.2499 下载地址:http://www.onlinedown.net/soft/117987.htm SQL ...

  9. Javascript 面向对象编程(一):封装(转载)

    Javascript是一种基于对象(object-based)的语言,你遇到的所有东西几乎都是对象.但是,它又不是一种真正的面向对象编程(OOP)语言,因为它的语法中没有class(类). 那么,如果 ...

  10. MVC自定义路由02-实现IRouteConstraint限制控制器名

    通过实现IRouteConstraint接口,实现对某个控制名进行限制.本篇把重点放在自定义约束,其余部分参考: MVC自定义路由01-为什么需要自定义路由    自定义约束前 using Syste ...