Welcome!
Forum users
  • Please read this before asking for help, and don't forget to add Quick System Info to help requests!
  • Please follow the Forum Rules

Current releases
--MX-21 release info here
--Migration information to MX-21 here
--antiX-21 (Grup Yorum) release info here

Important information
-- Spectre and Meltdown vulnerabilities

News
-- MX Linux on social media: here
-- New Forum Features, Marking Solved and Referencing a User: here

Number of a folder's contents in Thunar?

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
User avatar
JayM
Qualified MX Guide
Posts: 10500
Joined: Tue Jan 08, 2019 4:47 am

Number of a folder's contents in Thunar?

#1 Post by JayM »

Other file managers I've used show the number of items inside folders in detailed view but Thunar only shows the folder's size which is always 4.1kb. Can this be changed so it displays the number of items instead?
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
srq2625
Posts: 235
Joined: Mon Jan 21, 2019 10:40 am

Re: Number of a folder's contents in Thunar?

#2 Post by srq2625 »

This is something I've been wondering about. So, I did a bit of searching and found this thread.

Looking at reply #3 (quoted below for easy reference), there might be something there that could work. I'm at work right now and will have to wait until I get home tonight to give this a spin.
You can go into Thunar > Edit > Configure cutom actions... and create a new custom action with this command

Code: Select all

output=$(find %N | wc -l) && notify-send "File count" "$output files"
and name it File count.

Go into the advanced conditions tab and only check Directories. Close thunar and open it again.

If you now right click on any folder there is a new Item in the menu now named File count. Click on it and a notification should pop up with the number of all the files in that folder including all subfolders. This command only counts the files. not the folders.

If you want the number of folders do it like this:

Code: Select all

output=$(ls -1 | wc -l) && notify-send "Folder count" "$output folders"
And, if this works, I can see it not being too difficult to modify the above to return the number of items (files and sub-folders) in a folder.
AsusTek PRIME B450-Plus
AMD Ryzen 7 2700 (8-Core, 16 threads)
GeForce GTS 450/PCIe/SSE2 v: 4.6.0 NVIDIA 390.116
Realtek RTL8111/8168/8411 - driver: r8169
Samsung SSD 860 EVO 500GB
DDR4 3200MHz CL16 2x8GB

User avatar
sunrat
Posts: 911
Joined: Mon Mar 28, 2016 9:54 pm

Re: Number of a folder's contents in Thunar?

#3 Post by sunrat »

You could right click on "Properties" for the directory to get a file count. I don't think there is an easy way to display it inline.

User avatar
Jerry3904
Administrator
Posts: 31029
Joined: Wed Jul 19, 2006 6:13 am

Re: Number of a folder's contents in Thunar?

#4 Post by Jerry3904 »

srq2625 wrote: Mon Jan 28, 2019 9:21 am This is something I've been wondering about. So, I did a bit of searching and found this thread.

Looking at reply #3 (quoted below for easy reference), there might be something there that could work. I'm at work right now and will have to wait until I get home tonight to give this a spin.
You can go into Thunar > Edit > Configure cutom actions... and create a new custom action with this command

Code: Select all

output=$(find %N | wc -l) && notify-send "File count" "$output files"
<snip>
That does work! It would be nice to alter that so it shows up in a yad info box as everything else does here.
Production: 5.10, MX-21, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-21 Fluxbox and Windows 10.

User avatar
Eadwine Rose
Administrator
Posts: 14299
Joined: Wed Jul 12, 2006 2:10 am

Re: Number of a folder's contents in Thunar?

#5 Post by Eadwine Rose »

sunrat wrote: Mon Jan 28, 2019 9:37 am You could right click on "Properties" for the directory to get a file count. I don't think there is an easy way to display it inline.
Indeed.. I right clicked earlier to check between two external drives if the count was the same (one is replacing the other) and it was. Some 25000 odd files.
MX-21.1_x64 Oct 20 2021 * 5.10.0-13-amd64 ext4 Xfce 4.16.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 460.91.03 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 860EVO * Samsung S24D330 & P2250 * HP Envy 5030

User avatar
Jerry3904
Administrator
Posts: 31029
Joined: Wed Jul 19, 2006 6:13 am

Re: Number of a folder's contents in Thunar?

#6 Post by Jerry3904 »

Here's a start for a command using yad, but I will have to look up how to do formatting, alignment etc.

Code: Select all

output=$(find %N | wc -l) && yad --info --title="File count" --text="$output files" --width=50 --height=50
Production: 5.10, MX-21, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-21 Fluxbox and Windows 10.

User avatar
figueroa
Posts: 1269
Joined: Fri Dec 21, 2018 12:20 am

Re: Number of a folder's contents in Thunar?

#7 Post by figueroa »

Thunar shows the number of files in a directory and the remaining space in all views. What am I doing wrong? :-)
Added: Actually, I think I know what you mean. I just never considered it a deficiency.
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

User avatar
JayM
Qualified MX Guide
Posts: 10500
Joined: Tue Jan 08, 2019 4:47 am

Re: Number of a folder's contents in Thunar?

#8 Post by JayM »

sunrat wrote: Mon Jan 28, 2019 9:37 am You could right click on "Properties" for the directory to get a file count. I don't think there is an easy way to display it inline.
I know that, but it would be nice if the directories' file counts were displayed in the main Thunar screen like they are in Dolphin and Nemo, or if there was another column that showed that information.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
JayM
Qualified MX Guide
Posts: 10500
Joined: Tue Jan 08, 2019 4:47 am

Re: Number of a folder's contents in Thunar?

#9 Post by JayM »

figueroa wrote: Mon Jan 28, 2019 10:51 pm Thunar shows the number of files in a directory and the remaining space in all views. What am I doing wrong? :-)
Added: Actually, I think I know what you mean. I just never considered it a deficiency.
Mine just has columns for Name, Size, Type and Date Modified with no option to change those. Size for directories is always 4.1kB. I don't see file counts anywhere.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
JmaCWQ
Posts: 312
Joined: Fri Sep 09, 2016 4:42 am

Re: Number of a folder's contents in Thunar?

#10 Post by JmaCWQ »

With a folder open click View > Configure Columns, then you can change what columns are displayed.
A file count would be good, what I'd like to see also is the size showing the actual size of the folder's contents, 4.1 kb displayed for most folders is pretty much pointless I think.

Post Reply

Return to “MX Help”