File ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers File ?
# 1  
Old 12-29-2004
File ?

Very new user with a dumb question. While performing ls command I found some files in my directory that look like this:

#filename#

What does this mean. I cannot open with vi, cat, head, nor can I delete it with rm. Can someone educate me please, and how to fix?

THX

Dereck
# 2  
Old 12-29-2004
I've never seen anything like that. My first guess is if you need to move/delete/edit them use the escape character '\', perhaps mv ./\#filename\# ./filename
That's just my first thought without testing.

-Seg
# 3  
Old 12-29-2004
Thanks, but that did not work. If it helps I know how it was created. I started making a new text file using the "vi" command and the terminal window was closed before saving the file and quiting. Now it just sits in limbo, and I do not know how to delete or rename it so I can work with it.
# 4  
Old 12-29-2004
Assuming the bad files are not in a critical directory such as /etc /root ...

Try moving everything you can out of the directory to a safe spot, then go back to the directory with the bad files and try rm -rf ./*
If that does not work, mv the directory to a new location, here's an example

the bad file is in /baddir/

mkdir /dir2
mv baddir /dir2
cd dir2

then:
rm -rf ./*


There is an appropriate way to delete the file itself, but I do not remember what it is outside my original post.

-Seg

edit: if it was left there by vi it's probably locked. I have not used vi in a long long time, if i recall correctly when the same thing happened to me i had to reenter vi and get vi to open the file, close it then it was gone. it's that kind of crap that sent me to pico in the first place.
# 5  
Old 12-29-2004
I finnaly made things work. What I did was create a new directory called Dereck1. Changed directories "cd" to Dereck1, then:

cp ~/Dereck/* .

Went back to directory Dereck, rm -rf ./*
Then up one directory and rmdir Dereck

Never could make this work.
mkdir /Dereck1
mv Dereck /Dereck1

Kept getting message:
mv: cannot access Dereck1

Any clue what is wrong?

Looks like it should have worked from the command book, but it did not, beats me. Sure would have been easier.

Thanks for the help.
# 6  
Old 12-29-2004
No idea why it didnt work, but it's probably something simple. In any case I'm glad you got it fixed.

-Seg
# 7  
Old 12-29-2004
i did some thing like this ...
Enclose the file with "

It worked for me ; It should work for you toooo ....


$ cat > "#filename#"
thi is filename
$ cat "#filename#"
thi is filename
$ rm "#filename#"
 
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies

2. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

3. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies
Login or Register to Ask a Question