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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wierd filenames

Status
Not open for further replies.

mrn

MIS
Apr 27, 2001
3,993
GB
We have the following

-rw-r--r-- 1 root system 0 06 May 2004 ntop.access.log
---xr-Sr-- 1 root system 6228 28 Apr 17:22 T
---xr-Sr-- 1 root system 4197 30 May 2004
---xr-Sr-- 1 root system 1092 07 Feb 09:44

3 files no filename, I've tried ls -albq to show unprintable chars to no avail. The filenames obviously have control chars in. How do I see the true filename?



Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Hi Mike,

My bet would be on it being spaces.

Try
ls -m
or Pipe your above output through od.
or Pipe your above output through tr (transposing spaces to something like fullstops).

All the Best.

____________________
Sometimes it pays to stay in bed on Monday, rather than spending the rest of the week debuging Mondays code.
 
ls | cat -ev

This will convert any tabs to ^I and throw a $ on to show the end of line.

If you're wanting to execute a command on them, you can get the inode numbers with 'ls -i' and use "find" with the -inum and -exec flags.

To just get rid of them, "rm -i" is your friend.



Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

 
I like to use ksh arrays for this.

For example:

#set -A files $(ls /tmp)
#print ${files[@]}

Your non-existing files should be the first three that you can display like:
#print ${files[0]}
#print ${files[1]}
#print ${files[2]}

then delete them:
#rm ${files[0]}
#rm ${files[1]}
#rm ${files[2]}


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top