Solved

"hidden" file in linux

Posted on 2006-06-16
3
225 Views
Last Modified: 2013-12-16
Hi,

I can run a command and it will find a file called agora.cgi:

# find . -maxdepth 1 -name \*cgi\*
./agora.cgi
./commerce.cgi
./nph-agora.cgi
./picserve.cgi
./test_id.cgi

But when I try to do -exec ls -lh {} \; it's like the file is not there:
# find . -maxdepth 1 -name \*cgi\* -exec ls -lh {} \;
find: ./agora.cgi: No such file or directory
-rwxr-xr-x    1 studebak studebak      75k Jan 29  2003 ./commerce.cgi
-rwxr-xr-x    1 studebak studebak      77k Jan 29  2003 ./nph-agora.cgi
-rwxr-xr-x    1 studebak studebak      17k Jan 29  2003 ./picserve.cgi
-rwxr-xr-x    1 studebak studebak     2.6k Feb 17  2005 ./test_id.cgi

Also if I try to remove it, the comp says it's not there:
# rm agora.cgi
rm: cannot remove `agora.cgi': No such file or directory

But then let's say I try to touch the file... the comp says it's there again... it's weird:
# touch agora.cgi
touch: creating `agora.cgi': File exists

Can anyone tell me how to delete this file?
0
Comment
Question by:bryanlloydharris
3 Comments
 
LVL 43

Assisted Solution

by:ravenpl
ravenpl earned 50 total points
ID: 16925835
and what simple 'ls -la' says? or find  -maxdepth 1 -name '*cgi*' -printf "'%h'\n"
Maybe there are some spaces around the name?
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 50 total points
ID: 16926133
Possible issues:

1.     File corruption. Run appropriate file system check on the partition.
2.    Try: rm -f agora.cgi  This may work?
3.     As well as ls -al for the file. Please provide lsattr for it. This will show any 'extended' file attributes that man be causing problems.

HTH:)
0
 
LVL 3

Author Comment

by:bryanlloydharris
ID: 16928679
Hi,

It seems someone else may have run this program to fix it because the file is back again.  Thanks for all your help though!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question