LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-18-2023, 08:18 PM   #1
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,924
Blog Entries: 1

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
list files with size and timestamp with name before size and time?


Is there a directory listing utility that can list like this?
Code:
initrd-5.4.14-2-default 10952040 Mar  1  2020
initrd-5.5.13-1-default 11592464 Jun 14  2020
initrd-5.6.14-1-default 11639512 Jun 14  2020 
initrd-5.7.11-1-default 11679304 Aug  7  2020
or
Code:
13486944 2021-11-20 01:28 initrd-5.14.14-3-default
13488620 2021-11-20 01:15 initrd-5.13.12-1-default
16421181 2022-02-15 01:08 initrd-5.15.12-1-default
16583668 2022-02-15 01:23 initrd-5.16.8-1-default
If there's anything in the ls man page, it's escaping me. Basically what I'm after is arranging the output so that the sort order is the first data printed on each output line, with owner/group/permissions all omitted.
 
Old 02-18-2023, 09:32 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,172

Rep: Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126
Simple one-liner should do it - make an alias for it. for example ...
Code:
 ls -l | awk '{print $9,$5,$6,$7,$8}' | column -t
You could do a lot more (like formatting) in the awk, but why bother.
 
Old 02-19-2023, 01:11 AM   #3
lvm_
Senior Member
 
Registered: Jul 2020
Posts: 1,026

Rep: Reputation: 358Reputation: 358Reputation: 358Reputation: 358
Methinks this wouldn't handle filename with spaces very well - names are last for a reason, and there is a question of links too... I'd rather use find's printf command which has all the fields you may want arranged the way you like.
 
Old 02-19-2023, 01:19 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,399
Blog Entries: 3

Rep: Reputation: 3779Reputation: 3779Reputation: 3779Reputation: 3779Reputation: 3779Reputation: 3779Reputation: 3779Reputation: 3779Reputation: 3779Reputation: 3779Reputation: 3779
I would look at stat instead.
 
Old 02-19-2023, 02:51 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,172

Rep: Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126Reputation: 4126
Quote:
Originally Posted by lvm_ View Post
Methinks this wouldn't handle filename with spaces very well
Such abominations exist ?. Not in this neck of the woods.

But yes, all the objections raised above are valid. The OP is experienced enough to choose something appropriate.
 
Old 02-19-2023, 02:51 PM   #6
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,660

Rep: Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584

find with printf ?

 
Old 02-21-2023, 02:26 AM   #7
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,861

Rep: Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225
If your goal is to sort then consider the builtin --sort in the ls command.
Example
ls -l --sort=size
or its short form
ls -lS
Consult the man page for the options
man ls

Last edited by MadeInGermany; 02-21-2023 at 02:28 AM.
 
Old 02-21-2023, 02:53 AM   #8
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,924

Original Poster
Blog Entries: 1

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
All I needed was in the first response. I was hoping for something more convenient, but it did enough of the job to minimize need to edit, which in the end was to compile this history of kernel & initrd growth as experienced with my *SUSE installations:
Code:
## sorted by version
initrd-2.6.13-15.18-default 1702569  Jan  21  2008	# 10.0 586
initrd-2.6.16.54-0.2.3-defa 2406334  Jan  23  2008	# 10.1 586
initrd-2.6.18.8-0.13-defaul 2850853  Sep   2  2009	# 10.2 586
initrd-2.6.22.19-0.4-defaul 4183477  Sep   2  2009	# 10.3 586
initrd-2.6.27.7-10-pae      5477149  Jan   9  2009	# 11.0 586
initrd-2.6.27.45-0.1-pae    5734283  Jul  16  2010	# 11.1 32bCPU
initrd-2.6.27.56-0.1-pae    5869614  Apr  16  2011	# 11.1 64bCPU
initrd-2.6.31.14-0.8-deskto 7040751  May  10  2011	# 11.2 586
initrd-2.6.34.10-0.6-deskto 8398655  Aug  13  2013	# 11.3 586
initrd-2.6.37.1-1.2-desktop 6576444  Mar  29  2014	# 11.4 64bCPU
initrd-2.6.37.6-0.20-deskto 8735122  Oct  19  2012	# 11.4 32bCPU
initrd-3.0.101-79-desktop   6665694  Mar  30  2014	# 11.4 Evergreen
initrd-3.1.10-1.29-desktop  4553149  Jul  18  2013	# 12.1
initrd-3.4.63-2.44-desktop  7760033  Nov  18  2013	# 12.2
initrd-3.7.10-1.45-desktop  6275177  Dec  21  2014	# 12.3
initrd-3.12.67-64-desktop   6221443  Jan  27  2017	# 13.1
initrd-3.16.7-7-desktop     5357468  Dec  31  2014	# 13.2
initrd-4.1.39-56-default    5647008  Jun   2  2017	# 42.1
initrd-4.3.3-1-default     10341436  Dec  30  2015	# tw686
initrd-4.4.0-1-default     10028700  Jan  25  2015	# tw686
initrd-4.4.104-18-default   7153396  Jan  10  2018	# 42.2
initrd-4.4.180-102-default  7595048  Jul  18  2019	# 42.3
initrd-4.5.0-3-default     38129584  Apr  13  2016	# tw686
initrd-4.8.14-1-default     7930208  Dec  21  2016	# tw686
initrd-4.12.14-lp150.12-def 8571580  Dec  02  2019	# 15.0
initrd-4.12.14-lp151.28-def 8907352  Feb  18  2021	# 15.1
initrd-4.17.14-1-default    9056972  Aug  22  2018
initrd-4.18.15-1-default    9033712  Jan   2  2019
initrd-4.19.12-1-default    9123844  Jan  27  2019
initrd-4.20.13-1-default   10428544  Mar  22  2019
initrd-5.0.13-1-default    10837696  Jul   2  2019
initrd-5.1.16-1-default    10617948  Jul  28  2019
initrd-5.2.14-1-default    11064692  Oct  20  2019
initrd-5.3.12-2-default    12056032  Oct  14  2020
initrd-5.3.18-152.106-defau 9213516  Feb   6  2022	# 15.2
initrd-5.3.18-153.59-defau 12368272  Jan  17  2023	# 15.3
initrd-5.4.12-1-default    11226188  Jan  23  2020
initrd-5.5.13-1-default    12096204  Jun  17  2020
initrd-5.6.14-1-default    12140896  Jun  17  2020
initrd-5.7.11-1-default    12083116  Sep  24  2020
initrd-5.8.15-1-default    12427040  Jan  17  2021
initrd-5.9.14-1-default    12398032  Jan  17  2021
initrd-5.10.16-1-default   13056856  Mar   3  2021
initrd-5.11.16-1-default   13098488  May  16  2021
initrd-5.12.13-1-default   12530356  Aug   1  2021
initrd-5.13.12-1-default   13223084  Nov  10  2021
initrd-5.14.14-3-default   14798684  Dec  27  2021
initrd-5.15.12-1-default   16188600  Feb  15  2022
initrd-5.16.15-1-default   13768256  Mar  27  2022
initrd-5.17.9-1-default    14713976  Jun  21  2022
initrd-5.18.12-1-default   15737248  Aug  11  2022
initrd-5.19.13-1-default   14101812  Oct  19  2022
initrd-6.0.12-1-default    14898852  Dec  31  2022
initrd-6.1.12-1-default    15297252  Feb  18  2023

vmlinuz-2.6.13-15.18-defaul 1545043  Oct   3  2007	# 10.0 586
vmlinuz-2.6.16.54-0.2.3-def 1259645  Nov  24  2007	# 10.1 586
vmlinuz-2.6.18.8-0.13-defau 1475740  Nov   6  2008	# 10.2 586
vmlinuz-2.6.22.19-0.4-defau 1596248  Aug  14  2009	# 10.3 586
vmlinuz-2.6.27.7-10-pae     2531696  Dec  18  2008	# 11.0 586
vmlinuz-2.6.27.45-0.1-pae   2503568  Feb  23  2010	# 11.1 32bCPU
vmlinuz-2.6.27.56-0.1-pae   2502896  Dec   2  2010	# 11.1 64bCPU
vmlinuz-2.6.31.14-0.8-deskt 4101152  Apr  12  2011	# 11.2 586
vmlinuz-2.6.34.10-0.6-deskt 4301248  Jan   3  2012	# 11.3 586
vmlinuz-2.6.37.1-1.2-deskto 4553312  Feb  22  2011	# 11.4 64bCPU
vmlinuz-2.6.37.6-0.20-deskt 4510304  Jun  15  2012	# 11.4 32bCPU
vmlinuz-3.0.101-79-desktop  4875760  Feb   6  2014	# 11.4 Evergreen
vmlinuz-3.1.10-1.29-desktop 4989808  Jun   7  2013	# 12.1
vmlinuz-3.4.63-2.44-desktop 4929872  Oct   3  2013	# 12.2
vmlinuz-3.7.10-1.45-desktop 5001816  Dec  18  2014	# 12.3
vmlinuz-3.12.67-64-desktop  5451096  Dec  12  2016	# 13.1
vmlinuz-3.16.7-7-desktop    5682504  Dec  17  2014	# 13.2
vmlinuz-4.1.39-56-default   5897160  May   2  2017	# 42.1
vmlinuz-4.3.3-1-default     5805744  Dec  18  2015	# tw686
vmlinuz-4.4.0-1-default     5882960  Jan  18  2016	# tw686
vmlinuz-4.4.104-18-default  6037176  Jan   4  2018	# 42.2
vmlinuz-4.4.180-102-default 6233784  Jun  17  2019	# 42.3
vmlinuz-4.5.0-3-default     5986720  Apr  7   2016	# tw686
vmlinuz-4.8.14-1-default    6195392  Dec  19  2016	# tw686
vmlinuz-4.12.14-lp150.12-de 7114864  Nov  12  2019	# 15.0
vmlinuz-4.12.14-lp151.28-de 7340112  Jan  13  2021	# 15.1
vmlinuz-4.17.14-1-default   7860016  Aug  13  2018
vmlinuz-4.18.15-1-default   7958320  Oct  24  2018
vmlinuz-4.19.12-1-default   8163040  Dec  28  2018
vmlinuz-4.20.13-1-default   8175328  Mar   4  2019
vmlinuz-5.0.13-1-default    8187616  May  10  2019
vmlinuz-5.1.16-1-default    8364256  Jul  16  2019
vmlinuz-5.2.14-1-default    8708320  Sep  21  2019
vmlinuz-5.3.12-2-default    8913120  Dec  19  2019
vmlinuz-5.3.18-152.106-defa 9064624  Nov  23  2021	# 15.2
vmlinuz-5.3.18-153.59-defa 10569984  Dec  13  2022	# 15.3
vmlinuz-5.4.12-1-default    9048304  Jan  19  2020
vmlinuz-5.5.13-1-default    9142512  Mar  29  2020
vmlinuz-5.6.14-1-default    9311888  Jun   8  2020
vmlinuz-5.7.11-1-default   10290768  Aug   3  2020
vmlinuz-5.8.15-1-default   10414896  Oct  20  2020
vmlinuz-5.9.14-1-default   10499088  Dec  13  2020
vmlinuz-5.10.16-1-default  10781936  Feb  22  2021
vmlinuz-5.11.16-1-default  10870672  Apr  26  2021
vmlinuz-5.12.13-1-default  11020368  Jun  28  2021
vmlinuz-5.13.12-1-default  10981680  Aug  19  2021
vmlinuz-5.14.14-3-default  11145360  Nov  15  2021
vmlinuz-5.15.12-1-default  11441840  Jan   7  2022
vmlinuz-5.16.15-1-default  11612464  Mar  19  2022
vmlinuz-5.17.9-1-default   11750064  May  21  2022
vmlinuz-5.18.12-1-default  12442544  Jul  31  2022
vmlinuz-5.19.13-1-default  11011024  Oct   5  2022
vmlinuz-6.0.12-1-default   12704880  Dec  10  2022
vmlinuz-6.1.12-1-default   12707152  Feb  16  2023

## sorted by size
initrd-2.6.13-15.18-defaul 1702569  Jan  21  2008	# 10.0 586
initrd-2.6.16.54-0.2.3-def 2406334  Jan  23  2008	# 10.1 586
initrd-2.6.18.8-0.13-defau 2850853  Sep   2  2009	# 10.2 586
initrd-2.6.22.19-0.4-defau 4183477  Sep   2  2009	# 10.3 586
initrd-3.1.10-1.29-desktop 4553149  Jul  18  2013	# 12.1
initrd-3.16.7-7-desktop    5357468  Dec  31  2014	# 13.2
initrd-2.6.27.7-10-pae     5477149  Jan   9  2009	# 11.0 586
initrd-4.1.39-56-default   5647008  Jun   2  2017	# 42.1
initrd-2.6.27.45-0.1-pae   5734283  Jul  16  2010	# 11.1 32bCPU
initrd-2.6.27.56-0.1-pae   5869614  Apr  16  2011	# 11.1 64bCPU
initrd-3.12.67-64-desktop  6221443  Jan  27  2017	# 13.1
initrd-3.7.10-1.45-desktop 6275177  Dec  21  2014	# 12.3
initrd-2.6.37.1-1.2-deskto 6576444  Mar  29  2014	# 11.4 64bCPU
initrd-3.0.101-79-desktop  6665694  Mar  30  2014	# 11.4 Evergreen
initrd-4.4.104-18-default  7153396  Jan  10  2018	# 42.2
initrd-2.6.31.14-0.8-deskt 7040751  May  10  2011	# 11.2 586
initrd-4.4.180-102-default 7595048  Jul  18  2019	# 42.3
initrd-3.4.63-2.44-desktop 7760033  Nov  18  2013	# 12.2
initrd-4.8.14-1-default    7930208  Dec  21  2016	# tw686
initrd-2.6.34.10-0.6-deskt 8398655  Aug  13  2013	# 11.3 586
initrd-4.12.14-lp150.12-de 8571580  Dec  02  2019	# 15.0
initrd-2.6.37.6-0.20-deskt 8735122  Oct  19  2012	# 11.4 32bCPU
initrd-4.12.14-lp151.28-de 8907352  Feb  18  2021	# 15.1
initrd-4.18.15-1-default   9033712  Jan   2  2019
initrd-4.17.14-1-default   9056972  Aug  22  2018
initrd-4.19.12-1-default   9123844  Jan  27  2019
initrd-5.3.18-152.106-defa 9213516  Feb   6  2022	# 15.2
initrd-4.4.0-1-default    10028700  Jan  25  2015	# tw686
initrd-4.3.3-1-default    10341436  Dec  30  2015	# tw686
initrd-4.20.13-1-default  10428544  Mar  22  2019
initrd-5.1.16-1-default   10617948  Jul  28  2019
initrd-5.0.13-1-default   10837696  Jul   2  2019
initrd-5.2.14-1-default   11064692  Oct  20  2019
initrd-5.4.12-1-default   11226188  Jan  23  2020
initrd-5.3.12-2-default   12056032  Oct  14  2020
initrd-5.7.11-1-default   12083116  Sep  24  2020
initrd-5.5.13-1-default   12096204  Jun  17  2020
initrd-5.6.14-1-default   12140896  Jun  17  2020
initrd-5.3.18-153.59-defa 12368272  Jan  17  2023	# 15.3
initrd-5.9.14-1-default   12398032  Jan  17  2021
initrd-5.8.15-1-default   12427040  Jan  17  2021
initrd-5.12.13-1-default  12530356  Aug   1  2021
initrd-5.10.16-1-default  13056856  Mar   3  2021
initrd-5.11.16-1-default  13098488  May  16  2021
initrd-5.13.12-1-default  13223084  Nov  10  2021
initrd-5.16.15-1-default  13768256  Mar  27  2022
initrd-5.19.13-1-default  14101812  Oct  19  2022
initrd-5.17.9-1-default   14713976  Jun  21  2022
initrd-5.14.14-3-default  14798684  Dec  27  2021
initrd-6.0.12-1-default   14898852  Dec  31  2022
initrd-6.1.12-1-default   15297252  Feb  18  2023
initrd-4.5.0-3-default    38129584  Apr  13  2016	# tw686

vmlinuz-2.6.16.54-0.2.3-def 1259645  Nov  24  2007	# 10.1 586
vmlinuz-2.6.18.8-0.13-defau 1475740  Nov   6  2008	# 10.2 586
vmlinuz-2.6.13-15.18-defaul 1545043  Oct   3  2007	# 10.0 586
vmlinuz-2.6.22.19-0.4-defau 1596248  Aug  14  2009	# 10.3 586
vmlinuz-2.6.27.56-0.1-pae   2502896  Dec   2  2010	# 11.1 64bCPU
vmlinuz-2.6.27.45-0.1-pae   2503568  Feb  23  2010	# 11.1 32bCPU
vmlinuz-2.6.27.7-10-pae     2531696  Dec  18  2008	# 11.0 586
vmlinuz-2.6.31.14-0.8-deskt 4101152  Apr  12  2011	# 11.2 586
vmlinuz-2.6.34.10-0.6-deskt 4301248  Jan   3  2012	# 11.3 586
vmlinuz-2.6.37.6-0.20-deskt 4510304  Jun  15  2012	# 11.4 32bCPU
vmlinuz-2.6.37.1-1-desktop  4553312  Feb  22  2011	# 11.4 64bCPU
vmlinuz-3.0.101-79-desktop  4875760  Feb   6  2014	# 11.4 Evergreen
vmlinuz-3.4.63-2.44-desktop 4929872  Oct   3  2013	# 12.2
vmlinuz-3.1.10-1.29-desktop 4989808  Jun   7  2013	# 12.1
vmlinuz-3.7.10-1.45-desktop 5001816  Dec  18  2014	# 12.3
vmlinuz-3.12.67-64-desktop  5451096  Dec  12  2016	# 13.1
vmlinuz-3.16.7-7-desktop    5682504  Dec  17  2014	# 13.2
vmlinuz-4.3.3-1-default     5805744  Dec  18  2015	# tw686
vmlinuz-4.4.0-1-default     5882960  Jan  18  2016	# tw686
vmlinuz-4.1.39-56-default   5897160  May   2  2017	# 42.1
vmlinuz-4.5.0-3-default     5986720  Apr  7   2016	# tw686
vmlinuz-4.4.104-18-default  6037176  Jan   4  2018	# 42.2
vmlinuz-4.8.14-1-default    6195392  Dec  19  2016	# tw686
vmlinuz-4.4.180-102-default 6233784  Jun  17  2019	# 42.3
vmlinuz-4.12.14-lp150.12-de 7114864  Nov  12  2019	# 15.0
vmlinuz-4.12.14-lp151.28-de 7340112  Jan  13  2021	# 15.1
vmlinuz-4.17.14-1-default   7860016  Aug  13  2018
vmlinuz-4.18.15-1-default   7958320  Oct  24  2018
vmlinuz-4.19.12-1-default   8163040  Dec  28  2018
vmlinuz-4.20.13-1-default   8175328  Mar   4  2019
vmlinuz-5.0.13-1-default    8187616  May  10  2019
vmlinuz-5.1.16-1-default    8364256  Jul  16  2019
vmlinuz-5.2.14-1-default    8708320  Sep  21  2019
vmlinuz-5.3.12-2-default    8913120  Dec  19  2019
vmlinuz-5.4.12-1-default    9048304  Jan  19  2020
vmlinuz-5.3.18-152.106-defa 9064624  Nov  23  2021	# 15.2
vmlinuz-5.5.13-1-default    9142512  Mar  29  2020
vmlinuz-5.6.14-1-default    9311888  Jun   8  2020
vmlinuz-5.7.11-1-default   10290768  Aug   3  2020
vmlinuz-5.8.15-1-default   10414896  Oct  20  2020
vmlinuz-5.9.14-1-default   10499088  Dec  13  2020
vmlinuz-5.3.18-153.59-defa 10569984  Dec  13  2022	# 15.3
vmlinuz-5.10.16-1-default  10781936  Feb  22  2021
vmlinuz-5.11.16-1-default  10870672  Apr  26  2021
vmlinuz-5.13.12-1-default  10981680  Aug  19  2021
vmlinuz-5.19.13-1-default  11011024  Oct   5  2022
vmlinuz-5.12.13-1-default  11020368  Jun  28  2021
vmlinuz-5.14.14-3-default  11145360  Nov  15  2021
vmlinuz-5.15.12-1-default  11441840  Jan   7  2022
vmlinuz-5.16.15-1-default  11612464  Mar  19  2022
vmlinuz-5.17.9-1-default   11750064  May  21  2022
vmlinuz-5.18.12-1-default  12442544  Jul  31  2022
vmlinuz-6.0.12-1-default   12704880  Dec  10  2022
vmlinuz-6.1.12-1-default   12707152  Feb  16  2023
Those with empty last column are from x86_64 Tumbleweed. Non-empty last column indicates release version number for most, 32bit Tumbleweed for a few, other variations for another few. I'm not entirely sure whether I have found all the oldies that there are to find here at the house, but in storage when I can get there should be some from as far back as 8.0, which was my first installed *SUSE.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding timestamp before each STDOUT line divyashree Linux - Newbie 1 03-21-2014 08:33 AM
script to timestamp files with timestamp from directory eRJe Programming 4 11-13-2013 06:52 PM
how to create a list of files and folders (name and size only) rastiazul Linux - General 16 11-04-2008 03:14 PM
Help - My Samba share changes the timestamp when copying files to it.. Preserve Time. hheejj Linux - Software 2 06-28-2005 09:34 AM
php timestamp problems before 1970 wedgeworth Linux - Software 2 12-09-2003 12:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration