Shell/Bash: date linux format yyyymmdd Example


Shell/Bash Example: This is the "date linux format yyyymmdd" Example. compiled from many sources on the internet by

date linux format yyyymmdd

# put current date as yyyy-mm-dd in $date
date=$(date '+%Y-%m-%d')

# put current date as yyyy-mm-dd HH:MM:SS in $date
date=$(date '+%Y-%m-%d %H:%M:%S')

# print current date directly
echo $(date '+%Y-%m-%d')

* Summary: This "date linux format yyyymmdd" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!