Solved

Getting rid of no name file

Posted on 2002-05-08
195 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 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

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

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.: