I have a total of 31 directories. Every directory has a random name.
❯ ls -al total 32 drwxr-xr-x 34 shinokada staff 1088 Dec 28 17:16 . drwxr-xr-x 32 shinokada staff 1024 Dec 28 17:12 .. -rw-r--r--@ 1 shinokada staff 14340 Dec 28 17:16 .DS_Store drwxr-xr-x 5 shinokada staff 160 Dec 28 17:10 05618066 drwxr-xr-x 5 shinokada staff 160 Dec 28 17:08 0fef2d20 drwxr-xr-x 5 shinokada staff 160 Dec 28 17:09 11ff096d drwxr-xr-x 5 shinokada staff 160 Dec 28 17:09 1651ff1f drwxr-xr-x 5 shinokada staff 160 Dec 28 17:09 2123b256 ... and more Now I'd like to rename them sample1 sample2 sample3 ...sample31.
How can I do it on a terminal(bash/zsh)?
Is there a quick way to do it rather than rename one by one?
renametool; there are several incompatible ones, so it's unclear which one you refer to, but if you have the Perl-based one, it can probably do what you are asking in a slick one-liner.