Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hidden files

Status
Not open for further replies.

mturnbo

Programmer
Apr 24, 2001
9
0
0
US
I am building a simple script to archive the web access log on my server. I decided to simply name the files with the date (ex. 20010424.log) However, whenever I give the file this name in this format, it doesn't show up in the file listing. But it's there. I'm curious as to why I can't see the file.
 
Strange, a file with this name shows up in ls output on my systems (linux x86 redhat 6.2, solaris sparc 2.5.1). Are you sure the file name isn't prefixed with a '.'?

e.g.

.20010424.log



Russ
bobbitts@hotmail.com
 
I'm sure the file name is not prefixed with a '.'
Even when I simply change the name of the access_log file or copy it with the new name, it still doesn't show up. Strange.

m
 
are you accessing it from a pc? there is an annoying bug in windows of only showing the first 255 files in a directory at times ... in old progs and old win apps ...

it's not a very full directory is it?
 
what are the permissions on that file and its directory?

what is the user you're running the script as, what groups is it in, and what flavour of unix are you on

could you also post the output of the 'id' command? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
There are only 3 files in the directory. And I'm logged in as admin with the same permissions as root on a Solaris 7 box.

# id
uid=0(root) gid=1(other)

# ls -l
total 230
-rw-r--r-- 1 root other 28569 Apr 25 09:01 access_log
-rwxr-xr-x 1 root other 391 Apr 24 18:42 archive.pl
-rw-r--r-- 1 root other 3949 Apr 25 09:01 error_log

m
 
I'm getting confused now .. r u saying that other files apart from these 3 exist in this directory ??

Just to clarify, exactly what commands are you running , which ones are failing ?

Have you tried ls -ai ?

Chris
 
Yes, there is a file in the directory name cr.20012404.log.
I created it by copying the access_log file. And I know it's there because when I type 'more cr.20012404.log' it returns the contents of the file. Yet it still doesn't show up when I try to get a file listing. However, when I copy the access_log to a file with the name test.txt, it does show up.

?????

m
 
what happens if you use

ls -a

(a for all)

or ls -al

Does that make a difference

If the file is hidden it can only be seen with the -a option. I beleive this holds try with most if not all unix variants

-Danny






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top