Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
Is this located within a folder in your Home directory? And if so... what's the address of that folder? E.g. ~/.gnome2/ –  Alex Stevens May 21 '11 at 5:14
2  
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 '11 at 5:53

2 Answers 2

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 \*

share|improve this answer
1  
Or, quote it with backslash: rm -i \*. –  ulidtko May 21 '11 at 5:50
    
@ulidtko: yes. quote with backslash will work. –  Prince John Wesley May 21 '11 at 5:53

* 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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.