Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

Output of "ls -l":

-rw-r--r--  1 root root    0 Mar  4 08:22 -t

When i try to do "rm '-t'":

rm: invalid option -- 't'
Try 'rm ./-t' to remove the file '-t'.
Try 'rm --help' for more information.
share|improve this question

marked as duplicate by Seth Mar 22 at 17:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

20  
So Try 'rm ./-t' to remove the file '-t'. – Pilot6 Mar 22 at 10:16
    
Thank you. It works. – kacpi2442 Mar 22 at 10:19
    
Did you read your own question at all? – Dmitry Grigoryev Mar 23 at 20:04
up vote 24 down vote accepted

You can use rm -- -t or rm ./-t

From man rm

To remove a file whose name starts with a '-', for example '-foo',
use one of these commands:

          rm -- -foo

          rm ./-foo
share|improve this answer

You can use find too:

find . -maxdepth 1 -type f -name '-t' -delete 

Example:

% ls 
egg -t

% find . -maxdepth 1 -type f -name '-t' -delete 

% ls
egg
share|improve this answer

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