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



推荐阅读
  • 本文将介绍如何编写一些有趣的VBScript脚本,这些脚本可以在朋友之间进行无害的恶作剧。通过简单的代码示例,帮助您了解VBScript的基本语法和功能。 ... [详细]
  • 本文总结了2018年的关键成就,包括职业变动、购车、考取驾照等重要事件,并分享了读书、工作、家庭和朋友方面的感悟。同时,展望2019年,制定了健康、软实力提升和技术学习的具体目标。 ... [详细]
  • CSS 布局:液态三栏混合宽度布局
    本文介绍了如何使用 CSS 实现液态的三栏布局,其中各栏具有不同的宽度设置。通过调整容器和内容区域的属性,可以实现灵活且响应式的网页设计。 ... [详细]
  • python的交互模式怎么输出名文汉字[python常见问题]
    在命令行模式下敲命令python,就看到类似如下的一堆文本输出,然后就进入到Python交互模式,它的提示符是>>>,此时我们可以使用print() ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • 深入理解Cookie与Session会话管理
    本文详细介绍了如何通过HTTP响应和请求处理浏览器的Cookie信息,以及如何创建、设置和管理Cookie。同时探讨了会话跟踪技术中的Session机制,解释其原理及应用场景。 ... [详细]
  • 本文介绍了一款用于自动化部署 Linux 服务的 Bash 脚本。该脚本不仅涵盖了基本的文件复制和目录创建,还处理了系统服务的配置和启动,确保在多种 Linux 发行版上都能顺利运行。 ... [详细]
  • 如何在WPS Office for Mac中调整Word文档的文字排列方向
    本文将详细介绍如何使用最新版WPS Office for Mac调整Word文档中的文字排列方向。通过这些步骤,用户可以轻松更改文本的水平或垂直排列方式,以满足不同的排版需求。 ... [详细]
  • 本文介绍如何通过Windows批处理脚本定期检查并重启Java应用程序,确保其持续稳定运行。脚本每30分钟检查一次,并在需要时重启Java程序。同时,它会将任务结果发送到Redis。 ... [详细]
  • 优化ListView性能
    本文深入探讨了如何通过多种技术手段优化ListView的性能,包括视图复用、ViewHolder模式、分批加载数据、图片优化及内存管理等。这些方法能够显著提升应用的响应速度和用户体验。 ... [详细]
  • PyCharm中配置Pylint静态代码分析工具
    本文详细介绍如何在PyCharm中配置和使用Pylint,帮助开发者进行静态代码检查,确保代码符合PEP8规范,提高代码质量。 ... [详细]
  • 在计算机技术的学习道路上,51CTO学院以其专业性和专注度给我留下了深刻印象。从2012年接触计算机到2014年开始系统学习网络技术和安全领域,51CTO学院始终是我信赖的学习平台。 ... [详细]
  • c# – UWP:BrightnessOverride StartOverride逻辑 ... [详细]
  • 本文详细介绍了如何使用 Yii2 的 GridView 组件在列表页面实现数据的直接编辑功能。通过具体的代码示例和步骤,帮助开发者快速掌握这一实用技巧。 ... [详细]
  • 几何画板展示电场线与等势面的交互关系
    几何画板是一款功能强大的物理教学软件,具备丰富的绘图和度量工具。它不仅能够模拟物理实验过程,还能通过定量分析揭示物理现象背后的规律,尤其适用于难以在实际实验中展示的内容。本文将介绍如何使用几何画板演示电场线与等势面之间的关系。 ... [详细]
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社区 版权所有