热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Linux常用命令使用格式

仅以博客形式记录linux所学,不足之处继续优化linux系统的常用命令格式基本上是以cmd(command)选项参数的形式书写例如screen、date、ifconfig等命令1

仅以博客形式记录linux所学,不足之处继续优化

linux系统的常用命令格式基本上是以  cmd(command) 选项 参数  的形式书写

例如screen、date、ifconfig等命令


1 Usage: date [OPTION]... [+FORMAT]
2 or: date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
3 Display the current time in the given FORMAT, or set the system date.
4
5 Mandatory arguments to long options are mandatory for short options too.
6 -d, --date=STRING display time described by STRING, not now
7 -f, --file=DATEFILE like --date once for each line of DATEFILE
8 -I[TIMESPEC], --iso-8601[=TIMESPEC] output date/time in ISO 8601 format.
9 TIMESPEC=date for date only (the default),
10 hours, minutes, seconds, or ns for date
11 and time to the indicated precision.
12 -r, --reference=FILE display the last modification time of FILE
13 -R, --rfc-2822 output date and time in RFC 2822 format.
14 Example: Mon, 07 Aug 2006 12:34:56 -0600
15 --rfc-3339=TIMESPEC output date and time in RFC 3339 format.
16 TIMESPEC=date, seconds, or ns for
17 date and time to the indicated precision.
18 Date and time components are separated by
19 a single space: 2006-08-07 12:34:56-06:00
20 -s, --set=STRING set time described by STRING
21 -u, --utc, --universal print or set Coordinated Universal Time (UTC)
22 --help display this help and exit
23 --version output version information and exit
24
25 FORMAT controls the output. Interpreted sequences are:
26
27 %% a literal %
28 %a locales abbreviated weekday name (e.g., Sun)
29 %A locales full weekday name (e.g., Sunday)
30 %b locales abbreviated month name (e.g., Jan)
31 %B locales full month name (e.g., January)
32 %c locales date and time (e.g., Thu Mar 3 23:05:25 2005)
33 %C century; like %Y, except omit last two digits (e.g., 20)
34 %d day of month (e.g., 01)
35 %D date; same as %m/%d/%y
36 %e day of month, space padded; same as %_d
37 %F full date; same as %Y-%m-%d
38 %g last two digits of year of ISO week number (see %G)
39 %G year of ISO week number (see %V); normally useful only with %V
40 %h same as %b
41 %H hour (00..23)
42 %I hour (01..12)
43 %j day of year (001..366)
44 %k hour, space padded ( 0..23); same as %_H
45 %l hour, space padded ( 1..12); same as %_I
46 %m month (01..12)
47 %M minute (00..59)
48 %n a newline
49 %N nanoseconds (000000000..999999999)
50 %p locales equivalent of either AM or PM; blank if not known
51 %P like %p, but lower case
52 %r locales 12-hour clock time (e.g., 11:11:04 PM)
53 %R 24-hour hour and minute; same as %H:%M
54 %s seconds since 1970-01-01 00:00:00 UTC
55 %S second (00..60)
56 %t a tab
57 %T time; same as %H:%M:%S
58 %u day of week (1..7); 1 is Monday
59 %U week number of year, with Sunday as first day of week (00..53)
60 %V ISO week number, with Monday as first day of week (01..53)
61 %w day of week (0..6); 0 is Sunday
62 %W week number of year, with Monday as first day of week (00..53)
63 %x locales date representation (e.g., 12/31/99)
64 %X locales time representation (e.g., 23:13:48)
65 %y last two digits of year (00..99)
66 %Y year
67 %z +hhmm numeric time zone (e.g., -0400)
68 %:z +hh:mm numeric time zone (e.g., -04:00)
69 %::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
70 %:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)
71 %Z alphabetic time zone abbreviation (e.g., EDT)
72
73 By default, date pads numeric fields with zeroes.
74 The following optional flags may follow %:
75
76 - (hyphen) do not pad the field
77 _ (underscore) pad with spaces
78 0 (zero) pad with zeros
79 ^ use upper case if possible
80 # use opposite case if possible
81
82 After any flags comes an optional field width, as a decimal number;
83 then an optional modifier, which is either
84 E to use the locales alternate representations if available, or
85 O to use the locales alternate numeric symbols if available.
86
87 Examples:
88 Convert seconds since the epoch (1970-01-01 UTC) to a date
89 $ date --date=@2147483647
90
91 Show the time on the west coast of the US (use tzselect(1) to find TZ)
92 $ TZ=America/Los_Angeles date
93
94 Show the local time for 9AM next Friday on the west coast of the US
95 $ date --date=TZ="America/Los_Angeles" 09:00 next Fri
96
97 GNU coreutils online help: //www.gnu.org/software/coreutils/>
98 For complete documentation, run: info coreutils date invocation

利用date来设置时间

date -s "20200807 12:00:00"


1 Use: screen [-opts] [cmd [args]]
2 or: screen -r [host.tty]
3
4 Options:
5 -4 Resolve hostnames only to IPv4 addresses.
6 -6 Resolve hostnames only to IPv6 addresses.
7 -a Force all capabilities into each windows termcap.
8 -A -[r|R] Adapt all windows to the new display width & height.
9 -c file Read configuration file instead of .screenrc.
10 -d (-r) Detach the elsewhere running screen (and reattach here).
11 -dmS name Start as daemon: Screen session in detached mode.
12 -D (-r) Detach and logout remote (and reattach here).
13 -D -RR Do whatever is needed to get a screen session.
14 -e xy Change command characters.
15 -f Flow control on, -fn = off, -fa = auto.
16 -h lines Set the size of the scrollback history buffer.
17 -i Interrupt output sooner when flow control is on.
18 -l Login mode on (update /var/run/utmp), -ln = off.
19 -ls [match] or
20 -list Do nothing, just list our SockDir [on possible matches].
21 -L Turn on output logging.
22 -m ignore $STY variable, do create a new screen session.
23 -O Choose optimal output rather than exact vt100 emulation.
24 -p window Preselect the named window if it exists.
25 -q Quiet startup. Exits with non-zero return code if unsuccessful.
26 -Q Commands will send the response to the stdout of the querying process.
27 -r [session] Reattach to a detached screen process.
28 -R Reattach if possible, otherwise start a new session.
29 -s shell Shell to execute rather than $SHELL.
30 -S sockname Name this session

.sockname instead of

...
31 -t title Set title. (windows name).
32 -T term Use term as $TERM for windows, rather than "screen".
33 -U Tell screen to use UTF-8 encoding.
34 -v Print "Screen version 4.01.00devel (GNU) 2-May-06".
35 -wipe [match] Do nothing, just clean up SockDir [on possible matches].
36 -x Attach to a not detached screen. (Multi display mode).
37 -X Execute as a screen command in the specified session.

 

在linux使用过程中,如果有人想请你帮忙,可以使用screen程序来操作,使你和被帮助人的终端设备同步打印相同的信息,相当于终端共享,便于解决问题。

screen -S help  开启一个名为help的screen的页面

screen -ls    查看当前是否有人建立screen页面

screen -x help  通过help名来加入screen。

加入之后便可以两个终端同步打印输入输出的信息。

 

Linux常用命令使用格式



推荐阅读
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • 本文介绍了lua语言中闭包的特性及其在模式匹配、日期处理、编译和模块化等方面的应用。lua中的闭包是严格遵循词法定界的第一类值,函数可以作为变量自由传递,也可以作为参数传递给其他函数。这些特性使得lua语言具有极大的灵活性,为程序开发带来了便利。 ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • 本文介绍了C#中数据集DataSet对象的使用及相关方法详解,包括DataSet对象的概述、与数据关系对象的互联、Rows集合和Columns集合的组成,以及DataSet对象常用的方法之一——Merge方法的使用。通过本文的阅读,读者可以了解到DataSet对象在C#中的重要性和使用方法。 ... [详细]
  • 本文介绍了OC学习笔记中的@property和@synthesize,包括属性的定义和合成的使用方法。通过示例代码详细讲解了@property和@synthesize的作用和用法。 ... [详细]
  • 本文介绍了在SpringBoot中集成thymeleaf前端模版的配置步骤,包括在application.properties配置文件中添加thymeleaf的配置信息,引入thymeleaf的jar包,以及创建PageController并添加index方法。 ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 本文介绍了在Linux下安装Perl的步骤,并提供了一个简单的Perl程序示例。同时,还展示了运行该程序的结果。 ... [详细]
  • 后台获取视图对应的字符串
    1.帮助类后台获取视图对应的字符串publicclassViewHelper{将View输出为字符串(注:不会执行对应的ac ... [详细]
  • 《数据结构》学习笔记3——串匹配算法性能评估
    本文主要讨论串匹配算法的性能评估,包括模式匹配、字符种类数量、算法复杂度等内容。通过借助C++中的头文件和库,可以实现对串的匹配操作。其中蛮力算法的复杂度为O(m*n),通过随机取出长度为m的子串作为模式P,在文本T中进行匹配,统计平均复杂度。对于成功和失败的匹配分别进行测试,分析其平均复杂度。详情请参考相关学习资源。 ... [详细]
  • 高质量SQL书写的30条建议
    本文提供了30条关于优化SQL的建议,包括避免使用select *,使用具体字段,以及使用limit 1等。这些建议是基于实际开发经验总结出来的,旨在帮助读者优化SQL查询。 ... [详细]
  • 本文总结了Java中日期格式化的常用方法,并给出了示例代码。通过使用SimpleDateFormat类和jstl fmt标签库,可以实现日期的格式化和显示。在页面中添加相应的标签库引用后,可以使用不同的日期格式化样式来显示当前年份和月份。该文提供了详细的代码示例和说明。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • Html5-Canvas实现简易的抽奖转盘效果
    本文介绍了如何使用Html5和Canvas标签来实现简易的抽奖转盘效果,同时使用了jQueryRotate.js旋转插件。文章中给出了主要的html和css代码,并展示了实现的基本效果。 ... [详细]
author-avatar
拍友2602924913
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有