Debian This forum is for the discussion of Debian Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
10-31-2005, 11:38 PM
|
#1
|
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Rep:
|
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
|
|
|
|
11-01-2005, 12:18 AM
|
#2
|
|
Member
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900
Rep:
|
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 
|
|
|
|
11-01-2005, 04:02 AM
|
#3
|
|
LQ Newbie
Registered: Feb 2004
Location: Birkerød, Denmark
Distribution: Arch, Gentoo
Posts: 5
Rep:
|
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
|
|
|
|
11-01-2005, 04:12 AM
|
#4
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
ls -b
will show if you have non-printing chars in the filename
|
|
|
|
11-01-2005, 06:19 AM
|
#5
|
|
LQ Newbie
Registered: Jan 2005
Posts: 18
Rep:
|
rm -f sftp
or
rm -f stfp
|
|
|
|
11-01-2005, 06:34 AM
|
#6
|
|
LQ Newbie
Registered: Aug 2004
Location: kingston, canada
Distribution: Fedora
Posts: 20
Rep:
|
Does tab completion work on the file name?
|
|
|
|
11-01-2005, 07:01 AM
|
#7
|
|
Senior Member
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107
Rep:
|
Another one to try is: rm *stfp*
but make sure no other filenames contain that string.
|
|
|
|
11-01-2005, 08:46 AM
|
#8
|
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
wow...I feel stupid. I know I haven't made a typo giving you the output, I copied and pasted. Thanks you guys!
|
|
|
|
11-01-2005, 09:11 PM
|
#9
|
|
LQ Newbie
Registered: Oct 2005
Posts: 7
Rep:
|
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).
|
|
|
|
11-01-2005, 11:02 PM
|
#10
|
|
Senior Member
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Original Poster
Rep:
|
wow, I really do feel stupid  . It was as simple as
Thanks for all the info on non-printing characters and stuff though
|
|
|
|
11-01-2005, 11:38 PM
|
#11
|
|
Member
Registered: Jan 2002
Location: Anchorage, AK
Distribution: Gentoo, Ubuntu and Slackware
Posts: 38
Rep:
|
Quote:
Originally posted by microsoft/linux
wow, I really do feel stupid . It was as simple as
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 
|
|
|
|
11-04-2005, 10:08 AM
|
#12
|
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
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:
|
|
|
|
11-04-2005, 10:12 AM
|
#13
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
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.
|
|
|
|
11-04-2005, 10:27 AM
|
#14
|
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
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.
|
|
|
|
11-04-2005, 10:32 AM
|
#15
|
|
Senior Member
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:04 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|