Since these files are hidden you will have to do an ls -a to list them. If you don't have one you can create one.

Update:

If I remember correctly, when I had bought my mac, .bash_login file wasn't there. I had to create it for myself so that I could put prompt infoaliasfunctions etc in it. Here are the steps if you would like to create one -

  1. Start up Terminal
  2. Type cd ~/ to go to your home folder
  3. Type touch .bash_profile to create your new file.
  4. Edit .bash_profile with your favorite editor (or you can just type open -e .bash_profile to open it in TextEdit.
  5. Type . .bash_profile to reload .bash_profile and update any alias you add.

Another covenient way:

The config file for scripts and programs is ~/.bashrc and the config file that gets loaded when you use Terminal is ~/.bash_login.

I think the best way is to just have everything in ~/.bashrc.

For your specific question just enter (this will overwrite any existing ~/.bashrc):

echo "alias blah=\"/usr/bin/blah\"" >~/.bashrc

into the Terminal and a ~/.bashrc file will be created with your new alises. After that just edit the file to add new aliases, functions, settings etc.

How to add alias on Mac(It's common for most system)的更多相关文章

  1. MAC 下用 Common Lisp 调试 OpenGL 程序

    MAC 下用 Common Lisp 调试 OpenGL 程序 环境搭建 运行环境: OSX 10.11.3 EI Capitan Common Lisp: SBCL 使用 SBCL, 首先要安装这几 ...

  2. mac 关闭系统完整性保护 SIP(System Integrity Protection)的方法

    在 OS X El Capitan 中有一个跟安全相关的模式叫 SIP(System Integrity Protection ) ,它禁止让软件以 root 身份来在 mac 上运行,并且对于目录 ...

  3. mac设置终端命令行别名alias(git、npm)

    别名(alias)通常被用作对一串或单个命令的简称.懒人必备!当常用到命令行操作的时候,每次输入一长串命令,不厌其烦,自然想到了用简称代替.这里主要介绍两种mac设置别名alias的方式. mac 设 ...

  4. ~/.bashrc的常用alias设置,30 个方便的 Bash shell 别名

    centos6.5/centos7系统中,alias定义在/etc/bashrc,分别写在/etc/profile.d/*.sh中,可以在此目录添加my.sh,或者~/.bashrc,或者~/.bas ...

  5. mac下搭建java开发环境:eclipse+tomcat+maven

    一.安装eclipse 直接下载 二.安装JDK 下载mac版专用的jdk1.7,地址如下:http://jdk7.java.net/macportpreview/, 确认java使用的版本:开一个终 ...

  6. MAC下 JDK环境配置、版本切换以及ADB环境配置

    网上方法,自己总结:亲测可行! 一.JDK环境配置.版本切换: 通过命令’jdk6′, ‘jdk7′,’jdk8’轻松切换到对应的Java版本: 1.首先安装所有的JDk:* Mac自带了的JDK6, ...

  7. C#怎么得到主机名,IP,MAC

    一:基础知识 a: Dns 类 提供简单的域名解析功能. Dns 类是一个静态类,它从 Internet 域名系统 (DNS) 检索关于特定主机的信息. 在 IPHostEntry 类的实例中返回来自 ...

  8. 如何高效实现扫描局域网IP、主机名、MAC和端口

    近几年工作经常使用RFID识读器,智能家居网关,温湿度传感器.串口服务器.视频编码器等,一般是有串口和网口,由于现场原因一般较少使用串口,大多使用网口.连接方法是IP地址和端口,有的设备带搜索软件,有 ...

  9. git-bash的alias别名设置

    正常需要设置别名时,直接使用 alias gs="git status" 输入上边的命令之后,就可以使用gs(命令)代替git status(命令),这是一种设置别名简化输入,提升 ...

随机推荐

  1. heap堆内存不足

    配置jvm内存,加个启动参数 -Xms512m -Xmx512m -XX:PermSize=128m  -XX:MaxPermSize=256m   start 下面是这个: -Dcatalina.h ...

  2. Java基础知识强化之集合框架笔记17:List集合的特有的遍历功能

    1. List集合的特有遍历功能: size()和 get()方法结合使用 2. 代码示例: package cn.itcast_03; import java.util.ArrayList; imp ...

  3. MD5加密 Java源代码

    package lwp; /** * * @author 梁WP */ public class MD5_Encoding { // RFC1321中定义的标准4*4矩阵的常量定义. static f ...

  4. StructureMap Exception Code: 207 Internal exception while creating Instance '06fc8bd7-76db-47c1-8d71-31090a074f5e' of PluginType QIMS.Repository.IComStaffRepository. Check the inner exception for more

    标题翻译: StructureMap异常代码:207内部异常,同时创造PluginType QIMS.Repository.IComStaffRepository的实例“06fc8bd7-76db-4 ...

  5. 14、SQL Server 存储过程

    SQL Server 存储过程 存储过程类似函数,可以重复使用.相对于函数,存储过程拥有更强大的功能和更高的灵活性. 存储过程中可以包含逻辑控制语句和数据操作语句,可以接受参数,输出参数,返回单个值或 ...

  6. win7 下配置 java 环境变量

    首先,你应该已经安装了 java 的 JDK 了,笔者安装的是:jdk-7u7-windows-x64 接下来主要讲怎么配置 java 的环境变量,也是为了以后哪天自己忘记了做个备份 1.进入“计算机 ...

  7. HBuilder+移动APP开发实例

    mui: 官网:http://dcloudio.github.io/mui/ 说明:一般要把官网内容通读一遍,这是开发的基础 开始 1.新建项目 在首页点击新建移动App,如下: 或者在项目管理器内右 ...

  8. HibernateTool的安装和使用(Eclipse中)

    http://blog.sina.com.cn/s/blog_919273e20101g1t7.html

  9. Scrum教练不应兼任product owner

    ScrumMasters Should Not Also Be Product Owners(中文翻译) December 2, 2014 by Mike Cohn 翻译:2015.2.18 by o ...

  10. iOS开动画效果之──实现 pushViewController 默认动画效果

    在开发中,视图切换会常常遇到,有时我们不是基于导航控制器的切换,但实际开发中,有时需要做成push效果,下面将如何实现push和pop 默认动画效果代码实例: 一.push默认动画效果 CATrans ...