Solved

Getting rid of no name file

Posted on 2002-05-08
3
194 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
Comment Utility
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
Comment Utility
try

rm " "*
 
and/or

rm "        "*

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

Author Comment

by:neptuna
Comment Utility
of course, awk to the rescue
thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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 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…
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.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now