Solved

# Getting rid of no name file

Posted on 2002-05-08
Medium Priority
202 Views
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
Question by:neptuna

LVL 51

Accepted Solution

ahoffmann earned 400 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

ID: 6997545
try

rm " "*

and/or

rm "        "*

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

Author Comment

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

## Featured Post

Question has a verified solution.

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

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
###### Suggested Courses
Course of the Month12 days, 16 hours left to enroll

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

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