LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2017, 02:53 AM   #1
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
cannot remove file "??"


I have this weird file which ls interprets as "??"
ll
total 332
-rw-r--r-- 1 root root 153536 Dec 18 12:40 ??
-rw-------. 1 root root 954 Dec 16 12:13 anaconda-ks.cfg

I can't seem to get rid of it.
I tried rm -rf \?\? which obviously didn't work.

Any ideas what's going on and how it might have occurred?

Thanks
 
Old 01-05-2017, 02:59 AM   #2
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
I deleted it running:
Quote:
rm -rf ??
 
Old 01-05-2017, 04:38 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,000
Blog Entries: 3

Rep: Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631Reputation: 3631
That will quietly zap any and all two-letter files you have in the current directory and any directories underneath the current directory. You might just try rm -i ?? which will not only limit the damage to the current directory but also ask before deleting anything.

You can also wrap the name in single or double quotes rm -i "??" to focus on just that one file name and leave the other two-letter files alone.

See man 7 glob for what the ? does when unquoted in the shell.

Last edited by Turbocapitalist; 01-05-2017 at 04:40 AM.
 
1 members found this post helpful.
Old 01-05-2017, 05:47 AM   #4
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
Right, indeed. Thanks. I'm thinking that the file wasn't actually named "??" and that's why it was hard to delete it. Escaping the characters should have worked and the fact that it didn't tells me that "??" wasn't the actual name of the file
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
unpredictable "delete" "move to trash" or "cut" file menu option dorianrenato Linux - General 3 11-28-2011 06:41 PM
remove "Suspend" and "Hibernate" from the "Shut Down" applet cccc Debian 2 05-02-2011 10:05 AM
[SOLVED] Remove "Wine core exe" in "Open with" menu (Ubuntu) tranduyhung Linux - Software 3 01-13-2011 07:21 PM
Qt "cannot call constructor for""a function-style cast remove the redundant ::QBrush" Peterius Linux - Software 4 11-24-2010 04:57 PM
[SOLVED] Script to remove lines in a file with more than "x" instances of any character ? pissed_budgie Programming 12 10-08-2010 08:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:25 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