How Do I Get the Current Date in Linux Terminal?
Contents How Do I Get the Current Time in Linux Terminal? to Display Date and Time Under Linux Operating System Using Command Prompt Use the Date Command. It...
Contents
How do I get the current time in Linux terminal?
To display date and time under Linux operating system using command prompt use the date command. It can also display the current time / date in the given FORMAT. We can set the system date and time as root user too.
Must Read
What is the command to find today’s date?
Sample shell script to display the current date and time
#!/bin/bash now=”$(date)” printf “Current date and time %sn” “$now” now=”$(date +’%d/%m/%Y’)” printf “Current date in dd/mm/yyyy format %sn” “$now” echo “Starting backup at $now, please wait…” # command to backup scripts goes here # …