loading...

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

nabbisen profile image Heddi Nabbisen ・1 min read

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

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

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

Posted on by:

nabbisen profile

Heddi Nabbisen

@nabbisen

An ICT designer/developer and a security monk. "With a cool brain and a warm heart", I am challenging unsolved problems in our society. I use OpenBSD/Rust/etc.

Discussion

markdown guide