命令列程式

简介: 命令列程式是单独存在的执行档,执行前,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'
目录
相关文章
|
存储 Java 索引
十分钟教你学会JAVA中的学生管理系统
十分钟教你学会JAVA中的学生管理系统
342 2
|
机器学习/深度学习 自然语言处理 数据可视化
基于Python+词云图+情感分析对某东上完美日记的用户评论分析
基于Python+词云图+情感分析对某东上完美日记的用户评论分析
739 0
基于Python+词云图+情感分析对某东上完美日记的用户评论分析
|
SQL Java 关系型数据库
SpringBoot从入门到精通(三十)如何使用JdbcTemplate操作数据库?
前面介绍了Mybatis数据持久化框架,Mybatis虽然功能强大,但是,使用起来还是比较复杂的。所以接下来介绍一个简单的数据持久化框架——JdbcTemplate。
10317 2
SpringBoot从入门到精通(三十)如何使用JdbcTemplate操作数据库?
|
7月前
|
人工智能 JavaScript 前端开发
【最佳实践系列】AI程序员让我变成全栈:基于阿里云百炼DeepSeek的跨语言公告系统实战
本文介绍了如何在Java开发中通过跨语言编程,利用阿里云百炼服务平台的DeepSeek大模型生成公告内容,并将其嵌入前端页面。
415 10
|
NoSQL MongoDB 数据库
MongoDB最新版本是什么?
【6月更文挑战第8天】MongoDB最新版本是什么?
660 6
|
11月前
|
前端开发 Java Spring
Spring MVC核心:深入理解@RequestMapping注解
在Spring MVC框架中,`@RequestMapping`注解是实现请求映射的核心,它将HTTP请求映射到控制器的处理方法上。本文将深入探讨`@RequestMapping`注解的各个方面,包括其注解的使用方法、如何与Spring MVC的其他组件协同工作,以及在实际开发中的应用案例。
513 4
|
11月前
|
数据安全/隐私保护
设备巡检管理系统选购指南,看这一篇就够了
在生产型企业中,设备巡检是确保设备正常运行和延长设备寿命的重要环节。面对人力、时间和资金的挑战,选择合适的巡检系统至关重要。系统需满足功能实用、操作简便、性价比高、数据安全及扩展性强等要素。二维码技术因其低成本、易用性,成为设备巡检的理想选择,尤其推荐使用草料二维码,它提供从搭建到管理的全流程服务,帮助企业管理设备巡检数据,提升效率。
|
XML SQL Java
Spring 中声明式事务和编程式事务的使用
Spring 中声明式事务和编程式事务的使用
245 0
|
机器学习/深度学习 算法 测试技术
Python贷款违约预测:Logistic、Xgboost、Lightgbm、贝叶斯调参/GridSearchCV调参|数据分享
Python贷款违约预测:Logistic、Xgboost、Lightgbm、贝叶斯调参/GridSearchCV调参|数据分享
|
监控 Docker 容器
Docker从入门到精通:Docker log 命令学习
了解 Docker 日志管理对容器监控至关重要。`docker logs` 命令用于查看和管理容器日志,例如,`docker logs <container_name>` 显示容器日志,`-f` 或 `--follow` 实时跟踪日志,`--tail` 显示指定行数,`--timestamps` 添加时间戳,`--since` 按日期筛选。Docker 支持多种日志驱动,如 `syslog`,可通过 `--log-driver` 配置。有效管理日志能提升应用程序的稳定性和可维护性。