0

I plan on creating a script which would help me with detecting long-time unused manually installed packages. For this, it would be neat though if I had a way of finding out the executed time for each executable under, e.g. /usr/bin/, /usr/local/bin/, ~/bin/

atime (ls -ltu /usr/bin/) would not be an option for various reasons (access time does not mean it got executed, also noatime).

phk
  • 5,893
  • 7
  • 41
  • 70
  • Which filesystem? The usual MACE timestamp does not encompass an "execution time" – Panki Jan 23 '23 at 10:33
  • @Panki Let's say file systems commonly used on Linux file systems to store the globally installed userspace executables, e.g. Ext4, BtrFS, … – phk Jan 23 '23 at 10:41
  • @Panki And yes that's my point, `atime` cannot be used so I need another method, perhaps a `binfmt` wrapper or some hook? – phk Jan 23 '23 at 10:43
  • `auditd` could help. Still, this entire idea looks like a fool's errand to me. Nowadays storage is so cheap there's little to no sense in cleaning up packages unless you're talking about an embedded system in which case you should be using busybox anyways. – Artem S. Tashkinov Jan 23 '23 at 11:26
  • @ArtemS.Tashkinov It's not just about storage. It's, e.g. also about only updating the packages I am still using and not being presented with files from those packages when I am searching for something (I plan on removing their configuration files as well). – phk Jan 23 '23 at 14:21
  • You could start with a minimal installation (Fedora offers this option, no idea how and if it applies to other distros. Debian must have it as well) - this way you'll only have to update the packages which are indeed used. – Artem S. Tashkinov Jan 23 '23 at 14:25
  • @ArtemS.Tashkinov Yes, starting anew would be an option, though a quite laborious one. – phk Jan 23 '23 at 14:34

0 Answers0