Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to remove a file and I keep getting a message similar to:

[1] 12345

and nothing happens, I run a directory search (dir) and the file remains and I get a stopped message

share|improve this question
add comment

1 Answer

up vote 14 down vote accepted

You are removing a file with an & character in the name, and the rm command is being put in the background. (For the record, the 1 is the job number, and the 12345 is the process ID)

It is important to quote or escape any filenames that contain special characters. A good rule of thumb is: if you think something might be a special character, it can't hurt to quote. Just put 'single quotes' around the whole filename, unless it contains a single quote mark - then it gets more complicated. You could also (instead of quotes) put a backslash \ before every special character (including any backslashes the filename may contain) Though, if you tab-complete the shell will quote or escape anything that actually is a special character for you.

share|improve this answer
2  
+1. Impressive piece of deduction. –  Faheem Mitha Jun 3 '11 at 19:51
6  
Eh, there's really nothing else that could reasonably cause a message in that format to be printed. –  Random832 Jun 3 '11 at 19:52
add comment

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.