bash get current date

# syntax
$(date)

# example (when running the command of "date")
echo $(date)

# OUTPUT: Mon May 11 13:20:57 SAST 2020
# To return a specific FORMAT, search "bash get date format"

4
5
MPO 105 points

                                    date +'FORMAT'
 
### mm/dd/yyyy ###
date +'%m/%d/%Y'
 
## Time in 12 hr format ###
date +'%r'
 
## backup dir format ##
backup_dir=$(date +'%m/%d/%Y')
echo "Backup dir for today: /nas04/backups/${backup_dir}"

4 (5 Votes)
0
4.6
10
Max Swan 75 points

                                    date +'FORMAT'
 
### mm/dd/yyyy ###
date +'%m/%d/%Y'
 
## Time in 12 hr format ###
date +'%r'
 
## backup dir format ##
backup_dir=$(date +'%m/%d/%Y')
echo "Backup dir for today: /nas04/backups/${backup_dir}"

4.6 (10 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
today's date in bash script bash date -r current bash script date time now get current date and time in shell script how to get date in linux bash shell get date time current date shell script bash current datetime bash date show date bash today date get today date in bash bash find date gettind date using bash get current date time shell script linux bash echo date bash print date bash get today's date in bash script get date shell bash shell get date time how to get current date time in bash how to get current date in seconds in bash linux shell get current date get date in bash shell how to get latest date in bash date shell get the current date linux shell how to echo the current date bash get date time bash script get current date and time bash script today's date Bash Today echo todays date bash how bash show date and time todays date bash script current date bash how to get current date in shell bash string with current date and time bash how to print current datetime linux bash script cat current date bash show date print current date in bash bin bash get current date and time linux bash get date print date bash show date in bash bash display date bash script current date time bash date today date today bash get date bash script linux date bash get bash date time get date and time bash bash get today date how to get the current date in shell script shell get current date bash echo date time linux bash date today date shell script get current day time bash bash echo date time linux bash get current date time how to show the date in bash get date in bash script today date in bash get current date and time bash echo date bash get today bash shell script echo current date time get date and time in bash echo current date and time bash get full date in bash bash current date with time how to get current date in bash date in bash get current date in linux shell script evaluate the date of today in bash script echo current date time bash bash date and time now bash print time current date bash script get date time in bash how to print the date in linux linux echo with date go get current path getting current day in bash get current date in linux command bin bash generate current date date command sh script shell get date and time how to echo date in linux current data linux shell script to get a date shell get today date echo current date linux date and time in bash how to print date using script -1 day from current date in bash get current date in bash sh get date printing date in shell script shell script to get the date get date and time in bash script get time date sh current date unix linux script display date and time get date from linux get date unix how to get current date with bash bash get date format get current date unix get date fromat in echo in bash script get date in bash bash current date time sh current datetime terminal echo date bash script get sysdate in bash bash get date at time print out current date on linux bash script get date unix shell code date in text get current date shell bash datetime now get today date in bash script bash date return? bash get datetime echo todays date to output linux linux bash show current date linux bash show date of current directory current day from date in linux get current datetime bash current date in unix sh file get date linux print date display today's date inn linux without date command date and tine bash shell script get datetime date in bash script echo current date bash date linux now linux printing current date bash script get current date how to add current date in bash script get todays date echo bash how to print date and time and hours in shell script how to print date in shell script bash show date time date time shell script bash get date and time sysdate linux how to get current date and time in shell script shell script current date and time bash script how to find by date bash script find date print current date time in shell script unix echo current time print date shell script bash now datetime bash now date bash get dates print date with some comment in unix bash date and time how to get time and date in string linux get current date in shell linux bash print date linux echo date time how to get date in shell script bash echo current date and time echo current date time datetime in bash display date using shell script bash get time and date print the date in bash display date and time shell script select date on shaell linux date now bash get date time on a script current date in bash how to get date in bash shell get date linux get date bash current date bash current date/time print date in shell script current date bash get date in shell script date on shell script bash get date bash get time from date shell date and time linux show today date how to fetch date and time in shell linux command sysdate current time function in shell script apply linux date on echo echo current date in bash get date shell script bash current time bash datetime now to string shell script date time in linux print todays date shell script get today's date echo date time bash linux bash current date current month in shell display today date time in shell assign current date to a variable bash script bash today's date bash get current date and time shell script current datetime today date in shell script linux echo todays date print current date linux shell script current time shell script to check date bash print current time with format get all date linux get date bash get date time in shell script bash date now how to get current date shell bash get current date time bash get current time shell get current datge shell script get date Capture datetime bash get date linux print time bash writing the current date in linux echo date in bash system time bash var get current time in shell shell get current datetime bash shell now shell script show date and time print current time bash bash script to print date and time bash now linux current date display time bash how to echo current timestamp in shell script how to echo current time in shell script bash date noew how to get current date on linux get date bash linux bash print system time get date version linux bash print current time bash get today's date bash get todya date bach get current date unix get datetime unix print current time get current date bash get current date linux shell get current date in shell script bash get tdate linux current date in yyyy-mm-dd bash print date and time bash get current date
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source