Welcome to add QQ Group: 414835967 Exchange Linux Technology and download the relevant software package and accompanying notes in the group sharing fileKnowledge Points:Linux system directory structureRelative/absolute pathSet the
Linux gets time in the shellGet the date of the dayDate +%y-%m-%dOutput: 2011-07-28Assigns the current date to a date variabledate=$ (Date +%y%m%d)Sometimes we need to use dates before or after today, so we can use the-D parameter of dateGet
#man date to see the Help file for date#date Get the current time#date-D " -1week" +%y%m%d get last Sunday issue (Day,month,year,hour)#date--date= " -24 hour" +%y%m%d Ibid.date_now= ' date+%s ' shell script to assign variable valuesPercent output%
Get the date of the dayDate +%y-%m-%dOutput: 2011-07-28Assigns the current date to a date variabledate=$ (Date +%y%m%d)Sometimes we need to use dates before or after today, so we can use the-D parameter of dateGet Tomorrow's dateDate-d Next-day
Example: Use the date command to output the "XXXX-XX-XX" format, such as 2015-03-01.#date +%y-%m-%d 2015-03-0#date +%f2015-02-28The 1.date command enables a variety of format outputs, depending on the connection symbol between the representation
Shell generates a specified range of random numbers and random stringsCategory: Shell 2014-04-22 22:17 20902 People read Comments (5) favorite reports ShellrandomurandomuuidlinuxShell generates a specified range of random numbers and random strings1.
Help information for the date command[root@localhost source]# date--helpusage: date [options] ... [+ format]or: Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]]Displays the current time in the given format, or sets the system date. -D,--date=
Linux Tuning system time zone:Locate the appropriate time zone file/usr/share/zoneinfo/asia/shanghaiReplace the current/etc/localtime file with this fileIt's time for a date to be CST.If not, change the value of the TZ environment variable.Many
We generally use the "date-s" command to modify the system time. For example, the command to set the system time to June 10, 1996 is as follows.#date-S 06/10/96The command to set the system time to 1:12 P.M. 0 seconds is as follows.#date-S
The shell monitors cpu,memory,load average, logs to log, and notifies the administrator when the load is under pressure.Implementation principle:1. Get the value of Cpu,memory,load average2. Determine if the value exceeds the custom range, for
Recent learning needs to be based on different date data, do the same operation, if the manual operation over and over, too cumbersome, some of the taste of the foolish. So just think about the time as a variable under the shell, and then repeat the
Linux how to set the system time one-step. Friends who do experiments with Linux virtual machines will know. When you restore Linux to a certain point, VMware can not help you to reset the system time. So it's time to do it by hand. about how to set
One, modify the time zone
1. View the current time zone
Date-r
2. Modify Settings Time zone
Select target time zone with Tzselect
Tzselect
According to the prompts to select the appropriate time zone, and finally get the time zone settings,
Shell monitor Cpu,memory,load average, log to log, when load pressure, email notify admin.
Principle:
1. Get the value of the Cpu,memory,load average
2. Determine whether the value exceeds the scope of the customization, for example
Tag:%s lin str ges caching mechanism Printing is file name Buffers and Cached1). Similarities and differencesIn the Linux operating system, when the application needs to read the data in the file, the operating system
We generally use the "date-s" command to modify the system time. For example, the command to set the system time to June 10, 1996 is as follows.#date-S 06/10/96The command to set the system time to 1:12 P.M. 0 seconds is as follows.#date-S
Linux Date Modification TimeCommand format: Date-s modified time characterExample: Modifying the system date, not modifying the time (hours and seconds)# date-s 2020-12-20Example: Modifying the system time without modifying the date# date-s
Use shell scripts to simply simulate simultaneous read and write operations to specific filesFormat of file contents:Field1, Field2, field3, Field4As a delimiter, but there are spaces.
The script uses the following:
Get the date of the dayDate +%y-%m-%dOutput: 2011-07-28Assigns the current date to a date variabledate=$ (Date +%y%m%d)Sometimes we need to use dates before or after today, so we can use the-D parameter of dateGet Tomorrow's dateDate-d Next-day
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.