How to echo date and time like this [day-month-year/hour-minutes-seconds] including "[" and "/". I also need to redirect it in a file. Thanks
Tell me more
×
Ask Ubuntu is a question and answer site for
Ubuntu users and developers. It's 100% free, no registration required.
|
Look at
and it gives a list of date format specifiers. To get the format you want (assuming you want local time, and all fields padded with zeroes, 24-hour time), use the format specifier
To redirect to a file, use standard shell redirection ( |
|||
