Solved

Getting rid of no name file

Posted on 2002-05-08
3
196 Views
Last Modified: 2010-04-21
I have a dir which has a file with no name, just blank in the name column. How can i remove it?
I tried doing
find . -user foo -exec /bin/rm -f {} \;
but no luck

thanks
0
Comment
Question by:neptuna
3 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 6997324
assuming your ls -l shows the file like:

   -rw-rw----   1 user group   1800 May  8 14:42

(beside lot of others), then use something like:

   \rm `ls -l|awk '/14:42/{print $NF}'`

replace the pattern "14:42" by something that matches the line uniquely.

NOTE: test the command in backticks **before** using its output as parameter for rm, for example like:

   ls -l|awk '/14:42/{print $NF}'|od -c
0
 
LVL 7

Expert Comment

by:waynezhu
ID: 6997545
try

rm " "*
 
and/or

rm "        "*

# i.e., double quoted space/tab (whitespaces) followed by * sign
0
 

Author Comment

by:neptuna
ID: 6998778
of course, awk to the rescue
thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question