zoukankan      html  css  js  c++  java
  • Linux常用命令

    1.script命令

    1)输入 script 命令,当前目录自动创建typescript文本文件,记录此终端后续操作。ctrl + D或exit,退出记录
    [root@localhost ~]# script
    Script started, file is typescript
    [root@localhost ~]# ehco hello HJ
    bash: ehco: 未找到命令…
    相似命令是: ‘echo’
    [root@localhost ~]# echo Hello HJ
    Hello HJ
    [root@localhost ~]# exit
    exit
    Script done, file is typescript

    2)指定目录或创建指定名字的文件
    [root@localhost ~]# script /home/record2020109.log
    Script started, file is /home/record2020109.log
    [root@localhost ~]# echo Hello World
    Hello World
    [root@localhost ~]# exit
    Script done, file is /home/record2020109.log

    3)继续记录:script -a filename
    [root@localhost ~]# script -a cooperate-job
    Script started, file is cooperate-job
    [root@localhost ~]# echo this is harry_s job
    this is harry_s job
    [root@localhost ~]# pwd
    /home/alvin/test
    [root@localhost ~]# exit
    exit
    Script done, file is cooperate-job

    4)打开终端自动记录
    将 script 命令添加到 Shell 配置文件中,用户登录,script 命令就自动启动
    修改 .bash_profile 文件。
    vim ~/.bash_profile
    添加script 命令
    /usr/bin/script -qa path/filename #-q 代表静默记录
    Source一下

  • 相关阅读:
    Angular2+学习第1篇 简介
    JS:ES5数组基本操作
    git常用操作命令
    URL-Routing
    uid-datepicker
    元素隐藏 css
    Angular2+学习第2篇 cli 环境搭建过程
    DRF 07
    DRF小练习 04
    DRF小练习 02
  • 原文地址:https://www.cnblogs.com/xinmomoyan/p/14917264.html
Copyright © 2011-2022 走看看