Why does this happen ( ls command ) SOLVED

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
viking777

Why does this happen ( ls command ) SOLVED

Post by viking777 »

From a terminal in my /home/user directory:

Code: Select all

ls -a /usr/src/linux-headers-3.5.0-23/
./      crypto/         fs/       Kbuild   Makefile  scripts/   ubuntu/
../     Documentation/  include/  Kconfig  mm/       security/  usr/
arch/   drivers/        init/     kernel/  net/      sound/     virt/
block/  firmware/       ipc/      lib/     samples/  tools/
27 files and folders listed (including ./ and ../)

But:

Code: Select all

cd /usr/src/linux-headers-3.5.0-23-generic
Then:

Code: Select all

/u/s/linux-headers-3.5.0-23-generic> ls -a
./              firmware@  Makefile@            source@
../             fs@        .missing-syscalls.d  .tmp_versions/
arch/           include/   mm@                  tools@
block@          init@      Module.symvers       ubuntu@
.config         ipc@       net@                 usr@
.config.old     Kbuild@    samples@             virt@
crypto@         Kconfig@   scripts/
Documentation@  kernel/    security@
drivers@        lib@       sound@


33 files and folders listed (which is the correct number confirmed by my file manager)

The extra 6 are the 4 dot files (which ls -a is supposed to show), 'source' which I can probably excuse because it is a broken symlink and Module.symvers which is a plain text file of 828kb. (It was actually one of the dot files that I was trying to find).
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Why does this happen ( ls command )

Post by xenopeek »

Different directories man :D First you do a ls of /usr/src/linux-headers-3.5.0-23/, then you go to /usr/src/linux-headers-3.5.0-23-generic.
Image
viking777

Re: Why does this happen ( ls command )

Post by viking777 »

Oh God, I give up - come round and shoot me will you. I looked at that problem for an hour or more, tried it all different ways, different shells, with and without sudo, even different distros - still I couldn't see it. Not only that, but at the time I posted it I hadn't had anything to drink for 24 hours (maybe that was the problem :lol: )

Thanks once again.
Locked

Return to “Scripts & Bash”