Solved

"hidden" file in linux

Posted on 2006-06-16
3
222 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now