a phantom file in my home dir
I was trying to write a script and something got messed up(I eventually got the script working, in case you were wondering). Now I have a phantom file called sftp. It shows up in ls, the output of 'll' is here'
Code:
<useless stuff removed> |
Assuming you haven't made a typo, you've made a typo.
The file is called 'stfp' not 'sftp'. I imagine you mistyped it in the script, but since you're familiar with it you know it should be 'sftp' and this is why you have the problem :) |
The filename may contain nonprinting characters. This could explain why you see it with 'll' but not with 'll stfp'. One way of getting it removed is this:
rm -i * The '-i' is *very* important as it makes rm interactive and prompts you before removing any file. As a precaution you can move all the 'good' files away to a safe place before attempting the delete. Have fun Bent |
ls -b
will show if you have non-printing chars in the filename |
rm -f sftp
or rm -f stfp |
Does tab completion work on the file name?
|
Another one to try is: rm *stfp*
but make sure no other filenames contain that string. |
wow...I feel stupid. I know I haven't made a typo giving you the output, I copied and pasted. Thanks you guys!
|
Re: a phantom file in my home dir
Quote:
|
wow, I really do feel stupid:rolleyes:. It was as simple as
Code:
rm stfp |
Quote:
|
Lot's of interesting ideas, obvious time to re-read the ls FM.
Midnight Commander (mc) is a great way to deal w/ non-printing & suspected non-printing characters. It's close to the 2nd thing I do & the 1st thing I install on a new box: Code:
apt-get install mc |
it's amazing how much you don't know about even basic commands until you RTFM.
The Great thing about unix/linux is that it's inexhaustable. |
Landmark: my post # 600
Maybe we ought to change, at least occasionally, "RTFM" TO "RRTFM" -- as in re-read ... Two of my "favorites" that I keep going back to are: ls & less. They both are amazingly rich. I also go out of my way to post code snippets that use what I see as the coolest features of each. I hope to pique people's interest in "what's that weird option" & provoke an RTFM. |
With the risk of going OT, the problem with complete newbies isn't (hopefully) lack of wanting to read, it's not knowing where to start and what to read as well as not understanding what the man pages say.
http://www.linuxlinks.com/Beginners/ is a good place to start imho. |
how about?
pwd -P and cd -P korn and bash try them on soft linked directories. |
Quote:
|
All times are GMT -5. The time now is 02:02 AM. |