Horje
current date bash Code Example
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"
current date 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
git overwrite local branch with remote Code Example git overwrite local branch with remote Code Example
remove all files with extension bash Code Example remove all files with extension bash Code Example
linux convert files in folder Code Example linux convert files in folder Code Example
flutter web run using vscode Code Example flutter web run using vscode Code Example
psycopg2.OperationalError: could not connect to server: Connection refused         Is the server running on host "127.0.0.1" and accepting         TCP/IP connections on port 5432? Code Exampl psycopg2.OperationalError: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? Code Exampl

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