5

What is this strange file with name '*' I cannot even guess..

$ ll
total 549M
-rw-r-----   1 jaewan eng    0 Apr 29 18:37 *
drwxr-x---  21 jaewan eng 4.0K May 20 08:21 ./
drwx------  19 jaewan eng 4.0K May  4 18:09 ../
drwxr-x---   6 jaewan eng 4.0K Apr 13 23:00 .repo/

Can I delete this file?

2
  • Is this located within a folder in your Home directory? And if so... what's the address of that folder? E.g. ~/.gnome2/ May 21, 2011 at 5:14
  • 5
    If you wonder about the file's origin, beware that there is a significant chance that the file was created maliciously so to make you lose your files by issuing rm *.
    – ulidtko
    May 21, 2011 at 5:53

2 Answers 2

6

You can delete the empty file like this:

  rm '*'

If you do need the confirmation on delete, do this:

  rm -i '*'

Edit: You can even use backslash(\) or double quotes("") to escape *.

For example: rm -i "*" or rm -i \*

2
  • 1
    Or, quote it with backslash: rm -i \*.
    – ulidtko
    May 21, 2011 at 5:50
  • @ulidtko: yes. quote with backslash will work. May 21, 2011 at 5:53
1

* is an empty file it seems maybe created by issueing a wrong command?

Ofcourse you can remove it.

Short answer: you can remove any file that has weird characters in it with rm -i ? Longer answer with an example: from command line I made 3 files with 1 of the being '*':

rinzwind@discworld:~/tmp$ ls -l
total 0
-rw-r--r-- 1 rinzwind rinzwind 0 2011-05-21 07:13 *
-rw-r--r-- 1 rinzwind rinzwind 0 2011-05-21 07:14 1
-rw-r--r-- 1 rinzwind rinzwind 0 2011-05-21 07:14 2

rm -i ? is a command you can use to remove files with 1 character long and the -i will ask for a confirmation on any file it matches.

Action:

rinzwind@discworld:~/tmp$ rm -i ?
rm: remove regular empty file `*'? y
rm: remove regular empty file `1'? n
rm: remove regular empty file `2'? n

After the first 'y' you do not need to asnwer the rest with 'n' but you can use control-C to abort the rest of the files (if there are any with 1 character).

Result:

-rw-r--r-- 1 rinzwind rinzwind 0 2011-05-21 07:14 1
-rw-r--r-- 1 rinzwind rinzwind 0 2011-05-21 07:14 2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .