热门标签 | 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常用命令使用格式



推荐阅读
  • 深入解析动态代理模式:23种设计模式之三
    在设计模式中,动态代理模式是应用最为广泛的一种代理模式。它允许我们在运行时动态创建代理对象,并在调用方法时进行增强处理。本文将详细介绍动态代理的实现机制及其应用场景。 ... [详细]
  • 通常情况下,修改my.cnf配置文件后需要重启MySQL服务才能使新参数生效。然而,通过特定命令可以在不重启服务的情况下实现配置的即时更新。本文将详细介绍如何在线调整MySQL配置,并验证其有效性。 ... [详细]
  • 本题要求在一组数中反复取出两个数相加,并将结果放回数组中,最终求出最小的总加法代价。这是一个经典的哈夫曼编码问题,利用贪心算法可以有效地解决。 ... [详细]
  • 主调|大侠_重温C++ ... [详细]
  • ListView简单使用
    先上效果:主要实现了Listview的绑定和点击事件。项目资源结构如下:先创建一个动物类,用来装载数据:Animal类如下:packagecom.example.simplelis ... [详细]
  • 本文详细介绍了如何解压并安装MySQL集群压缩包,创建用户和组,初始化数据库,配置环境变量,并启动相关服务。此外,还提供了详细的命令行操作步骤和常见问题的解决方案。 ... [详细]
  • 深入剖析JVM垃圾回收机制
    本文详细探讨了Java虚拟机(JVM)中的垃圾回收机制,包括其意义、对象判定方法、引用类型、常见垃圾收集算法以及各种垃圾收集器的特点和工作原理。通过理解这些内容,开发人员可以更好地优化内存管理和程序性能。 ... [详细]
  • 本文档介绍了如何在Visual Studio 2010环境下,利用C#语言连接SQL Server 2008数据库,并实现基本的数据操作,如增删改查等功能。通过构建一个面向对象的数据库工具类,简化了数据库操作流程。 ... [详细]
  • Linux中的yum安装软件
    yum俗称大黄狗作用:解决安装软件包的依赖关系当安装依赖关系的软件包时,会将依赖的软件包一起安装。本地yum:需要yum源,光驱挂载。yum源:(刚开始查看yum源中的内容就是上图 ... [详细]
  • 鼠标悬停出现提示信息怎么做
    概述–提示:指启示,提起注意或给予提醒和解释。在excel中会经常用到给某个格子增加提醒信息,比如金额提示输入数值或最大长度值等等。设置方式也有多种,简单的,仅为单元格插入批注就可 ... [详细]
  • 探讨 HDU 1536 题目,即 S-Nim 游戏的博弈策略。通过 SG 函数分析游戏胜负的关键,并介绍如何编程实现解决方案。 ... [详细]
  • 本文探讨了在 SQL Server 中使用 JDBC 插入数据时遇到的问题。通过详细分析代码和数据库配置,提供了解决方案并解释了潜在的原因。 ... [详细]
  • 本文介绍了如何通过Java代码计算一个整数的位数,并展示了多个基础编程示例,包括求和、平均分计算、条件判断等。 ... [详细]
  • 本文详细介绍了 Android 开发中 layout_gravity 属性的使用方法及其在不同布局下的效果,旨在帮助开发者更好地理解和利用这一属性来精确控制视图的布局。 ... [详细]
  • 编写css让div2在div1的右下角? ... [详细]
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社区 版权所有