ls --time=use does not match ls -t

Technical issues/questions of an intermediate or advanced nature.
User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

ls --time=use does not match ls -t

Post#1 by Ed_P » 07 Feb 2024, 22:53

Code: Select all

guest@porteus:~$ ls --time=use  /mnt/nvme0n1p7/porteus5.0/changes 
porteussave.dat*  50save.dat*  50saveBkup.dat*  501saveBkup.dat*

guest@porteus:~$ ls -t /mnt/nvme0n1p7/porteus5.0/changes 
50save.dat*  porteussave.dat*  50saveBkup.dat*  501saveBkup.dat*

guest@porteus:~$ ls -gt /mnt/nvme0n1p7/porteus5.0/changes 
total 2097152
-rwxrwxrwx 1 root 536870912 Feb  7 16:51 50save.dat*
-rwxrwxrwx 1 root 536870912 Feb  7 10:56 porteussave.dat*
-rwxrwxrwx 1 root 536870912 Feb  5 13:29 50saveBkup.dat*
-rwxrwxrwx 1 root 536870912 Nov 15 19:15 501saveBkup.dat*
Clearly --time=use does not match the files usage time. :%)
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3941
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

ls --time=use does not match ls -t

Post#2 by ncmprhnsbl » 08 Feb 2024, 01:31

man ls says:

Code: Select all

-t                         sort by time, newest first; see --time

Code: Select all

--time=WORD            select which timestamp used to display or sort;
                               access time (-u): atime, access, use;
                               metadata change time (-c): ctime, status;
                               modified time (default): mtime, modification;
                               birth time: birth, creation;
                             with -l, WORD determines which time to show;
                             with --sort=time, sort by WORD (newest first)
--time=use is access time : "access time (-u): atime, access, use;"
and
-t is modified time : "modified time (default): mtime, modification;" ie. -t equals --time=mtime or modification
which i guess can be different
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

ls --time=use does not match ls -t

Post#3 by Ed_P » 08 Feb 2024, 07:08

Wow! I've seen legal documents less confusing. :lol: Thank you ncmp. :beer:

Another time question. My new Porteus system's DE displays the current time, but for some reason when I update a file it's being saved with the UTC time. :o :hmmm: Suggestion?
Ed

Post Reply