Shell Script Introduction
Shell is a scripting language Aming_linux (public number) blog.lishiming.net (blog)
You can use logical judgments, loops, and other syntax
Functions can be custom-defined
The shell is a collection of system
Date instruction Related Usage exampleDate usage: date [OPTION] ... [+format]Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]]Enter Date directlyDate specified format display time: Date +%y_%m_%d, date +%y:%m:%dDate can be used to display or set
The Linux date command is used in linux shell programming. Before the date addition and subtraction operations are often used, they are calculated by using the expr function. In fact, the date command itself provides the date addition and
Mac date command, macdate
usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
Parameter Parsing:
-J: Use-j to use-f
-N: by default, if the scheduled process
Date command for simple use
Date: view the current system time
Date + % d
% Y years
% M month (01-12) % B (Jan-Dec) % B (January-December)
% D
% H hour (00-23) % I (01-12)
% M seconds
% S seconds
% S the number of seconds from January 1,
This article mainly introduces how to use ubuntu to modify the time, display the hardware time, and synchronize the system clock (how to use the date command). If you need a friend, refer to the following label: Ubuntu
1. the date command is mainly
The date command displays or sets the system time and dateGrammardate [options] [parameters]Options-D displays the time or date specified by the string. double quotation marks before and after strings-S sets the time or date specified by the string.
The date command is a common command for viewing datetime, and date MMDDHHMMYY.SS (the Order of modification) is used to change the timeLinux time is divided into system time and hardware time,[[email protected] doc]# clock---------------------------
The date command displays dates or sets the system date using the specified format.Command format:Date [Options] ... [+ format]Or: Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][.SS]]
Show Current Time
#显示当前日期, my Linux
Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/46538461Help information for the date command[Email protected] source]# date--helpUsage: date [options] ... [+ format]Or: Date [-u|--utc|--universal]
In the Linux environment, whether it is programming or other maintenance, time is essential, but also often use the operation of time, skilled use of the date command to express the time they want to express, can certainly give their work to bring
20.1 Shell Script IntroductionWhat is a shell?
Shell is a scripting language
You can use logical judgments, loops, and other syntax
Functions can be custom-defined
The shell is a collection of system commands
Shell scripts
What is Shellshell?
Shell is a scripting languagecan use logical judgment, circular judgment and other statements;functions can be customized;A shell is a collection of system commands, such as a batch command of Windows;Shell script can
Date [-JNU] [-D DST] [-R Seconds] [-T West] [-v[+|-]val[ymwdhms]] ... [fmtDate | [[[mm]dd]HH] mm[[cc]YY][.SS] [+format]Parameter resolution:-j: Use-j to use-f-N: By default, if a timed process is running, the date command sets the time
In Linux shell programming, the addition and subtraction of dates is often usedI used to use the expr function to calculate the problem.Actually, the date command itself provides the addition and subtraction of dates.Very convenient. For example:
Recently found that the date command is especially useful (not in Mac)1. Get today's date[Email protected] ~]# date +%y%m%d201411232. Get the date of a day" 2014-11-12 " +%y%m%D20141112This seems like crap, but it's okay, keep looking.3. Get a day
The date command is very often used, in addition to entering date directly, more often than not, we want to output in a specific format, each time before using the turn of Man or--help, write down to deepen the impression. Arguments to the date
20.5 logical judgments in shell scriptsLogical ExpressionsIn the [] bracket:-lt:=little than less than-le:=little && equal less than equals-eq:=equal equals-ne:=no Equal Not equal to-gt:=greater than greater than-ge:=greater && equal greater than or
Shell Script IntroductionShell is a scripting languageYou can use logical judgments, loops, and other syntaxFunctions can be custom-definedThe shell is a collection of system commandsShell scripts enable automated operations, which can greatly
Date command name: date permission: usage by all users: date [-u] [-d datestr] [-s datestr] [-- utc] [-- universal] [-- date = datestr] [-- set = datestr] [-- help] [-- version] [+ FORMAT] [MMDDhhmm [[CC] YY] [. ss] Note: date can be used to display
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.