Horje
echo date in bash Code Example
datetime echo shell script
$(date '+%d/%m/%Y %H:%M:%S')
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"
echo date in bash
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}"




Shell

Related
switch to a different remote branch git Code Example switch to a different remote branch git Code Example
pyinstaller Code Example pyinstaller Code Example
visual studio code ubuntu Code Example visual studio code ubuntu Code Example
find the size of file in linux Code Example find the size of file in linux Code Example
bash cd or make dir if not exists Code Example bash cd or make dir if not exists Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9