LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-31-2005, 11:38 PM   #1
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
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>
-rw-r--r--   1 jake jake        96 2005-10-29 18:12 stfp
<more useless stuff removed>
however, when I try to run 'll sftp' it tells me the file does not exist. The same thing happens when I try to remove it. Does anyone have any suggestions? It's more of an annoyance, so I can live w/ it, but I would like it removed
 
Old 11-01-2005, 12:18 AM   #2
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
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
 
Old 11-01-2005, 04:02 AM   #3
bentb
LQ Newbie
 
Registered: Feb 2004
Location: Birkerød, Denmark
Distribution: Arch, Gentoo
Posts: 8

Rep: Reputation: 0
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
 
Old 11-01-2005, 04:12 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
ls -b

will show if you have non-printing chars in the filename
 
Old 11-01-2005, 06:19 AM   #5
chenglim
LQ Newbie
 
Registered: Jan 2005
Posts: 18

Rep: Reputation: 0
rm -f sftp

or

rm -f stfp
 
Old 11-01-2005, 06:34 AM   #6
leif81
LQ Newbie
 
Registered: Aug 2004
Location: kingston, canada
Distribution: Fedora
Posts: 20

Rep: Reputation: 0
Does tab completion work on the file name?
 
Old 11-01-2005, 07:01 AM   #7
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Another one to try is: rm *stfp*
but make sure no other filenames contain that string.
 
Old 11-01-2005, 08:46 AM   #8
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
wow...I feel stupid. I know I haven't made a typo giving you the output, I copied and pasted. Thanks you guys!
 
Old 11-01-2005, 09:11 PM   #9
alf55
LQ Newbie
 
Registered: Oct 2005
Posts: 7

Rep: Reputation: 0
Re: a phantom file in my home dir

Quote:
Originally posted by microsoft/linux
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>
-rw-r--r--   1 jake jake        96 2005-10-29 18:12 stfp
<more useless stuff removed>
however, when I try to run 'll sftp' it tells me the file does not exist. The same thing happens when I try to remove it. Does anyone have any suggestions? It's more of an annoyance, so I can live w/ it, but I would like it removed
you should try doing "ls -l --escape *stfp*" as the "--escape" option puts the non-printable characters to be escaped and visiable. such as leading space(s) or other control characters. You see that all most any character is allowed in a filename (even though several characters should be avoided due to having to quote them).
 
Old 11-01-2005, 11:02 PM   #10
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
wow, I really do feel stupid. It was as simple as
Code:
rm stfp
Thanks for all the info on non-printing characters and stuff though
 
Old 11-01-2005, 11:38 PM   #11
RWallett
Member
 
Registered: Jan 2002
Location: Anchorage, AK
Distribution: Gentoo, Ubuntu and Slackware
Posts: 38

Rep: Reputation: 15
Quote:
Originally posted by microsoft/linux
wow, I really do feel stupid. It was as simple as
Code:
rm stfp
Thanks for all the info on non-printing characters and stuff though
Not to worry--you aren't the first person to do that, and somehow I doubt you'll be the last
 
Old 11-04-2005, 10:08 AM   #12
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
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
 
Old 11-04-2005, 10:12 AM   #13
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
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.
 
Old 11-04-2005, 10:27 AM   #14
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
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.


Last edited by archtoad6; 11-04-2005 at 10:29 AM.
 
Old 11-04-2005, 10:32 AM   #15
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C - Opening a Status file in user's home dir. pentalive Programming 10 06-09-2005 09:53 AM
Konqueror: Icons/file names don't show up for home dir jlangelier Linux - Software 3 12-10-2004 02:54 PM
opening file in home dir with C++ qcoder Programming 1 07-05-2004 12:19 PM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM
The Phantom Dir. krome Red Hat 3 11-09-2003 05:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration