zoukankan      html  css  js  c++  java
  • Linux学习笔记(九)shell基础:echo、命令别名和常用快捷键

    一、echo在屏幕上打印内容

    echo [选项] [输出内容]

    -e 支持转义字符控制的字符转换

    输出带颜色的文本

     

    二、第一个脚本

    编写脚本

    注意:

    #!/bin/bash 此行不是注释,必须有
    1 #!/bin/bash
    2 3 #The first program 4 echo -e "e[1;34m 你好,世界 e[0m"

    运行脚本

    两种方式

    (1)赋予执行权限,直接运行

    chmod 775 hello.sh
    
    ./hello.sh

    (2)通过bash调用执行脚本

    bash hello.sh

     

    三、bash的基本功能

    (1)命令别名

     显示已有的别名 alisa

    也可以通过allsa命令更改系统中已经生效的别名 例如  alisa ls='ls --color=never' 

     

    一旦重启或注销登录,别名就会丧失效果

    要永久生效:写入环境变量配置文件

    命令生效顺序

    (2)常用快捷键

  • 相关阅读:
    python3 网络编程
    python3 字典及其方法
    洛谷P2239 螺旋矩阵
    洛谷P4281 紧急会议
    洛谷 P4427 求和
    树的直径
    洛谷P3398 仓鼠找suger
    洛谷P3865 ST表
    洛谷P1638逛画展
    洛谷P1886 滑动窗口
  • 原文地址:https://www.cnblogs.com/zijeak/p/11307786.html
Copyright © 2011-2022 走看看