Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: "ls -all" not working properly

  1. #1

    Default "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:



    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.

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: "ls -all" not working properly

    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.

  3. #3

    Default Re: "ls -all" not working properly

    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?
    Vaio F11: i7-720QM 8GB RAM Nvidia GT 330m
    Win 7 Pro 64 bit | openSuse 11.4 64 bit | Arch Linux 64 bit

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: "ls -all" not working properly

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

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: "ls -all" not working properly

    Quote Originally Posted by BenRhoads View Post
    Used separately, -a gives no total and -l gives a total of 0. But together, the total becomes 28.
    -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.

  6. #6

    Default Re: "ls -all" not working properly

    Do you have any insights on why there are 28 files not being shown? just because the drive is NTFS?
    Vaio F11: i7-720QM 8GB RAM Nvidia GT 330m
    Win 7 Pro 64 bit | openSuse 11.4 64 bit | Arch Linux 64 bit

  7. #7
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: "ls -all" not working properly

    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.

  8. #8

    Default Re: "ls -all" not working properly

    -----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-----

  9. #9
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: "ls -all" not working properly

    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.

    Code:
    $ 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.

  10. #10

    Default Re: "ls -all" not working properly

    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

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •