ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

02_02 linux操作系统及常用命令

2020-03-25 23:53:10  阅读:238  来源: 互联网

标签:02 linuxprobe type 常用命令 命令 file linux output root


一、

首先是date命令

%Command option arguments

通过man命令来获取命令的帮助,于是发现date有两个功能:

1、     查看时间,可以通过选项的配合达到自己想要的显示格式

2、     设置时间

%还有内部命令 help command,外部命令 command help。

%Linux shell 内部命令与外部命令有什么区别以及怎么辨别https://www.cnblogs.com/gavinpan/p/11248279.html

%type显示命令的类型。

 

%builtin 内建的

二、

Man:manual 命令手册

%手册需要分章节

1、     用户命令(/bin,/usr/bin,/usr/local/bin)

2、     系统调用

3、     库用户

4、     特殊文件(设备文件)

5、     文件格式

6、     游戏

7、     杂项(miscellaneous)

8、     管理命令(/sbin,/usr/sbin。/usr/loacl/sbin)

%可以通过whatis command来查看这个命令属于第几章节

%使用man命令以后怎么查看帮助文档(如果英文十级我觉得就OK了),

NAME:命令名称和功能介绍

SYNOPSIS:用法说明,包括可用的选项

DESCRIPTION:命令功能的详尽说明,可能包括每一个选项的意义

FILES:此命令相关的配置文件

BUGS:

EXAMPLES:使用示例

SEE ALSO:另外参照

%在查看文档时用到的按键:

翻屏:

   向后翻一屏:SPACE

   向前翻一屏:b

   向后翻一行:ENTER

   向前翻一行:k

查找:

/KEYWORD: 向后

n: 下一个

N:前一个

?KEYWORD:向前

n: 下一个

N:前一个

q: 退出

三、有关一些开源项目的配置可以用google来搜索

%apache hadoop

%关于时间还有一个命令 hwclock:

-s, --hctosys

Set the System Time from the Hardware Clock.Also  set  the  kernel's  timezone  value to the local timezone as indicated by the TZ environment variable  and/or  /usr/share/zone‐info,  as  tzset(3) would interpret them.  The obsolete tz_dsttime field of the kernel's timezone value is  set  to  DST_NONE.(For details on what this field used to mean, see settimeofday(2).)This is a good option to use in one of the system startup scripts.

-w, --systohc

Set the Hardware Clock to the current System Time.

Hardware 硬件

四、

%cal :显示日历用的

五、作业

练习:

1、     echo是内部命令还是外部命令?

[root@linuxprobe ~]# type echo

echo is a shell builtin

2、     其作用?

[root@linuxprobe ~]# help echo | [root@linuxprobe ~]# man help

%在新的一行里显示标准的输出

3、如何显示“The year is 2013. Today is 26.”为两行?

[root@linuxprobe ~]# echo -e "the year os 2020.\ntoday is 25"

the year os 2020.

today is 25

转义,逃逸

 

练习:

1、     printf是内部命令还是外部命令?

[root@linuxprobe ~]# type printf

printf is a shell builtin

2、     其作用?

Formats and prints ARGUMENTS under control of the FORMAT.

在FORMAT的控制下格式化和打印ARGUMENTS

3、如何显示“The year is 2013. Today is 26.”为两行?

 

[root@linuxprobe ~]# printf "the year is 2013.today is 25"

the year is 2013.today is 25[root@linuxprobe ~]# printf "the year is 2013.\ntoday isthe year is 2013.

today is 25

4    、file命令及其用法。

[root@linuxprobe ~]# type file

file is /usr/bin/file

[root@linuxprobe ~]# file --help

Usage: file [OPTION...] [FILE...]

Determine type of FILEs.

 

      --help                 display this help and exit

  -v, --version              output version information and exit

  -m, --magic-file LIST      use LIST as a colon-separated list of magic

                               number files

  -z, --uncompress           try to look inside compressed files

  -b, --brief                do not prepend filenames to output lines

  -c, --checking-printout    print the parsed form of the magic file, use in

                               conjunction with -m to debug a new magic file

                               before installing it

  -e, --exclude TEST         exclude TEST from the list of test to be

                               performed for file. Valid tests are:

                               ascii, apptype, compress, elf, soft, tar, tokens, troff

  -f, --files-from FILE      read the filenames to be examined from FILE

  -F, --separator STRING     use string as separator instead of `:'

  -i, --mime                 output MIME type strings (--mime-type and

                               --mime-encoding)

      --apple                output the Apple CREATOR/TYPE

      --mime-type            output the MIME type

      --mime-encoding        output the MIME encoding

  -k, --keep-going           don't stop at the first match

  -l, --list                 list magic strength

  -L, --dereference          follow symlinks (default)

  -h, --no-dereference       don't follow symlinks

  -n, --no-buffer            do not buffer output

  -N, --no-pad               do not pad output

  -0, --print0               terminate filenames with ASCII NUL

  -p, --preserve-date        preserve access times on files

  -r, --raw                  don't translate unprintable chars to \ooo

  -s, --special-files        treat special (block/char devices) files as

                             ordinary ones

  -C, --compile              compile file specified by -m

  -d, --debug                print debugging messages

 

标签:02,linuxprobe,type,常用命令,命令,file,linux,output,root
来源: https://www.cnblogs.com/shareformlwh/p/12571640.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有