Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Idiot unix question

Thread Tools
 
Search this Thread
 
Old 01 July 2002, 02:29 PM
  #1  
stevem2k
Scooby Regular
Thread Starter
 
stevem2k's Avatar
 
Join Date: Sep 2001
Location: Kingston ( Surrey, not Jamaica )
Posts: 4,670
Likes: 0
Received 0 Likes on 0 Posts
Post


This has been doing my head in .. I know how to do this, but have a mental block on or something...

Have a file in / with no name , but size 200000k . I have found that the filename is made up of control characters: ^?^?^?^?^?^? so can list it ( using shell tab function ) but can't delete it !

Help, let me do this and then I can get on with the 10^7 things that I should be doing

Steve
Old 01 July 2002, 02:35 PM
  #2  
stevem2k
Scooby Regular
Thread Starter
 
stevem2k's Avatar
 
Join Date: Sep 2001
Location: Kingston ( Surrey, not Jamaica )
Posts: 4,670
Likes: 0
Received 0 Likes on 0 Posts
Post

Don't worry, fixed it now.

Steve
Old 01 July 2002, 07:34 PM
  #3  
Sheepsplitter
Scooby Regular
 
Sheepsplitter's Avatar
 
Join Date: Nov 2001
Posts: 1,072
Likes: 0
Received 0 Likes on 0 Posts
Post

If you ever get this again and easy way to remove the file is something like this:-

rm -ir *

this is an interactive remove, so you can say y/n to each file.
As long as you don't have too many files in the directory it should be pretty quick to find and remove the file.
There are other ways, but most require lots of backslashes or a bit of code, so this way is fairly elegant.

Old 02 July 2002, 10:01 AM
  #4  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

That'll work most of the time. Consider a file called "-r" though, and under some shells that'll give you a fright when you realise the shell re-orders the arguments before they get passed to rm(1), putting it first I use a "perl -e 'unlink()' for stuff like that.

Steve.
Old 02 July 2002, 07:13 PM
  #5  
orbv
Scooby Regular
 
orbv's Avatar
 
Join Date: Apr 2001
Location: Hants
Posts: 1,103
Likes: 0
Received 0 Likes on 0 Posts
Post

Hours of fun creating files called '-rf *' on the root partition. Try 'rm -i -- *'.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
KAS35RSTI
Subaru
27
04 November 2021 07:12 PM
slimwiltaz
General Technical
20
09 October 2015 07:40 PM
IanG1983
Wheels, Tyres & Brakes
2
06 October 2015 03:08 PM
Brzoza
Engine Management and ECU Remapping
1
02 October 2015 05:26 PM
legb4rsk
Non Scooby Related
14
01 October 2015 05:18 AM



Quick Reply: Idiot unix question



All times are GMT +1. The time now is 05:06 AM.