[Solved] Weird files to delete


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [Solved] Weird files to delete
# 1  
Old 08-29-2012
[Solved] Weird files to delete

Hi,

I created some files with a script and I don't know yet where I did a mistake but the script created some "weird" files...

Code:
prd01,/tmp # ls -al
total 706184
-rw-r-----    1 root     system           34 Aug 27 16:10
hdisk3BB
hdisk3
hdisk3BB.tmp
drwxrwxrwt   51 bin      bin           36864 Aug 29 11:42 .
drwxr-xr-x   39 root     system         4096 Aug 16 00:27 ..
drwxr-xr-x    2 root     system          256 Aug 29 10:10 .oslevel.datafiles
-rw-------    1 root     system            0 Dec 12 2011  .strload.mutex
-rw-r-----    1 root     system           37 Aug 27 16:02 .tmp

Do you have any idea how to delete those files?

Thank you!!!!

Last edited by Scott; 08-29-2012 at 08:02 AM.. Reason: Code tags, not quote tags, for code
# 2  
Old 08-29-2012
Try ls -lab or ls *hdisk3* | od -c.
--
Bye
# 3  
Old 08-29-2012
Code:
prd01,/tmp # ls -lab
total 706184
-rw-r-----    1 root     system           34 Aug 27 16:10 \012hdisk3BB\012hdisk3\012hdisk3BB.tmp


prd01,/tmp # ls *hdisk3* | od -c
0000000   \n   h   d   i   s   k   3   B   B  \n   h   d   i   s   k   3
0000020   \n   h   d   i   s   k   3   B   B   .   t   m   p  \n
0000036


Last edited by Scott; 08-29-2012 at 08:03 AM.. Reason: Code tags for code
# 4  
Old 08-29-2012
In bash I'd do:
Code:
rm $'\n'hdisk3BB$'\n'hdisk3$'\n'hdisk3BB.tmp

--
Bye
# 5  
Old 08-29-2012
thanks Lem!

Unfortunatly, that doesn't work....

Quote:
prd01,/tmp # rm $'\n'hdisk3BB$'\n'hdisk3$'\n'hdisk3BB.tmp
rm: $\nhdisk3BB$\nhdisk3$\nhdisk3BB.tmp: A file or directory in the path name does not exist.
Any other idea?
# 6  
Old 08-29-2012
Try with size, if that the only file of that size or similar.
Code:
find . -size 34c -exec ls {} \;

If this works, replace ls with rm.

Hope that helps
Regards
Peasant.
# 7  
Old 08-29-2012
What about rm -i *3BB*? The -i for safety reasons...
This User Gave Thanks to RudiC For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

[Solved] Weird 'ls -l' output

Hello folks, I've found an HP-UX server with a rare 'ls -l' output. Please see the attached file. Anybody knows how can I change the output to not have this extra tabulations? Thanks in advance! (10 Replies)
Discussion started by: carpannav
10 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Delete files older than 10 years

I need a command which delete files older than 10 years. I got a command for 90 days and all commands I find are for days and nothing for years. find file_name -mtime +90 -exec rm {} \; (5 Replies)
Discussion started by: eskay
5 Replies

3. Shell Programming and Scripting

[Solved] Get files & delete them by shell script

I want to use my script to get any file then delete it once it transfers to my side , I manage to create below script to generate "list" file which contains all file names in "10.10.1.1" then I made "a.out" file which contains the commands that I want to run it on "10.10.1.1" to get & delete the... (2 Replies)
Discussion started by: arm
2 Replies

4. UNIX for Dummies Questions & Answers

[Solved] weird in find -exec command

i feel weird with this 2 command find /tmp/*test* -user `whoami` -mtime +1 -type f -exec rm -f {}\; find /tmp/*test* -user `whoami` -mtime +1 -type f -exec ls -lrt {}\; the first one return correct which only delete those filename that consist *test* where second command it listed all the... (12 Replies)
Discussion started by: lsy
12 Replies

5. UNIX for Dummies Questions & Answers

[Solved] Delete files with condition

I have a directory containing thousands of items “video files”, these items were generated by an application, which generates two items with the same name but with different extensions “.avi and .mp4”. There was a tool in my application to remove one item @ a time. Later I found this tool removes... (5 Replies)
Discussion started by: awadeid
5 Replies

6. UNIX for Dummies Questions & Answers

[SOLVED] Delete files and folders under given directory

I have a requirement to delete the files and folders under a given directory. my directory structure is like this.. Data | A(Directory) |_PDF(Directory)----pdf files |_XML()Directory --xml files |--files | B(Directory) |_PDF(Directory)----pdf files |_XML()Directory --xml files ... (1 Reply)
Discussion started by: ramse8pc
1 Replies

7. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

8. UNIX for Advanced & Expert Users

Really weird delete problem

Hi, I've Ubuntu 8.04, and it has some files that I just cannot delete. I've tried everything, inode, fsck etc. Here is what the ls -li outputs root@ubuntu:/home/luser/.local/share/Trash/files/junk# ls -l ls: cannot access TRUNK_: No such file or directory ls: cannot access 2006_output.mv:... (11 Replies)
Discussion started by: nitin
11 Replies

9. Linux

Help! How to delete weird files ??

Guys, I have two files in a directory with weird permissions, size, owner, date etc... the problem is I can´t delete them! I tried to chmod the files and everything, but nothing seems to work. Anyone got any ideas ??? Look: # ls -l total 1327968579 ?--------- 48 1645863428 2150720025... (1 Reply)
Discussion started by: dfs
1 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