Missing files in listings

Hi,

I’m having an unusual issue - some files and directories that definitely exist, and are not .dot files, don’t show up in directory listings. This happens in the file mananger (Dolphin), on the command line (bash and zsh) and in file dialogues, even when hidden items are shown (e.g. ls -A). And in bash, they don’t show up in filename completion either. As far as I can tell there are no permissions issues (owned by me, owner has rw and x for directories), and no ACLs.

You can see in this first screenshot that the Downloads directory is not listed either in dolphin or by ls -A:

And in this one, that I can cd into it and Dolphin can show its contents:

It’s been happening for ages and I’ve just lived with it - and I can continue to do so - but I reckon I’ve probably just activated some weird configuration somewhere that I’ve forgotten about and someone might know something.

System details:

  • Manjaro 24.0.8
  • KDE Plasma 6.0.5
  • KDE Frameworks 6.5.0
  • Qt 6.7.2
  • Kernel 6.6.47-1-Manjaro
  • Bash 5.3.32

Thanks,
Darren

1 Like

You probably have borked your Dolphin settings. Just verify the options you have to show content. There are many options, hard to say which one needs to be adjusted.

1 Like
cd
ls -al

Will it show the Downloads directory?

next
ls -al Downloads

Will it show now?

but you can cd into it, you say

run
ls -al
from inside it

compare the permissions with that of other directories?
mkdir testdir
ls -al testdir
total 8
drwxrwxr-x   2 jo jo 4096 Sep 28 18:10 .
drwxr-x---+ 60 jo jo 4096 Sep 28 18:10 ..
cd testdir/
ls -al
total 8
drwxrwxr-x   2 jo jo 4096 Sep 28 18:10 .
drwxr-x---+ 60 jo jo 4096 Sep 28 18:10 ..

Don’t think it’s that as ls in bash also omits the same files and directories.

ls -A doesn’t list the files (see first screenshot) - the only difference between ls -a and ls -A is that they include/exclude the . and .. entries.

ls will show the files in Downloads regardless of whether I run ls -al Downloads from outside the Downloads directory, or just ls -al inside it. But however I run ls in my home directory, it never shows Downloads as an entry.

It’s truly puzzling.

Thanks for the replies!

Why do you provide only the graphical output of Dolphin Places (these are not reflecting folder structure) instead of the full output of ls -la including info in which folder you are? This would be much more helpful…

I provided a screenshot to demonstrate that the issue is the same in Dolphin, bash, etc… Seemed like the most useful way to demonstrate that the issue isn’t just in bash and isn’t just in Dolphin :person_shrugging:

Here’s the output:

darren@Yaddle:~ :) $ pwd
/home/darren
darren@Yaddle:~ :) $ ls -al
total 544
drwx------ 108 darren darren 36864 Sep 28 18:32  .
drwxr-xr-x   5 root   root    4096 Sep 30  2022  ..
-rw-r--r--   1 darren darren   164 May 10  2022  .actrc
drwxrwxr-x   7 darren darren  4096 Nov 19  2022  .android
-rw-rw-r--   1 darren darren   265 Oct 19  2017  .apport-ignore.xml
-rw-r--r--   1 darren darren   220 Feb 27  2017  .bash_logout
-rw-r--r--   1 darren darren  5642 Dec 27  2023  .bashrc
drwxr-xr-x   5 darren darren  4096 Dec 27  2023  .cargo
drwxrwxr-x  12 darren darren  4096 Feb 27  2017  .cddb
drwxr-xr-x   2 darren darren  4096 Aug  7  2022  Cloud
drwxr-xr-x 111 darren darren 61440 Sep 28 18:31  .config
drwxr-xr-x  27 darren darren 12288 Sep 27 21:52  Documents
drwxrwxr-x   3 darren darren  4096 Feb 27  2017  .dosbox
drwxr-xr-x   3 darren darren  4096 Jun 12  2018  .emscripten_cache
drwxr-xr-x   3 darren darren  4096 Jun 12  2018  .emscripten_ports
lrwxrwxrwx   1 darren darren    18 Mar 10  2017  .face.icon -> /home/darren/.face
drwxr-xr-x   4 darren darren  4096 Feb 19  2021  Games
-rw-rw-r--   1 darren darren   173 Aug 25  2021  .gitconfig
drwx------   5 darren darren  4096 Aug  4 16:20  .gnupg
drwxrwxr-x  10 darren darren  4096 Mar 21  2022  .gradle
-rw-r--r--   1 darren darren   437 Sep 27 17:33  .gtkrc-2.0
lrwxrwxrwx   1 darren darren    23 Sep  1  2019  .gtkrc-2.0-kde4 -> /home/darren/.gtkrc-2.0
-rw-------   1 darren darren    14 Sep 28 13:51  .histfile
drwxr-xr-x   3 darren darren  4096 Mar  2  2024  .hplip
drwxr-xr-x   3 darren darren  4096 Sep 15  2019 'Kalypso Media'
drwx------   2 darren darren  4096 Jun 11  2017  .lldb
drwxrwxr-x  21 darren darren 12288 Feb 20  2024  .minecraft
-rw-r--r--   1 darren darren   454 Jan  8  2019  .mingw-64-bshrc
drwxr-xr-x   3 darren darren  4096 Jun 20  2019  .mono
drwx------   6 darren darren  4096 Aug  1  2020  .mozilla
drwxrwxr-x   2 darren darren  4096 Feb 27  2017  .nano
drwxr-xr-x   3 darren darren  4096 Sep  7  2020  .nodejs
drwxr-xr-x   6 darren darren  4096 Apr 16 23:04  .paradoxlauncher
drwxrwxr-x   4 darren darren  4096 Sep  5  2018  Podcasts
-rw-r--r--   1 darren darren   840 Dec 27  2023  .profile
drwxr-xr-x   4 darren darren  4096 Apr 29  2018  Public
lrwxrwxrwx   1 darren darren    11 Feb 27  2017  Shared -> /mnt/shared
drwx------   3 darren darren  4096 Sep 20 17:05  snap
drwxr-xr-x  11 darren darren  4096 Feb  7  2018  .snes9x
drwxr-xr-x   5 darren darren  4096 Mar 18  2024  .ssr
drwxr-xr-x   2 darren darren  4096 Sep 28 13:38  .steam
lrwxrwxrwx   1 darren darren    29 Sep 28 11:00  .steampid -> /home/darren/.steam/steam.pid
drwxr-xr-x   2 darren darren  4096 Sep 12  2021  .swiftpm
drwxrwxr-x   3 darren darren  4096 Jan 16  2018  .swt
drwxr-xr-x   7 darren darren  4096 Sep  9 20:01  Sync
drwxr-xr-x   4 darren darren  4096 Mar 28  2018  Templates
drwxrwxr-x  13 darren darren  4096 Sep 28 11:44 'VirtualBox VMs'
-rw-------   1 darren darren    51 Jul 13  2023  .Xauthority
-rw-r--r--   1 darren darren    19 Aug 31  2020  .xinitrc
-rw-r--r--   1 darren darren 45652 Sep 28 13:46  .zcompdump
-rw-r--r--   1 darren darren    21 Dec 27  2023  .zshenv
-rw-r--r--   1 darren darren   662 Sep 29  2022  .zshrc
darren@Yaddle:~ :) $ stat Documents
  File: Documents
  Size: 12288           Blocks: 24         IO Block: 4096   directory
Device: 0,50    Inode: 58594048    Links: 27
Access: (0755/drwxr-xr-x)  Uid: ( 1000/  darren)   Gid: ( 1000/  darren)
Access: 2024-09-28 10:59:14.320807222 +0100
Modify: 2024-09-27 21:52:29.201710012 +0100
Change: 2024-09-27 21:52:29.201710012 +0100
 Birth: -
darren@Yaddle:~ :) $ stat Downloads
  File: Downloads
  Size: 32768           Blocks: 72         IO Block: 4096   directory
Device: 0,50    Inode: 46157100    Links: 15
Access: (0755/drwxr-xr-x)  Uid: ( 1000/  darren)   Gid: ( 1000/  darren)
Access: 2024-09-28 13:54:27.224115989 +0100
Modify: 2024-09-28 12:40:56.979524066 +0100
Change: 2024-09-28 12:40:56.979524066 +0100
 Birth: -
darren@Yaddle:~ :) $

As you can see, no difference in perms or ownership between Documents (which is listed by ls) and Downloads (which isn’t).

I’m not expecting anyone to go diving into this, just wondered if anyone had seen anything similar and might be able to point me in the right direction.

That is truly puzzling.
If I was you, I’d move the content of that directory elsewhere (or copy it, if space is not too tight)
and then would rename it and create a new directory of the same name and move the stuff back.
Just to be safe - who knows what other mysteries will happen and then the files are gone …

1 Like

I can’t think of any simple explanation for this, so for now I guess you can try to rule out things which could interfere with what you see compared to what we would expect to see.

  • Have ls or cd been aliased in any way? (Can check with alias ls and then alias cd)
  • Is the CDPATH environment variable set? (Can check with echo $CDPATH)?
  • Has the “special” Downloads directory been altered? See this article for files to check: XDG user directories - ArchWiki
1 Like

IMHO this still does not disclose the location of Downloads in the hirarchical file system tree… Have your searched for “Downloads” with baloo, already?

1 Like

I never saw this before, maybe you have some OS File corruption?

I would scann my drive with FSCK Filesystem scan, best way in Liveboot:

sudo fsck -f -y /dev/sdXX
(-f Forcescan -y always yes to all questions) (sdXX Replace XX with your unmounted drive that needs to be scanned)

After you finished your scan, you may also want to use Dolphin from a Liveboot and look from there if you can see all files/folders.

Edit:
I would also change visuals on Dolphin at the path location, it shows only >Downloads or >Home on your screenshots.

But with right click at this Path area, you can select “show full path”.

2 Likes

I think you’re onto something there. The Downloads directory may have inadvertently been moved elsewhere, while the Places section in dolphin still shows it in the same place because that is an XDG built-in thing, not a filesystem hierarchy listing.

Where one (or: he) would look then would be in:
~/.config/user-dirs.dirs
?

cat ~/.config/user-dirs.dirs

1 Like

Indeed; if the OP is in that Downloads directory in a Terminal window, what does pwd show then?

If it’s a symlink, I’d expect it to show, but there appears to be at least one here?

1 Like

In future, if you don’t actually require support, please post in a more relevant category; Feedback, for example; otherwise it wastes the time of those genuinely wishing to help. A comment like this (14 posts into a support thread) designed to minimise the intention, isn’t useful.

If ls does not discover your Downloads directory, then the directory may be damaged in a way that causes it not to be detected (unlikely on a native Linux file system), or the directory does not exist at that location.

Assuming the above hints reflect your situation, here’s how to remedy it:

Install xdg-user-dirs (if it isn’t already):

sudo pacman -S xdg-user-dirs

This will create a local ~/.config/user-dirs.dirs configuration:

xdg-user-dirs-update

The xdg-user-dirs-update.service is also enabled, which runs at login to keep directory locations up to date.

Check the content of the local configuration file:

cat ~/.config/user-dirs.dirs

Look for XDG_DOWNLOAD_DIR in the command output. The path next to it shows where your current Downloads directory resides:

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_VIDEOS_DIR="$HOME/Videos"

If the output reveals anything different from "$HOME/Downloads" then the directory has been relocated at some point (by you). In this case, ls will not find Downloads within your user directory, because it’s not there.

To change the directory that “Downloads” (in Dolphin) points to, the file can be edited manually, or the OP can use:

xdg-user-dirs-update --set DOWNLOAD ~/Downloads

to restore it to the default location.

The actual content may need to be moved manually.

If the issue is something else entirely, then :man_shrugging: .

I hope this is helpful.

Cheers.

1 Like