Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am trying to list the files in a directory by the their size and ending with e

ID: 3871258 • Letter: I

Question

I am trying to list the files in a directory by the their size and ending with extension *.??? (anything that ends with three letters). It works flawlessly except that one file in particular wont show in the list but rather unpacks and shows its contents

I am using the command ls -a -l -S -r /etc/*.??? | cut -f 5-20 -d ' '

How can I get the file /etc/munin/rpm in the list and follow the commands I have listed? Thanks.

22 Dec 9 2015 /etc/issue.net 22 Nov 18 2016 /etc/grub2.cfg -/boot/grub2/grub.cfg 56 Nov 18 2016 /etc/favicon.png ->/usr/share/icons/hicolor/16x16/apps/fedora-logo-icon.png 314 Jan 18 2016 /etc/fppkg.cfg 314 Jan 18 2016 /etc/fppkg . bak 375 Sep 28 2016 /etc/trusted-key.key 1757 Aug 12 2015 /etc/nsswitch.conf.bak 7852 Jan 18 2816 /etc/fpc.cfg 8230 Jan 18 2016 /etc/fpc.bak 67106 Nov 10 2016 /etc/php.ini /etc/munin.rpm: 6 Mar 7 2815 node.cd 6 Mar 7 2015 node.d root root root root 75 Aug 12 2015 root root 1455 Mar 7 2015 munin-node.conf root root 4896 Aug 12 2015 plugins root root 4096 Aug 12 2015 plugin-conf.d 8192 Sep 26 10:40

Explanation / Answer

Hi let me know if you need more information:-

=======================================

ss139t@ubuntu:~$ ls -a -l -S -r /etc/*.??? | cut -f 5-20 -d ' '
19 Feb 8 2017 /etc/issue.net
9149 Jul 29 10:27 /etc/locale.gen
ss139t@ubuntu:~$

==================================

To list this file /etc/munin/rpm

=================

you must not have *.???
if this the case it is expecting *.rpm or rmp.*

=============

To avoid list of the directory:-

ls -a -l -S -r /etc/*.??? | cut -f 5-20 -d ' ' //Before

ls -a -l -S -r -d /etc/*.??? | cut -f 5-20 -d ' ' /After

=============

ss139t@ubuntu:/etc$ ls -a -l -S -r -d /etc/*.??? | cut -f 5-20 -d ' '
19 Feb 8 2017 /etc/issue.net
4096 Sep 28 07:54 /etc/munin.rpm
9149 Jul 29 10:27 /etc/locale.gen
ss139t@ubuntu:/etc$

========================

==========================

Thanks

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote