The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Weird Ascii characters in file names yamsin789 Shell Programming and Scripting 2 10-07-2007 07:27 AM
How to delete a weird file name XZOR UNIX for Dummies Questions & Answers 3 10-05-2006 11:35 PM
HP-UX weird FTP ? IngmarMeins HP-UX 10 11-29-2005 05:22 PM
weird core nkshirsagar HP-UX 1 10-05-2005 11:33 PM
Weird script Duckman UNIX for Dummies Questions & Answers 2 03-14-2001 10:53 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-19-2006
Registered User
 

Join Date: Sep 2004
Location: Mumbai-India
Posts: 151
Arrow Weird File

$ls -lrt
-rw-r--r-- 1 rathodr users 1757 Jan 6 13:36 cleanup.archive.files.pl
-rwxr-xr-x 1 rathodr users 20503 Jan 6 13:52 alarm.control.pl
-rw-r--r-- 1 rathodr users 20503 Jan 9 04:52q

The last file seems to be a weird file. I am not sure how was it created. Maybe while quiting vi.

$rm q
q: No such file or directory
$ file *
alarm.control.pl: executable /u01/perl/bin/perl script
cleanup.archive.files.pl: executable /u01/perl/bin/perl script
q: executable /u01/perl/bin/perl script

This displays the type of file. But I am not able to do any operation on the file nor delete it. Has anybody faced such a situation?

Thanks,
Rahul.
Reply With Quote
Forum Sponsor
  #2  
Old 01-19-2006
Registered User
 

Join Date: Dec 2005
Location: London
Posts: 222
there can be some special characters in the file name which won't be visible sometimes...

try to remove using

rm -i *q*
Reply With Quote
  #3  
Old 01-20-2006
Registered User
 

Join Date: Sep 2004
Location: Mumbai-India
Posts: 151
It worked

Thanks.

But I am curious to know what kind of special character this file consists, and why it doesn't get deleted the normal way?

Rahul.
Reply With Quote
  #4  
Old 01-20-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
Had to try some stuff here; but got it. Try this:
Code:
touch \<backspace_key>q
You will get that file again.

To see what special characters a filename has, use
Code:
ls -l | cat -v
Reply With Quote
  #5  
Old 01-20-2006
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Quote:
Originally Posted by blowtorch
To see what special characters a filename has, use
Code:
ls -l | cat -v
ls -lb should do the same...

Cheers
ZB
Reply With Quote
  #6  
Old 01-20-2006
aigles's Avatar
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,212
To delete a file with special characters in its name, you can do :
Code:
$ ls -lib
total 0
137362 -rw-rw-r--   1 gssjgu   gsb4001        0 20 jan 15:21 filename whith backspace \010
137370 -rw-rw-r--   1 gssjgu   gsb4001        0 20 jan 15:19 filename with spaces
$ find . -inum 137362 -exec rm {} \;
$ ls -lib
total 0
137370 -rw-rw-r--   1 gssjgu   gsb4001        0 20 jan 15:19 filename with spaces
$
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0