1826215 Members
2908 Online
109691 Solutions
New Discussion

regarding hidden files

 
SOLVED
Go to solution
Ragni Singh
Super Advisor

regarding hidden files

hey guys,

when I type the ls command, why do I show my hidden files. I see my hidden files wheather I type ls or ls -asl. What am I doing wrong? Any help is greatly appreciated.
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: regarding hidden files

I suspect that you have an alias defined. Do an 'alias' to list your currently defined aliases.
If it ain't broke, I can fix that.
Helen French
Honored Contributor

Re: regarding hidden files

Hi Sanman,

It could be an 'alias' issue. Check your global and local profiles for any alias settings. Also 'alias' command will list you the current defined aliases.

HTH,
Shiju
Life is a promise, fulfill it!
harry d brown jr
Honored Contributor

Re: regarding hidden files

There is no such thing as a "hidden" file. Protected maybe, and unviewable through permissions.

live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor
Solution

Re: regarding hidden files

If you are talking about files like:

.blah+

then yes they are "hidden" from non owners using "ls", but if you are root, you will always see them, and if you use "ls -la" you will always see them, regardless of the user.

live free or die
harry
Live Free or Die
SHABU KHAN
Trusted Contributor

Re: regarding hidden files

Sanman,

Type:
alias ls

You must have an alias set to ls as ls -la...which will display all your . (dot files)

-Shabu
Frank Slootweg
Honored Contributor

Re: regarding hidden files

Do you mean filenames starting with a dot (".")? If so, are you doing this as root?

If so, then this is the normal behaviour. The ls(1) manual page is not very specific about this, but does somewhat mention it:

> -A The same as -a, except that the current directory "." and
> parent directory ".." are not listed. For a user with
> appropriate privileges, this flag defaults to ON, and is
> turned off by -A.
Darrell Allen
Honored Contributor

Re: regarding hidden files

Hi Sanman,

It appears your answer was just the difference in how ls works for superusers and non-superusers. Hidden files (beginning with ".") are displayed when root runs ls.

For later readers, if you are using the posix shell, enter "whence -v ls" to see what the shell intreprets "ls" to be. See man sh-posix for more info.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)