rm -rf | rename multiple files | uppercase | mmv

how to remove folder -rf

drwxrwxr-x 2 ubuntu2 ubuntu2 4096 Aug 16 09:21 -rf/
ubuntu2@ubuntu2:~/temp/s$ rm -r -- -rf
-----------
if you want to match the character [, you have to put it first in the list, as [[aeiou]
if you want to match the character -, you can put it at the start or the end
ubuntu2@ubuntu2:~/temp/s$ ls [[ael]*
a1  a2  a3  a4  a5  l

if you want to match the character -, you can put it at the start or the end
ls [-ael] or [ael-]
----------------
rename multiple files

-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 z1.dot
-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 z2.dot
-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 z3.dot
ubuntu2@ubuntu2:~/temp/s$ rename s/z/b/ z{1..3}.dot

-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 b1.dot
-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 b2.dot
-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 b3.dot
----------------
rename s:b:z: b{1..3}.dot

-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 z1.dot
-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 z2.dot
-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 z3.dot
----------------
 rename y:[a-z]:[A-Z]: z{1..3}.dot

-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 Z1.DOT
--------------
-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 Z2.DOT
-rw-rw-r-- 1 ubuntu2 ubuntu2    0 Aug 16 09:32 Z3.DOT
---------------
 mmv - move/copy/append/link multiple files by wildcard patterns


Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all