Setting time format preference in unix (Mac-Terminal)
Solution 1:
Using GNU ls, on Linux, there is a --time-style
flag you can use to specify one of a few pre-defined time types, or specifying a completely custom +FORMAT
style like the date
command accepts. However, BSD ls, which Apple ships, does not support this flag.
I've seen similar discrepancies in commands like date
and tar
as well, all rooted in the differences between the GNU and BSD variants.
Solution 2:
The Mac OS terminal uses a bash shell. The prompt is controlled by the PS1
environment variable described more here. Try this for example.
export PS1='\t$ '
It will give you a prompt looking something like this
19:40:14$