zoukankan      html  css  js  c++  java
  • linux基础命令篇二

    1.rmdir删除空目录

    [root@andy ~]# ls
    anaconda-ks.cfg
    [root@andy ~]# mkdir test
    [root@andy ~]# ls
    anaconda-ks.cfg test
    [root@andy ~]# rmdir test
    [root@andy ~]# ls
    anaconda-ks.cfg
    [root@andy ~]#

    2.cat查看文件内容(最少)

    cat -n显示多少行

    [root@andy ~]# ls
    anaconda-ks.cfg
    [root@andy ~]# touch test
    [root@andy ~]# echo "hello" >> test
    [root@andy ~]# cat test
    hello
    [root@andy ~]# cat -n test
    1 hello
    [root@andy ~]# echo -e "hello hello" >> test
    [root@andy ~]# cat -n test
    1 hello
    2 hello
    3 hello

    3.more查看文件(更多内容以百分比显示查看进度)不能向后移动,q退出查看

    4.less可以随意浏览文件(较少)

    5.head查看前10行

    [root@andy zabbix]# head zabbix_agentd.conf
    # This is a configuration file for Zabbix agent daemon (Unix)
    # To get more information about Zabbix, visit http://www.zabbix.com

    ############ GENERAL PARAMETERS #################

    ### Option: PidFile
    # Name of PID file.
    #
    # Mandatory: no
    # Default:

    head -n 3 查看前三行文件

    [root@andy zabbix]# head -n 3 zabbix_agentd.conf
    # This is a configuration file for Zabbix agent daemon (Unix)
    # To get more information about Zabbix, visit http://www.zabbix.com

    [root@andy zabbix]#

    6.tail查看后10行

    [root@andy zabbix]# tail zabbix_agentd.conf
    # Mandatory: no
    # Default:
    # TLSPSKIdentity=

    ### Option: TLSPSKFile
    # Full pathname of a file containing the pre-shared key.
    #
    # Mandatory: no
    # Default:
    # TLSPSKFile=
    [root@andy zabbix]#

    tail -f可以实时监控(一般用于监控日志)

    [root@andy zabbix]# tail -f zabbix_agentd.conf
    # Mandatory: no
    # Default:
    # TLSPSKIdentity=

    ### Option: TLSPSKFile
    # Full pathname of a file containing the pre-shared key.
    #
    # Mandatory: no
    # Default:
    # TLSPSKFile=

    7.clear清屏相当于crtl L(快捷键)

    8.poweroff或shutdown -h now关机

    9.reboot重启

    10.alias查看设置别名

    alias查看别名

    [root@andy ~]# alias
    alias cp='cp -i'
    alias egrep='egrep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias grep='grep --color=auto'
    alias l.='ls -d .* --color=auto'
    alias ll='ls -l --color=auto'
    alias ls='ls --color=auto'
    alias mv='mv -i'
    alias rm='rm -i'
    alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

    alias设置别名

    [root@andy ~]# alias rm='rm -rf'
    [root@andy ~]# alias
    alias cp='cp -i'
    alias egrep='egrep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias grep='grep --color=auto'
    alias l.='ls -d .* --color=auto'
    alias ll='ls -l --color=auto'
    alias ls='ls --color=auto'
    alias mv='mv -i'
    alias rm='rm -rf'
    alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
    [root@andy ~]# ls
    anaconda-ks.cfg test
    [root@andy ~]# rm test

    unalias取消别名

    [root@andy ~]# unalias rm
    [root@andy ~]# alias
    alias cp='cp -i'
    alias egrep='egrep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias grep='grep --color=auto'
    alias l.='ls -d .* --color=auto'
    alias ll='ls -l --color=auto'
    alias ls='ls --color=auto'
    alias mv='mv -i'
    alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

  • 相关阅读:
    论文初稿(二)标题样式:如何做到章节标题自动排序、批量修改正文字号字体
    论文初稿(一)布局:创建论文首先要做的事情
    论文中稿:摘要和关键词
    论文初稿(七)图片格式设置:如何解决修改了正文图片却跑了
    论文终稿(二)分节符:不同页面设置不同的页眉页脚
    论文终稿(一)封面、扉页和独创性声明
    CMD 查看 TCP&UDP 端口占用
    科研结果小论文审核
    如何统计论文纯字数(不包含标点符号和空格)
    人大商学院同等学力在职研究生论文经验文章合集
  • 原文地址:https://www.cnblogs.com/yzandy/p/11759024.html
Copyright © 2011-2022 走看看