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 15:43
下一篇 2018-05-11 16:00

相关推荐

  • Linux 的哲学思想

    Linux 的哲学思想: 一、Linux 系统,采用一切皆文件的思想,包括硬件设备(设备文件)与通讯方式。文件系统(FHS)采用树状结构,根目录只有一个,用户无不是在此树的节点上运作。 备注1:Linux中的所有设备都做为一个文件系统的一个节点来挂载和使用的。如光驱一般挂载在/mnt/cdrom中。 备注2:Linux系统按功能可分为: 1、操纵系统:用以控…

    Linux笔记 2018-06-21
  • 用户管理

    用户管理 注意:用户是通过UID来确定身份的,比如root之所以为管理员就是因为root的UID是0。在centos6上系统用户是1-499,普通用户是500以上的;而在centos7上系统用户是1-999,普通用户是1000以上。系统用户默认不登录。 注意跟用户相关的命令只有管理员账户才有权限 需要用到的命令:useradd usermod userdel…

    Linux笔记 2018-04-08
  • 配置静态路由表 – Linux

    查看当前路由表 使用命令netstat或route -n查看当前路由表。 命令 $ netstat -nr Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.50.1 0.0.0.0 UG 0 0 0 ens37 19…

    Linux笔记 2018-06-12
  • fstab、init文件创建,内核启动管理

    /etc/下的fstab文件和/sbin/下的init文件的创建,内核启动列表管理简述

    2018-05-15
  • Linux系统软件包管理介绍

    Linux发行版中附带有成千上万的可用包,其中包括了Internet工具、开发工具、办公工具、游戏等,如果你没有选择完整安装,则只会安装这些包的“子集”,如何删除不想要的包,如何安装遗漏的包,学习LInux系统的软件包管理将解决你的这些问题

    2018-04-20
  • 网络基础

    网络基础

    2018-05-01