• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

国民时代

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

Linux命令:alias

语法

alias [-p] [name[=value] ... ]

说明

定义命令的别名或者打印命令别名的定义。

不带name打印别名列表,一行一个。每行像alias NAME=VALUE。

可以一行定义多个别名。

用途,用于将常用命令往往是带不少参数的,简化成一个短名。相当于命令快捷键。

举例

ailas   ll=‘ls -l --color=auto’       # 定义别名ll

alias ll            # 打印别名ll的定义

alias ll='ls -l --color=auto'

alias -p 或  alias         # 显示所有别名定义

 

小技巧

如何记住alias的用法。命令经常不用,会忘记。记住ailas+变量定义比较容易记忆。

help alias

 1 alias: alias [-p] [name[=value] ... ]
 2     Define or display aliases.
 3 
 4     Without arguments, `alias' prints the list of aliases in the reusable
 5     form `alias NAME=VALUE' on standard output.
 6 
 7     Otherwise, an alias is defined for each NAME whose VALUE is given.
 8     A trailing space in VALUE causes the next word to be checked for
 9     alias substitution when the alias is expanded.
10 
11     Options:
12       -p        Print all defined aliases in a reusable format
13 
14     Exit Status:
15     alias returns true unless a NAME is supplied for which no alias has been
16     defined.

 

本篇文章出自“国民时代”,转载请注明转载出处。

posted on 2019-04-01 19:33  国民时代  阅读(294)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3