热门标签 | 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语言具有极大的灵活性,为程序开发带来了便利。 ... [详细]
  • 本文介绍了在Windows环境下如何配置php+apache环境,包括下载php7和apache2.4、安装vc2015运行时环境、启动php7和apache2.4等步骤。希望对需要搭建php7环境的读者有一定的参考价值。摘要长度为169字。 ... [详细]
  • CentOS 7部署KVM虚拟化环境之一架构介绍
    本文介绍了CentOS 7部署KVM虚拟化环境的架构,详细解释了虚拟化技术的概念和原理,包括全虚拟化和半虚拟化。同时介绍了虚拟机的概念和虚拟化软件的作用。 ... [详细]
  • 本文介绍了数据库的存储结构及其重要性,强调了关系数据库范例中将逻辑存储与物理存储分开的必要性。通过逻辑结构和物理结构的分离,可以实现对物理存储的重新组织和数据库的迁移,而应用程序不会察觉到任何更改。文章还展示了Oracle数据库的逻辑结构和物理结构,并介绍了表空间的概念和作用。 ... [详细]
  • 本文介绍了使用Java实现大数乘法的分治算法,包括输入数据的处理、普通大数乘法的结果和Karatsuba大数乘法的结果。通过改变long类型可以适应不同范围的大数乘法计算。 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • Metasploit攻击渗透实践
    本文介绍了Metasploit攻击渗透实践的内容和要求,包括主动攻击、针对浏览器和客户端的攻击,以及成功应用辅助模块的实践过程。其中涉及使用Hydra在不知道密码的情况下攻击metsploit2靶机获取密码,以及攻击浏览器中的tomcat服务的具体步骤。同时还讲解了爆破密码的方法和设置攻击目标主机的相关参数。 ... [详细]
  • 本文介绍了C#中数据集DataSet对象的使用及相关方法详解,包括DataSet对象的概述、与数据关系对象的互联、Rows集合和Columns集合的组成,以及DataSet对象常用的方法之一——Merge方法的使用。通过本文的阅读,读者可以了解到DataSet对象在C#中的重要性和使用方法。 ... [详细]
  • 本文介绍了在Linux下安装Perl的步骤,并提供了一个简单的Perl程序示例。同时,还展示了运行该程序的结果。 ... [详细]
  • 后台获取视图对应的字符串
    1.帮助类后台获取视图对应的字符串publicclassViewHelper{将View输出为字符串(注:不会执行对应的ac ... [详细]
  • Webmin远程命令执行漏洞复现及防护方法
    本文介绍了Webmin远程命令执行漏洞CVE-2019-15107的漏洞详情和复现方法,同时提供了防护方法。漏洞存在于Webmin的找回密码页面中,攻击者无需权限即可注入命令并执行任意系统命令。文章还提供了相关参考链接和搭建靶场的步骤。此外,还指出了参考链接中的数据包不准确的问题,并解释了漏洞触发的条件。最后,给出了防护方法以避免受到该漏洞的攻击。 ... [详细]
  • 高质量SQL书写的30条建议
    本文提供了30条关于优化SQL的建议,包括避免使用select *,使用具体字段,以及使用limit 1等。这些建议是基于实际开发经验总结出来的,旨在帮助读者优化SQL查询。 ... [详细]
  • 本文介绍了如何使用C#制作Java+Mysql+Tomcat环境安装程序,实现一键式安装。通过将JDK、Mysql、Tomcat三者制作成一个安装包,解决了客户在安装软件时的复杂配置和繁琐问题,便于管理软件版本和系统集成。具体步骤包括配置JDK环境变量和安装Mysql服务,其中使用了MySQL Server 5.5社区版和my.ini文件。安装方法为通过命令行将目录转到mysql的bin目录下,执行mysqld --install MySQL5命令。 ... [详细]
  • CentOS 6.5安装VMware Tools及共享文件夹显示问题解决方法
    本文介绍了在CentOS 6.5上安装VMware Tools及解决共享文件夹显示问题的方法。包括清空CD/DVD使用的ISO镜像文件、创建挂载目录、改变光驱设备的读写权限等步骤。最后给出了拷贝解压VMware Tools的操作。 ... [详细]
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社区 版权所有