"ls -all" not working properly

I have recently become aware of Windows and the “index.dat” problem. Microsuck | Microsoft’s Really Hidden Files I set out to delete them without third party programs. This is near-impossible to do through windows so I turned to wonderful openSuse. I found them all via dolphin and a search, but when I went to go find them manually and to see what else I could find through the terminal I get this:

http://thumbnails36.imagebam.com/11388/fd4a46113879951.jpg](http://www.imagebam.com/image/fd4a46113879951)

ls thinks that there are 28 files (Hence the total:28 afaik) but only two are shown. Any ideas on why this is?

Oh, running Windows 7 and 11.2 in a dual-boot, mounted the NTFS partition through Dolphin.

Perhaps because they are hidden files? Strange things can happen when you list a foreign filesystem. -a is actually to reveal dotfiles in Linux.

Incidentally it’s not “all” as you seem to imagine. It’s actually two options -a and -l together. So the second l is redundant.

I was not aware of the “-all” not working how I expected it to.

Used separately, -a gives no total and -l gives a total of 0. But together, the total becomes 28.

If they are NTFS hidden, is there a way to view them? or make NTFS act more Linux friendly?

I don’t use ntfs-3g, but according to the man page mount.ntfs-3g, maybe you need the show_sys_files option.

-a means just like the normal output but also show dotfiles, so no totals displayed since that’s what a plain ls does
-l means show details for displayed files in long format

-al means just the combination of the two options since they do not conflict.

Do you have any insights on why there are 28 files not being shown? just because the drive is NTFS?

I think the ls logic is: count the number of qualifying entries in the directory and show that as the total. Then decide to show the entry or not depending on whether the metadata can be accessed. So this logic goes a bit haywire in the presence of NTFS hidden files.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’m 99.9% sure that’s not showing the total number of files/directories in
that location but maybe shows blocks instead since, in my case, a
directory shows 8 (8 x 512K blocks = 4096). That calculation may also
work for NTFS.

Good luck.

On 01/05/2011 05:06 PM, ken yap wrote:
>
> I think the ls logic is: count the number of qualifying entries in the
> directory and show that as the total. Then decide to show the entry or
> not depending on whether the metadata can be accessed. So this logic
> goes a bit haywire in the presence of NTFS hidden files.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJNJSCAAAoJEF+XTK08PnB55UEP/3V+AQHV0oSAxGYWMgm9nvlb
YBZEkFBDbWscUP7OUMXNCm2bglaxI6G8BGTRdDiYG2Qyhe22giQjEUhZJ+WITj9q
hdYkfrDc0mFNPAaGQCnEJ6dAdDHONsiXAs/sYDq5FTnO6J67GO7QxkOluM4Ehfsu
rEnOA3j2slPMNtxvrnuxxH9vbJIA/fJbA++5lloADvwsnHZ9XJjES+DUaZqKUZ0A
SRao5sS9C4Hah2rbK7gj3j6msbl49B83tMkco1u8CQQmmZAQeua9195z2jfe/QNp
AjOzczkxunxTGBody3XrLwx6XxRWxFGIrC4+w4McVUEtT+rCE5Khaonlabu/ggn/
9J80TkIt44Xfj/or/mABKz3BYbLB2YW9ULfuqieBnzmWwhnIGIpcjro2BFZFtMMZ
t5XlVi2xLBP3Jo7MYdxr4vb5BfYDcIO7nGPjvHEelO6UGUdqx3EObEqXdhQhziJv
bz5o7rT1UFmeXHMAbON5atkKmv3XJM08osNx/nRUYxsuX165OBz9M4PXXoqtBfjt
vznVsZBE34+B9VS0+ADnfXQ4/46rIrkcmm17S/eky8Gv7VlVImnIBPBddPHDd5bw
gzplPiCtlpOy4HpJDR0M4MzID8djUKWOtfC91ZWj6Hr679qPbikg/MI5qz7UzxTN
lD6h5Zlv9tFk5b7S23j0
=81Mf
-----END PGP SIGNATURE-----

Yes you’re right, that’s what info ls says. But it’s not very useful information these days, and is a hangover from Unix days.

$ ls -l | head -1
total 40
$ ls -al | head -1
total 1972

Coming back to the point, the man page says about -a, or alternatively --all (two hyphens) that it doesn’t ignore entries starting with a dot. Which is a different concept from hidden files in Windows; Unix “hides” files by a naming convention, not by an attribute of the file.

On 01/05/2011 02:06 PM, BenRhoads wrote:
> ls thinks that there are 28 files (Hence the total:28 afaik) but only
> two are shown. Any ideas on why this is?

I believe that’s the size in KB, not the number of files.


Kevin Miller - http://www.alaska.net/~atftb
Juneau, Alaska
In a recent survey, 7 out of 10 hard drives preferred Linux
Registered Linux User No: 307357, http://counter.li.org

I’m assuming that the “.” and “…” directories are sizeless, so that means there is still something taking up space.
But if linux and Windows hide things differently, then I won’t be able to see them anyway since Windows has messed with the storage of the file?
And what is weirder is that Dolphin can see these files through a “Find File” search.

the “.” directory is the current directory and the “…” directory is the parent directory which contains the current directory

My memory is really fuzzy here, but does not the “dir” command in openSUSE in fact just call “ls -l” … ?? Or was than in an older openSUSE version ?

I think I need to search ebay for new memory, as mine is getting worse and worse as the years go by. This is the SuSE foru… err… openSUSE forums? Right ? :smiley: :smiley:

You are quite correct:


andrew@linux-hm9p:~> alias | grep dir
alias dir='ls -l'

There seems to be a /usr/bin/dir as well. Running it compared to the alias of ls -l is quite different:


andrew@linux-hm9p:~> dir
total 44
drwxr-xr-x 2 andrew users 4096 2011-01-02 23:02 bin
drwxr-xr-x 2 andrew users 4096 2011-01-04 23:27 Desktop
drwxr-xr-x 2 andrew users 4096 2011-01-03 10:32 Documents
drwxr-xr-x 5 andrew users 4096 2011-01-07 02:06 Downloads
drwxr-xr-x 2 andrew users 4096 2011-01-04 17:45 logs
drwxr-xr-x 2 andrew users 4096 2011-01-03 10:32 Music
drwxr-xr-x 2 andrew users 4096 2011-01-03 10:32 Pictures
drwxr-xr-x 2 andrew users 4096 2011-01-03 10:32 Public
drwxr-xr-x 2 andrew users 4096 2011-01-02 23:02 public_html
drwxr-xr-x 2 andrew users 4096 2011-01-03 10:32 Templates
drwxr-xr-x 2 andrew users 4096 2011-01-03 10:32 Videos
andrew@linux-hm9p:~> /usr/bin/dir
bin  Desktop  Documents  Downloads  logs  Music  Pictures  Public  public_html  Templates  Videos

oldcpu wrote:
> My memory is really fuzzy here, but does not the “dir” command in
> openSUSE in fact just call “ls -l” … ?? Or was than in an older
> openSUSE version ?

this in a terminal might reveal the answer there:


alias | grep dir

here it returns


alias dir='ls -l'

and, did you find a source for new memory? if so please PM me and i’ll
send you a finders fee!! :wink:


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]
“Woe be to s/he who does not count me.” DenverD 5 Jan 11
http://goo.gl/9a072

Lol !! I’ve been looking for it, but I can’t recall the web site where its listed for sale (or was it for lease ? ) … ahh … sorry, what was I looking for again ?? :smiley: :smiley:

Not sure about windows 7 but my experience with NTFS and previous is that Linux doesn’t care if windows thinks it’s a hidden file. It’s just another file to Linux. I could be wrong…

Greyangel

oldcpu wrote:

>
> DenverD;2274462 Wrote:
>> and, did you find a source for new memory? if so please PM me and i’ll
>> send you a finders fee!! :wink:
>
> Lol !! I’ve been looking for it, but I can’t recall the web site where
> its listed for sale (or was it for lease ? ) … ahh … sorry, what was
> I looking for again ?? :smiley: :smiley:

Wish you guys wouldn’t rub this in. For the last 5-10 years I’ve spent far
more time looking for the @#$%^ tool I just laid down than actually using
that tool.

I used to joke that the best reason for carrying a drivers license was to
let me look up my name - now it’s no longer a joke…


Will Honea

the “.” directory is the current directory and the “…” directory is the parent directory which contains the current directory

Right, are they links or physical files?

Not sure about windows 7 but my experience with NTFS and previous is that Linux doesn’t care if windows thinks it’s a hidden file. It’s just another file to Linux. I could be wrong…

Ah, but these index.dat aren’t just hidden files :wink: They’re “super hidden” files.