Marco Network class exercises

Source: Internet
Author: User


August 21

1 What is the relationship between CentOS and Linux? What is the relationship between CentOS and Rhel?


CentOS is one of Gnu/linux's many distributions and is based on Linux the operating system established by the kernel.


CentOS is a new version of the source code that will be released from RHEL, creating a binary that can be used.

So, CentOS can get all the features of RHEL, even better software. However, CentOS does not provide commercial support to users and, of course, is not responsible for any business.


2 Gets the use format for the date command: Shows the day of the week? Set the current system time? Date?

CentOS 7:timedatectl command to view and set the time?


Show today's Day of the week

[Email protected] ~]# date +%a

Monday

[Email protected] ~]#


Set Current system time

[[email protected] ~]# date-s "20080524 01:02:03"

Sat May 01:02:03 CST 2008

[[Email protected] ~]# Date

Sat May 01:02:05 CST 2008

[Email protected] ~]#


Other examples:

#date-S//Set current time, only root privileges can be set, others can only be viewed.


#date-S 20061010//set to 20061010, this will set the specific time to empty 00:00:00


#date-S 12:23:23//Set specific time and do not change the date


#date-S "12:12:23 2006-10-10″//so you can set all the time


August 23 1 displays a file or directory that starts with a non-letter, followed by a letter and any character of any length, in the/etc directory


[Email protected] ~]# ls-ld/etc/[^a-z][a-z]*


-D: Displays only the directory name, not the list of contents under the directory. Displays the symbolic link file itself without displaying the list of directories it points to;



2 Copy all files or directories ending with. D in the/etc directory to the/tmp/mageedu.com directory.


[Email protected] ~]# mkdir/tmp/mageedu.com/

cp-af/etc/*. [d]/tmp/mageedu.com/


-A: The effect of this parameter is the same as specifying the "-DPR" parameter;


3 The use of the tee command


Function Description: Reads the standard input data and outputs its contents to a file.


Syntax: Tee [-ai][--help][--version][file ...]


Note: The tee instruction reads data from a standard input device and outputs its contents to a standard output device while saving it as a file.

Parameters:

-A or--append attaches to the back of the existing file rather than overwriting it.

The interrupt signal is ignored by the-i-i or--ignore-interrupts.


Example:

[email protected] ~]# who | Tee who.out

Root pts/0 2009-02-17 07:47 (123.123.123.123)

[email protected] ~]# cat Who.out

Root pts/0 2009-02-17 07:47 (123.123.123.123)

[Email protected] ~]# pwd | Tee-a Who.out

/root



4 How to create a directory: X_m, X_n, Y_m, Y_n?

[[email protected] ~]# mkdir {x,y}_{m,n}

[[email protected] ~]# ls

Anaconda-ks.cfg install.log install.log.syslog x_m x_n y_m y_n

[Email protected] ~]#

Marco Network class exercises

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.