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

相关推荐

  • bash脚本进阶

    过程式编程语言:顺序执行选择执行if判断if 判断条件;那么条件为真的分支代码fi if 判断条件;then条件为真的分支代码else条件为假的分支代码fi多分支if 判断条件1; then条件为真的分支代码elif 判断条件2; then条件为真的分支代码elif 判断条件3; then条件为真的分支代码else以上条件都为假的分支代码ficase 变量引…

    2018-05-11
  • 一次性任务:at命令

    一次性任务:at命令at使用必备1th:1)type at2)rpm -qf path3)yum install 包名4)rpm -ql at (有atd.service发现它也是个服务,即要使用at必须要开启这个服务)2th:1)systemctl status atd (active running)2)systemctl start atd3th:nt…

    Linux笔记 2018-05-06
  • LINUX防火墙

    防火墙的分类 systemctl stop firewalld.service :service iptables stop 关闭本机的防火墙并不意味者将防火墙禁用了,只是禁用系统默认的防火墙设置,自己可以再重新配置防火墙策略。   主机防火墙:服务范围为当前主机 网络防火墙:服务范围为防火墙一侧的局域网 硬件防火墙:在专用硬件级别实现部分功能的防…

    Linux笔记 2018-06-28
  • 权限管理

    权限管理 普通权限 通过划分为三种人来管理,所有者u,所属组g,其他人o,所有人a 文件 删除文件用文件所在文件夹的写权限来决定 读写权限root不受控制,执行受控制 对于目录没有执行权限,无法进入目录,无法查看目录内文件属性,无法查看文件内容 执行权限是基础权限没有执行读写权限无用 程序要运行,所在目录要有执行权限 普通用户无法更改文件的所有者,要更改文件…

    Linux笔记 2018-03-31
  • 手把手系列(三)教你自制简单Linux系统

    CentOS启动相关最重要的几个文件有:内核vmlinuz文件、虚拟文件系统initramfs文件、grub文件以

    及init启动程序,围绕这几个文件,我们来制作一个能够简单启动的自制Linux系统

    2018-05-14
  • 请使用命令行展开功能来完成以下练习

    (1)、创建/tmp目录下的:a_c, a_d, b_c, b_d
    (2)、创建/tmp/mylinux目录下的:

    Linux笔记 2018-05-18