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
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 (