DEV Community

nabbisen
nabbisen

Posted on

OpenBSD's ls: `-T` option shows complete time information

In OpenBSD, ls -l shows time information flexibly due to the last-modified years.

  1. Rows about the year in or before last year
    • Format = "date - year"
  2. Rows about this year
    • Format = "date - time"
$ ls -l $SOME_DIR/
total [...]
-rw-rw-r--   1 www  wheel   3063 Feb 12  2019 LICENSE.txt
-rw-rw-r--   1 www  wheel   4717 Mar 26 10:12 README.md
Enter fullscreen mode Exit fullscreen mode

It's usually useful.
On the other hand, there is the way to get full time of all rows, that is adding -T option.

$ ls -lT $SOME_DIR/
total [...]
-rw-rw-r--   1 www  wheel   3063 Feb 12 13:28:18 2019 LICENSE.txt
-rw-rw-r--   1 www  wheel   4717 Mar 26 10:12:17 2020 README.md
Enter fullscreen mode Exit fullscreen mode

Besides, this -T option is similar with --full-time option in Linux but the latter has a different display format which shows nano seconds.

Top comments (0)