Question: I am trying to find and delete all `.swp` files in my current directory. I was using below command:

```
rm -i `find . | grep .swp$`

```

But everytime it is giving me this error:

```
rm: missing operand
Try `rm --help' for more information.

```

Anything wrong I am doing?

Answer: 
The error message you received probably indicates that no file matched the name pattern `.swp$`. A generally safer way to do what you wrote (because it will handle any file name):

```
find . -name '*.swp' -print0 | xargs -0 rm -i --

```

In the snippet above, I used `-print0` so that `find` separates
records with null characters; the default is newlines, which
unfortunately is valid within a filename. With `-print0`, the command
works works with any filenames, including any that embed
newlines. Likewise, `xargs -0` processes its input as null-separated
records.
Always use the simplest tool for the job. As you want to operate on the current directory only, this command will work fine:

`rm -i *.swp`