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

相关推荐

  • Mysql之备份及还原相关实验

    本节索引 实验一:冷备份数据库并还原 实验二:结合LVM逻辑卷实现几乎热备 实验三:数据库数据文件损坏后,利用mysqldump还原至最新状态 实验四:误删除表后,利用mysqldump还原至最新状态 实验五:Xtrabackup完全备份及还原 实验六:Xtrabackup完全,增量备份及还原 实验七:Xtrabackup单表导出和导入   实验准…

    Linux笔记 2018-06-14
  • Linux中用户、组和权限

    用户user Linux用户:Username/UID 管理员:root,0 普通用户: 系统用户:1-499 交互式登录:登录用户500+,1000+9(CentOs7) 组group  Linux组:Groupname/GID 管理员组:root,0(私有组) 普通组:系统组:1-499,1-999;普通组:500+,1000+ Linux组的类别:1.…

    Linux笔记 2018-04-05
  • linux基础

    计算机的组成及其功能 计算机初始设计出的时候,就遵循冯诺依曼体系,主要有四部分组成,cpu(中央处理器;运算器和控制器),存储器,输入设备和输出设备 cpu: 运算器、控制器、寄存器,缓存(为了提高cpu性能的加速部件) 存储器:内存,RAM(随机访问存储器) 输入:对计算机下指令,提供让机器操作的数据等;不如键盘,鼠标 输出:输出数据加工后的结果;比如显示…

    Linux笔记 2018-06-24
  • Linux系统中的软链接和硬链接

    Linux系统中的软连接和硬链接小结

    Linux笔记 2018-04-01
  • linux ACL访问控制列表

    1.ACL介绍 Linux 下用户对文件的操作权限有 r-读, w-写, x-可执行三种,而对linux 下的文件而言,用户身份分为:所有者, 所属组, 其它人, 且文件的所有者,所属组都只能是一个,所以在对文件分配用户的使用权限时,只能对这三种身份进行分配rwx 权限.Linux 主要作为服务器系统使用,用户众多.所以在实际使用场景中,这三种身份并不能很好…

    Linux笔记 2018-04-08