Linux系统上命令的使用格式

详细介绍ifconfig、echo、tty、startx、export、pwd、history、shutdown、poweroff、reboot、hwclock、

ifconfig

  • ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]
    [add <address>[/<prefixlen>]]
    [del <address>[/<prefixlen>]]
    [netmask <address>] [dstaddr <address>] [tunnel <address>]
    [[-]dynamic]
    [up|down] …

echo

  • Output the ARGs
  • \a alert (bell)
    \b backspace
    \c suppress trailing newline
    \E escape character
    \f form feed
    \n new line
    \r carriage return
    \t horizontal tab
    \v vertical tab

tty

  • Print the file name of the terminal connected to standard input.
  • -s, –silent, –quiet
    print nothing, only return an exit status
  • –help display this help and exit
  • –version
    output version information and exit

startx

  • 启动图形化桌面

export

  • export [-nf] [name[=value] …] or export -p

pwd

  • Print the current working directory.
  • With the -P option, pwd prints
    the physical directory, without any symbolic links;
  • the -L option
    makes pwd follow symbolic links.

history

history [-c] [-d offset]

[-n] or history -awrn [filename] or history -ps arg [arg…]

shutdown

  • -h now +时间 ,14:20
  • –no-wall

poweroff

  • -n Don’t sync before reboot or halt. Note that the kernel and storage drivers may still sync.
  • -w Don’t actually reboot or halt but only write the wtmp record (in the /var/log/wtmp file).
  • -d Don’t write the wtmp record. The -n flag implies -d.
  • -f Force halt or reboot, don’t call shutdown(8).
  • -i Shut down all network interfaces just before halt or reboot.
  • -h Put all harddrives on the system in standby mode just before halt or poweroff.

reboot

  • -n Don’t sync before reboot or halt. Note that the kernel and storage drivers may still sync.
  • -w Don’t actually reboot or halt but only write the wtmp record (in the /var/log/wtmp file).
  • -d Don’t write the wtmp record. The -n flag implies -d.
  • -f Force halt or reboot, don’t call shutdown(8).
  • -i Shut down all network interfaces just before halt or reboot.
  • -h Put all harddrives on the system in standby mode just before halt or poweroff.

hwclock

  • hwclock – query and set the hardware clock (RTC) hwclock -r or hwclock –show
    hwclock -w or hwclock –systohc
    hwclock -s or hwclock –hctosys
    hwclock -a or hwclock –adjust
    hwclock -v or hwclock –version
    hwclock –set –date=newdate
    hwclock –getepoch
    hwclock –setepoch –epoch=year
  • date
  • date [OPTION]… [+FORMAT]
    date [-u|–utc|–universal] [MMDDhhmm[[CC]YY][.ss]]
  • %H 小时(以00-23来表示)。 
    %I 小时(以01-12来表示)。 
    %K 小时(以0-23来表示)。 
    %l 小时(以0-12来表示)。 
    %M 分钟(以00-59来表示)。 
    %P AM或PM。 
    %r 时间(含时分秒,小时以12小时AM/PM来表示)。 
    %s 总秒数。起算时间为1970-01-01 00:00:00 UTC。 
    %S 秒(以本地的惯用法来表示)。 
    %T 时间(含时分秒,小时以24小时制来表示)。 
    %X 时间(以本地的惯用法来表示)。 
    %Z 市区。 
    %a 星期的缩写。 
    %A 星期的完整名称。 
    %b 月份英文名的缩写。 
    %B 月份的完整英文名称。 
    %c 日期与时间。只输入date指令也会显示同样的结果。 
    %d 日期(以01-31来表示)。 
    %D 日期(含年月日)。 
    %j 该年中的第几天。 
    %m 月份(以01-12来表示)。 
    %U 该年中的周数。 
    %w 该周的天数,0代表周日,1代表周一,异词类推。 
    %x 日期(以本地的惯用法来表示)。 
    %y 年份(以00-99来表示)。 
    %Y 年份(以四位数来表示)。 
    %n 在显示时,插入新的一行。 
    %t 在显示时,插入tab。 
    MM 月份(必要) 
    DD 日期(必要) 
    hh 小时(必要) 
    mm 分钟(必要)
    ss 秒(选择性)

本文来自投稿,不代表Linux运维部落立场,如若转载,请注明出处:http://www.178linux.com/98137

(0)
墨武墨武
上一篇 2018-05-11
下一篇 2018-05-11

相关推荐

  • 磁盘分区之MSDOS与GPT的区别

    只介绍两者的区别,没有操作方法,做记录学习用

    2018-07-19
  • N31第一周作业

    本周(6.18–6.24)第1周 1、描述计算机的组成及其功能。 计算机组成:硬件系统和软件系统 硬件系统:CPU:运算器和寄存器(运算器负责算术、逻辑等运算、控制器是系统的控制中心) 存储器:主要为内存,功能是存储程序和各种数据信息。 Input:下指令、提供数据到计算机,常用的输入设备有鼠标、键盘、扫描仪等 Output:输出加工的结果,常用…

    Linux笔记 2018-06-25
  • DNS主服务器

    httpd测试页 echo xxx > /var/www/html/index.html systemctl restart httpd nano /etc/named.conf /etc/named.rfc1912.zones 复制模板文件 cd /var/named/ cp -a named.localhost nixiao.com.zone 重新…

    2018-06-03
  • shell脚本编程基础(3)——循环用法

    在前面的基础编程内容中,我们已经学习了shell脚本的顺序执行及选择执行,通过这两种方式,可以帮我们解决一些简单需求,但要想在更复杂的场景中使用的话,就需要掌握循环执行的方式了。

    2018-05-08
  • VMware安装CentOS6系统图文详解

    在VMware上安装CentOS6系统,分两个步骤,根据自己的需求创建虚拟机,然后将CentOS6系统光盘挂载到虚拟机中安装系统。 一:创建虚拟机 点击创建虚拟机   这里我们选择系统推荐的典型模式。   我们这里先不选择安装程序光盘映像文件,随后再安装系统,选择下面一项。 操作系统选择Linux  CentOS 64位的。 由于我们计划…

    2018-03-31
  • 模拟网络访问解析

    搭建局域网DNS解析,具体实现功能如下图 注:该测试只有正向解析 项目流程图 1. 项目前准备关闭防火墙和SELINUX,配置网络 ①开启8台机器 ②关闭防火墙及selinux iptables -vnL #查看防火墙状态 systemctl stop firewall #关闭防火墙 getenforce #查看SELinux状态 setenforce 0 …

    2018-06-04