Search code examples
linuxterminalcentosgtknautilus

why does terminal keeps displaying 'number of files 1'?


Please see this image: enter image description here enter image description here The terminal always keeps displaying number of files 1. the frequency is about several minutes each. Restarting OS(to me it's centos) doesn't help because I've been seen it for months. Though it doesn't affect other processes, it harasses the terminal and I have to press CTRL+C to stop it tempararily, and I'm worried some background process is always in wrong state. Does it have anything to do with my command to dispaly gui folders needed at work?

nautilus -q &> /dev/null
nautilus dir1 dir2 .. dirn  &> /dev/null & 
#can prevent the 'number of files 1'.

I've googled the keyword 'number of files 1' but none of the results seem to be related to this question and so I'm wondering if others met the same issue before. Could you give some suggestions on how to debug and resolve this issue?

[root@localhost cp2vm]# whoami
root
[root@localhost cp2vm]# uname -a
Linux localhost.localdomain 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

output of strings /usr/bin/nautilus: http://www.filedropper.com/stringsnautilus

nautilus --version output: GNOME nautilus 3.22.3


Solution

  • Just run nautilus &> /dev/null to avoid nautilus polluting stdout and stderr. This way your terminal won't show those messages.

    Edit: To make it explicit, this should work in your script.

    nautilus -q &> /dev/null              # Exits all nautilus instances, ignore output
    nautilus dir1 dir2 dir3 &> /dev/null  # Runs nautilus, ignore output
    

    I doubt the output redirection is useful for nautilus -q, but from your information it's hard to understand when and how often you call that script. So it might be in surplus, but won't harm.