当前位置: 首页>>技术教程>>正文


如何列出未使用的应用程序?

问题描述

嘿,有可能列出所有未使用状态为10-20天的应用程序。如果是这样,我该怎么做。

谢谢。

最佳办法

我能想到的最接近的是运行popularity-contest > out.txt,这将花费一些时间来生成一个文件out.txt,该文件列出了从最近使用到最近使用的程序。我的印象是…

  • 第一列是该程序的最近使用时间(纪元格式),第二列是该程序的首次使用时间(或已安装?)。

  • 我认为,列出的唯一程序是已注册的程序(通过apt-get或软件中心安装的结果)。那些不是n’t, don’t的对象将在列表中列出。例如,我通过解压缩tar.gz安装了Seamonkey。没有显示。

popularity-contest的输出如下所示:

POPULARITY-CONTEST-0 TIME:1359204011 ID:ae1dc87f150c489082f0ddb28af40350 ARCH:i386 POPCONVER:1.53ubuntu1
1359204011 1349657211 openbox /usr/bin/openbox
1359204011 1349657211 xscreensaver /usr/bin/xscreensaver
1359204011 1354294761 perl-base /usr/bin/perl
1359204011 1349833421 update-notifier /usr/bin/update-notifier
1359204011 1349657224 xfconf /usr/lib/i386-linux-gnu/xfce4/xfconf/xfconfd
1359204011 1349657224 lxpanel /usr/lib/i386-linux-gnu/lxpanel/plugins/monitors.so
1359204011 1349657225 policykit-1-gnome /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
1359204011 1358559008 lxterminal /usr/bin/lxterminal
1359204011 1349664550 ttf-ubuntu-font-family /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-RI.ttf
1359204011 1349664535 pcmanfm /usr/bin/pcmanfm
1359204011 1349657224 lxpanel-indicator-applet-plugin /usr/lib/i386-linux-gnu/lxpanel/plugins/indicator.so
1359204011 1349657235 ttf-dejavu-core /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf
1359204011 1349657210 lxsession /usr/bin/lxsession
1359204011 1349833422 update-notifier-common /usr/share/locale/en/LC_MESSAGES/update-notifier.mo
1359204011 1349664531 network-manager-gnome /usr/bin/nm-applet
1359204011 1349657205 zlib1g /lib/i386-linux-gnu/libz.so.1.2.7
1359204011 1352212906 xfce4-power-manager /usr/bin/xfce4-power-manager
1359204008 1349657221 libxfconf-0-2 /usr/lib/i386-linux-gnu/libxfconf-0.so.2.0.0
1359204008 1358215752 libnss3 /usr/lib/i386-linux-gnu/nss/libfreebl3.so
1359204008 1349657221 libvorbis0a /usr/lib/i386-linux-gnu/libvorbis.so.0.4.5
1359204008 1349657221 libvorbisenc2 /usr/lib/i386-linux-gnu/libvorbisenc.so.2.0.8
1359204008 1349657217 libxcursor1 /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2
1359204008 1349657217 libx11-6 /usr/lib/i386-linux-gnu/libX11.so.6.3.0
1359204008 1349657221 libtasn1-3 /usr/lib/i386-linux-gnu/libtasn1.so.3.1.16
1359204008 1349657221 libwind0-heimdal /usr/lib/i386-linux-gnu/libwind.so.0.0.0

通过将整个输出粘贴到电子表格中,可以转换前两列。我将LibreOffice Calc用于此目的,并在”epoch time”的每一列之后插入空白列。然后,我填写a formula to convert “epoch time” to human-readable time(并使用“格式”,“单元格”,“时间”来获取合适的格式)。

对于第一行数据,假设第一个”epoch time”单元格位于A2中,则将=(A2/86400)+25569放入B2中并填充。使用单元格D2中的=(C2/86400)+25569对第二个”epoch time”执行相同的操作。

内容只有几行,如下所示:

POPULARITY-CONTEST-0        TIME:1359204011     ID:ae1dc87f150c489082f0ddb28af40350 ARCH:i386
1359204011  26/01/2013 12:40:11 1349657211  08/10/2012 00:46:51 openbox /usr/bin/openbox
1359204011  26/01/2013 12:40:11 1349657211  08/10/2012 00:46:51 xscreensaver    /usr/bin/xscreensaver
1359204011  26/01/2013 12:40:11 1354294761  30/11/2012 16:59:21 perl-base   /usr/bin/perl
1359204011  26/01/2013 12:40:11 1349833421  10/10/2012 01:43:41 update-notifier /usr/bin/update-notifier
1359204011  26/01/2013 12:40:11 1349657224  08/10/2012 00:47:04 xfconf  /usr/lib/i386-linux-gnu/xfce4/xfconf/xfconfd
1359204011  26/01/2013 12:40:11 1349657224  08/10/2012 00:47:04 lxpanel /usr/lib/i386-linux-gnu/lxpanel/plugins/monitors.so
1359204011  26/01/2013 12:40:11 1349657225  08/10/2012 00:47:05 policykit-1-gnome   /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
1359204011  26/01/2013 12:40:11 1358559008  19/01/2013 01:30:08 lxterminal  /usr/bin/lxterminal
1359204011  26/01/2013 12:40:11 1349664550  08/10/2012 02:49:10 ttf-ubuntu-font-family  /usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-RI.ttf
1359204011  26/01/2013 12:40:11 1349664535  08/10/2012 02:48:55 pcmanfm /usr/bin/pcmanfm
1359204011  26/01/2013 12:40:11 1349657224  08/10/2012 00:47:04 lxpanel-indicator-applet-plugin /usr/lib/i386-linux-gnu/lxpanel/plugins/indicator.so
1359204011  26/01/2013 12:40:11 1349657235  08/10/2012 00:47:15 ttf-dejavu-core /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf
1359204011  26/01/2013 12:40:11 1349657210  08/10/2012 00:46:50 lxsession   /usr/bin/lxsession
1359204011  26/01/2013 12:40:11 1349833422  10/10/2012 01:43:42 update-notifier-common  /usr/share/locale/en/LC_MESSAGES/update-notifier.mo
1359204011  26/01/2013 12:40:11 1349664531  08/10/2012 02:48:51 network-manager-gnome   /usr/bin/nm-applet
1359204011  26/01/2013 12:40:11 1349657205  08/10/2012 00:46:45 zlib1g  /lib/i386-linux-gnu/libz.so.1.2.7
1359204011  26/01/2013 12:40:11 1352212906  06/11/2012 14:41:46 xfce4-power-manager /usr/bin/xfce4-power-manager
1359204008  26/01/2013 12:40:08 1349657221  08/10/2012 00:47:01 libxfconf-0-2   /usr/lib/i386-linux-gnu/libxfconf-0.so.2.0.0
1359204008  26/01/2013 12:40:08 1358215752  15/01/2013 02:09:12 libnss3 /usr/lib/i386-linux-gnu/nss/libfreebl3.so
1359204008  26/01/2013 12:40:08 1349657221  08/10/2012 00:47:01 libvorbis0a /usr/lib/i386-linux-gnu/libvorbis.so.0.4.5
1359204008  26/01/2013 12:40:08 1349657221  08/10/2012 00:47:01 libvorbisenc2   /usr/lib/i386-linux-gnu/libvorbisenc.so.2.0.8
1359204008  26/01/2013 12:40:08 1349657217  08/10/2012 00:46:57 libxcursor1 /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2
1359204008  26/01/2013 12:40:08 1349657217  08/10/2012 00:46:57 libx11-6    /usr/lib/i386-linux-gnu/libX11.so.6.3.0
1359204008  26/01/2013 12:40:08 1349657221  08/10/2012 00:47:01 libtasn1-3  /usr/lib/i386-linux-gnu/libtasn1.so.3.1.16
1359204008  26/01/2013 12:40:08 1349657221  08/10/2012 00:47:01 libwind0-heimdal    /usr/lib/i386-linux-gnu/libwind.so.0.0.0

您可以在popcon.ubuntu.com上了解更多信息,但这里有一个报价:

Q) What information is reported by popularity-contest ?

A) popularity-contest reports the system architecture you use, the version of popularity-contest you use and the list of packages installed on your system. For each package, popularity-contest looks at the most recently used (based on atime) files, and reports the filename, its last access time (atime) and last change time (ctime). However, some files are not considered, because they have unreliable atime.

您也可以运行man popularity-contest以获取更多信息。

次佳办法

您可以使用访问时间来确定上次使用应用程序的时间。

例如,尝试:

ls -ltu /usr/bin | pager

这将列出按访问时间排序的/usr/bin下的所有文件(最先访问)。

如果要创建一个脚本来自动查找具有某些特征的程序,则可以通过以下方式使用stat

stat -c%X /bin/cat

这会将/bin/cat的访问时间输出为自大纪元以来的秒数

注意:很明显,如果您使用的是noatime安装选项,则此方法将无效。

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/10038.html,未经允许,请勿转载。