Let's say I have two files in /tmp
:
root@ubuntu:~# touch /tmp/hello.{pyc,py}
root@ubuntu:~# ls /tmp/
hello.py hello.pyc
Now, lets run rm -rf
command with [co] option
root@ubuntu:~# rm -rf /tmp/hello.py[co]
root@ubuntu:~# ls /tmp/
hello.py
Can someone please explain what's happening here? What is the [co]
parameter? How can we make it work for other extensions? Say I have foo.js
and foo.coffee
files, can we do something like rm -rf /tmp/foo.coffe[co]
to delete the /tmp/foo.js
?