`
xf986321
  • 浏览: 160842 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

alias 来简写你常用的命令

阅读更多

alias vncmybox=’ vncviewer admin@192.168.245.231′

Now you have created your first alias. Anytime during the session you type vncmybox it will run the command we assigned to that alias.

Here is the catch, as soon as you close the terminal all is lost.

Let’s make this change permanent.

Go to you home folder and create a file named:

.bash_aliases

(This can also be done via the terminal like so:

touch ~/.bash_aliases

Then add the alias we created earlier on the first line of this text file as so: (Remember to open this file from your home folder you will have to show hidden files by pressing ctrl + h when in your home directory)

alias vncmybox=’ vncviewer admin@192.168.245.231′

Save the file and open the file named:

.bashrc

Find the section that is commented out (lines preceded with #’s) to looks like this:

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

Uncomment those lines. Save and close and then open a new terminal window.

Now type:

alias

It will list your aliases including the one we just added. Now you can go back and add other commonly used commands to your .bash_aliases file to ease your terminal tasks.

分享到:
评论

相关推荐

    Linux命令模板 licote 1.3.2

    用于快速编写一个linux环境的命令程序,Licote的主要任务是帮助你解析linux环境下的常用命令选项,让你快速编写命令程序的同时,为用户提供灵活而强大的使用方法;通过Licote框架你可以开发类似tcpdump,date等选项...

    aka:类固醇的Alias Bash命令

    Bash alias本质上不过是键盘快捷键,缩写,是避免键入长命令序列的一种手段。 由于这些原因, AKA提供了更好的替代alias命令: 别名以文件形式存储在文件系统中,因此可以轻松地在计算机之间共享和同步 AKA是跨平台...

    Linux操作系统基础教程

    UNIX的用户来说,使他们熟悉 UNIX 操作环境,通往"骨灰级"高手境界的一大捷径。最重 要的是,Linux 上有公认的 C 语言世界最好的编译器 gcc,如果你想得到一个效率更高的开 发环境(并不一定是最友好的,但一定是最...

    ELDK使用与开发手册

    如果U-Boot已经在你的板子上安装运行,你可以使用这些命令来下载新的U-Boot映像来代替当前的。 警告:在你安装新的映像之前,你必须擦除当前的u-boot.bin。如果出现什么差错,你的开发板将不能运行。因此强烈建议: ...

    GitAliases:一些适用于任何项目的Git别名

    这些别名只是缩写现有Git命令/选项,以节省一些打字(例如, chb代替checkout --branch )。 他们使用以下命名约定: 相应于节略的git命令一两个字母(例如, a用于add或rb用于rebase ) 此后的每个字母对应于该...

    standard-aliases:尝试以Bash函数的形式定义对Linux的标准扩展

    当执行缩写命令时,这些预定义选项将与实际选项组合在一起。 而且,如果命令不适合屏幕,大多数命令会将其输出发送到寻呼机。 收集是针对具有Gnome桌面环境的基于DebianLinux( Ubuntu , Mint ,...)而进行的,...

    patch-gen:补丁生成工具

    在以下各节中,将patch-gen替换为java -jar patch-gen-*-shaded.jar ,或者使用以下命令设置别名 alias patch-gen='java -jar patch-gen-*-shaded.jar' 补丁生成 patch-gen --applies-to-dist=~/wildfly/wildfly-...

    2009 达内Unix学习笔记

    集合了 所有的 Unix命令大全 登陆服务器时输入 公帐号 openlab-open123 telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss 老师测评网址 http://172.16.0.198:8080/poll/ 各个 ...

    AppleScript 简明基础教程

    第一节 对象、属性和命令! 第二节 标识符和关键字! 第三节 数据类型! 第四节 强制数据类型转换! 第五节 运算符! 第六节 提取对象中的元素! 第七节 添加注释和括号! 第八节 代码缩写! 第四章 读懂AppleScript字典! ...

    ubuntu部落(适合初学者,可以作为初学者的手册)

    常用系统服务.................................................48 重要配置文件.................................................49 全局配置文件.........................................49 用户配置文件.......

    SQL 基础--SELECT 查询

    关键字不能整行缩写或分离 子句通常被放置在分开的行上 缩进可提高可读性 在SQL 开发工具,SQL 语句能选择分号结束(;) .当你运行多个SQL 语句的时候,需要分号 在SQL*Plus中, 你要用一个分号结束每个SQL 语句....

Global site tag (gtag.js) - Google Analytics