E
E
elisey4742016-09-27 20:09:23
linux
elisey474, 2016-09-27 20:09:23

Why is rm not working?

# touch 1.txt
# touch .txt
# ls -a
1.txt .txt
# rm *.txt
# ls -a
.txt
Why does .txt stay? * Means both any number of characters and their absence, no?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xotkot, 2016-09-27
@elisey474

just * does not dereference hidden files (those that start with a dot)
you can see for yourself:
# ls -a *.txt

D
Dmitry, 2016-09-27
@slo_nik

Good evening.
rm -f *.txt
or
sudo rm -f *.txt
But first think before using sudo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question