命令列程式

简介: 命令列程式是单独存在的执行档,执行前,Shell 会现在 $PATH 中寻找,若有同名但不同路径的档案,先找到先执行常用的命令列程式:cp,date,who,w,ls,cat,cut,wc,last,mv,mkdir,rmdir,mv,ps,pgrep,top,df,dd,l...

命令列程式是单独存在的执行档,执行前,Shell 会现在 $PATH 中寻找,若有同名但不同路径的档案,先找到先执行
常用的命令列程式:

cp,date,who,w,ls,cat,cut,wc,last,mv,mkdir,rmdir,mv,ps,pgrep,top,df,dd,ln,sort,sed,awk,ifconfig,dmesg,
diff,hostname,dnsdomainname,chmod,chown,chgrp,grep,find,kill,killall,pkill,more,less,mount,nice,paste,
ping,seq,sleep,su,tar,gzip,xargs,touch,uname,basename,dirname,tr,uniq,mail,which,locate,getconf
  1. which 由预设的所寻路径 PATH 中,找到命令列程式的档案位置(默认找到第一个)。 -a 找出所有符合的程式路径
  2. locate 由档案资料库中,找出包含「关键字」的档案路径

凡是档案路径中,含有此关键字的,都会被列出来
  1. date 展示、设定系统的日期和时间
    FORMAT controls the output.  Interpreted sequences are:
    %%   a literal %
    %a   locale's abbreviated weekday name (e.g., Sun)
    %A   locale's full weekday name (e.g., Sunday)
    %b   locale's abbreviated month name (e.g., Jan)
    %B   locale's full month name (e.g., January)
    %c   locale's date and time (e.g., Thu Mar  3 23:05:25 2005)
    %C   century; like %Y, except omit last two digits (e.g., 20)
    %d   day of month (e.g., 01)
    %D   date; same as %m/%d/%y
    %e   day of month, space padded; same as %_d
    %F   full date; same as %Y-%m-%d
    %g   last two digits of year of ISO week number (see %G)
    %G   year of ISO week number (see %V); normally useful only with %V
    %h   same as %b
    %H   hour (00..23)
    %I   hour (01..12)
    %j   day of year (001..366)
    %k   hour, space padded ( 0..23); same as %_H
    %l   hour, space padded ( 1..12); same as %_I
    %m   month (01..12)
    %M   minute (00..59)
    %n   a newline
    %N   nanoseconds (000000000..999999999)
    %p   locale's equivalent of either AM or PM; blank if not known
    %P   like %p, but lower case
    %r   locale's 12-hour clock time (e.g., 11:11:04 PM)
    %R   24-hour hour and minute; same as %H:%M
    %s   seconds since 1970-01-01 00:00:00 UTC
    %S   second (00..60)
    %t   a tab
    %T   time; same as %H:%M:%S
    %u   day of week (1..7); 1 is Monday
    %U   week number of year, with Sunday as first day of week (00..53)
    %V   ISO week number, with Monday as first day of week (01..53)
    %w   day of week (0..6); 0 is Sunday
    %W   week number of year, with Monday as first day of week (00..53)
    %x   locale's date representation (e.g., 12/31/99)
    %X   locale's time representation (e.g., 23:13:48)
    %y   last two digits of year (00..99)
    %Y   year
    %z   +hhmm numeric time zone (e.g., -0400)
    %:z  +hh:mm numeric time zone (e.g., -04:00)
    %::z  +hh:mm:ss numeric time zone (e.g., -04:00:00)
    %:::z  numeric time zone with : to necessary precision (e.g., -04, +05:30)
    %Z   alphabetic time zone abbreviation (e.g., EDT)
    By default, date pads numeric fields with zeroes.
    The following optional flags may follow '%':
    -  (hyphen) do not pad the field
    _  (underscore) pad with spaces
    0  (zero) pad with zeros
    ^  use upper case if possible
    #  use opposite case if possible
    After any flags comes an optional field width, as a decimal number;
    then an optional modifier, which is either
    E to use the locale's alternate representations if available, or
    O to use the locale's alternate numeric symbols if available.
    Examples:
    Convert seconds since the epoch (1970-01-01 UTC) to a date
    $ date --date='@2147483647'
    Show the time on the west coast of the US (use tzselect(1) to find TZ)
    $ TZ='America/Los_Angeles' date
    Show the local time for 9AM next Friday on the west coast of the US
    $ date --date='TZ="America/Los_Angeles" 09:00 next Fri'
目录
相关文章
|
6月前
|
算法 Shell Linux
【Shell 命令集合 文档编辑】Linux 删除指定列的内容 colrm 命令使用教程
【Shell 命令集合 文档编辑】Linux 删除指定列的内容 colrm 命令使用教程
81 0
|
3月前
|
Linux 调度
在Linux中,任务计划格式中,前面5个数字分表表示什么含义?
在Linux中,任务计划格式中,前面5个数字分表表示什么含义?
|
6月前
|
存储 算法 Shell
【Shell 命令集合 设备管理 】Linux 显示当前系统中定义的键盘映射表 dumpkeys命令 使用指南
【Shell 命令集合 设备管理 】Linux 显示当前系统中定义的键盘映射表 dumpkeys命令 使用指南
69 0
【Stata】2-命令语句
【Stata】2-命令语句
103 0
|
6月前
|
存储 Shell Linux
【Shell 命令集合 文档编辑】Linux 删除连续重复的行 uniq 命令使用指南
【Shell 命令集合 文档编辑】Linux 删除连续重复的行 uniq 命令使用指南
136 0
|
6月前
|
Linux Perl
Linux|sed命令花式批量修改文件
Linux|sed命令花式批量修改文件
195 0
|
SQL Oracle 关系型数据库
PowerDesigner生成的建表脚本中如何把对象的双引号去掉
PowerDesigner生成的建表脚本中如何把对象的双引号去掉
147 0
|
SQL Linux 数据库
Linux将hiveSQL字段当做命令执行解决办法
Linux将hiveSQL字段当做命令执行解决办法
|
数据库管理
PowerDesigner生成建表脚本时字段超过15字符就发生错误
PowerDesigner生成建表脚本时字段超过15字符就发生错误
|
JSON Java Unix
《懒人Shell脚本》之十——统计多重路径下的不同扩展名文件及个数
1、统计实现 find -type f | sed -e 's/.*\.//' | sort | uniq -c | sort -n > rst.txt 1 2、脚本分解 1) find -type f regular file , 查找正规的文件 返回:./bak_network/道x网站/bak_第8章.md
143 0