Quantcast
Channel: Admins Goodies » rm
Viewing all articles
Browse latest Browse all 10

remove files starting with dash

$
0
0

Question

I have (by mistake) created several files starting with a dash in my home directory. I can not select them nor delete them.

# ls -lht
-rw-r--r--  1 root  root  325 Mar 22 16:33 -s-vmstat-overall
-rw-r--r--  1 root  root 2.7K Mar 22 16:33 -s-vmstat
-rw-r--r--  1 root  root 8.4K Mar 22 16:32 -s-df
-rw-r--r--  1 root  root  29K Mar 22 16:32 -s-diskstats
-rw-r--r--  1 root  root  12K Mar 22 16:32 -s-interrupts
-rw-r--r--  1 root  root 9.7K Mar 22 16:32 -s-meminfo
-rw-r--r--  1 root  root 155K Mar 22 16:32 -s-mysqladmin
-rw-r--r--  1 root  root 203K Mar 22 16:32 -s-netstat
-rw-r--r--  1 root  root  37K Mar 22 16:32 -s-netstat_s
-rw-r--r--  1 root  root  766 Mar 22 16:32 -s-output
-rw-r--r--  1 root  root  11K Mar 22 16:32 -s-procstat
-rw-r--r--  1 root  root  13K Mar 22 16:32 -s-procvmstat
-rw-r--r--  1 root  root 175K Mar 22 16:32 -s-slabinfo

How to remove all such files starting with -s-

Asked by shantanuo

Answer

rm ./-s-*

Isn’t this a FAQ yet? Should it perhaps be one, if not?

Answered by MadHatter

Viewing all articles
Browse latest Browse all 10

Trending Articles