Weird File


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Weird File
# 1  
Old 01-19-2006
CPU & Memory 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.
# 2  
Old 01-19-2006
there can be some special characters in the file name which won't be visible sometimes...

try to remove using

rm -i *q*
# 3  
Old 01-20-2006
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.
# 4  
Old 01-20-2006
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

# 5  
Old 01-20-2006
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
# 6  
Old 01-20-2006
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
$

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Weird Error (: No such file or directory)

Hi Everyone, I am trying to make this script to use, to find out the DAHDI channel status. Every thing works fine, I even get proper results, however I have this weird error that comes along. Can someone please help me. Thanks a lot. #!/bin/bash # Color to set the test to when a channel is... (3 Replies)
Discussion started by: jeetz
3 Replies

2. Shell Programming and Scripting

Weird ? symbol coming through-sending text file

Hi All, When I am trying to send a text file through Unix,I get a weird symbol in the .txt file. The symbol is ? in a box (square)....which is making the file unloadable. Please help me with the solution. Thanks in advance Gopi (1 Reply)
Discussion started by: gopi.palleti
1 Replies

3. UNIX for Dummies Questions & Answers

Weird Error moving a file

Hi, We are running into very weird error on AIX. Target directory exists on NFS. We have one script runs every 5 mins on our system. This script is running for 5 years for now without any issuess. Followig is the snapshot of the script : stmt_cnt=$(ls -1 ${1}/${2}|wc -l) if ;... (7 Replies)
Discussion started by: himihir2000
7 Replies

4. Shell Programming and Scripting

share a shell script which can replace weird characters in directory or file name

I just finish the shell script . This shell can replace weird characters (such as #$%^@!'"...) in file or directory name by "_" I spent long time on replacing apostrophe in file/directory name added: 2012-03-14 the 124th line (/usr/bin/perl -i -e "s#\'#\\'#g" /tmp/rpdir_level$i.tmp) is... (5 Replies)
Discussion started by: begonia
5 Replies

5. Shell Programming and Scripting

Find files older than X with a weird file format

I have an issue with a korn shell script that I am writing. The script parses through a configuration file which lists a heap of path/directories for some files which need to be FTP'd. Now the script needs to check whether there are any files which have not been processed and are X minutes old. ... (2 Replies)
Discussion started by: MickAAA
2 Replies

6. UNIX for Advanced & Expert Users

Weird working of File Watcher job

I have JIL script like the one below insert_job:F_SAMPLE job_type:f machine:PC001 owner:asla@PC001 watch_file:/home/shah/one/sample.trg watch_interval:90 alarm_if_fail:1Here my question is, there is a directory one under that file needs to be watched sample.trg..! but directory one owned... (0 Replies)
Discussion started by: shahnazurs
0 Replies

7. AIX

weird file list problem

When I do a file list in my spooler directory, I get the following information #ls -l |pg -rw-rw-rw- 1 user1 ugroups 831690 Apr 03 12:52 K6A80403125051.prn :res 2330479869879093344 ext 2330477052380546512 align -rw-rw-rw- 1 user1 ugroups 5900 Apr 03 14:19 K6A80403141858.idx :res... (8 Replies)
Discussion started by: jmmora
8 Replies

8. UNIX for Dummies Questions & Answers

File with a weird name 'q'

All, I have the following listing of files $ ls -lrt -rw-rw-rw- 1 user1 group1 335691 Aug 4 17:45 script1.sh -rw-rw-rw- 1 user1 group1 648 Aug 4 17:45 try,csv -rw-rw-rw- 1 user1 group1 1381275 Aug 4 17:45 test.txt -rw-rw-rw- 1 user1 group1 ... (7 Replies)
Discussion started by: rahulrathod
7 Replies

9. Shell Programming and Scripting

Weird Ascii characters in file names

Hi. I have files in my OS that has weird file names with not-conventional ascii characters. I would like to run them but I can't refer them. I know the ascii # of the problematic characters. I can't change their name since it belongs to a 3rd party program... but I want to run it. is there... (2 Replies)
Discussion started by: yamsin789
2 Replies

10. UNIX for Dummies Questions & Answers

How to delete a weird file name

Hi, How do I delete a file name that starts with a hypen? e.g. -unix_file_2006_10_3 I always get an erroe when I use rm command. I am using Solaris. Thanks, Hi, One of the Unix books I read to remove this weird file suggest to use: "rm ./-unix_file_2006_10_3" which I did today and file... (3 Replies)
Discussion started by: XZOR
3 Replies
Login or Register to Ask a Question