bash - bunnyamin/bunnix GitHub Wiki
Prompt
Environment variables
Name |
Comment |
PWD |
The current working directory. Requirement in POSIX. The variable should be available in all shells compliant with POSIX. |
Practical commands
Exempt file
directory_x/
directory_y
directory_z
file_a
file_b
$ shopt -s extglob
$ mv !(directory_y) directory_x/directory_z
Include files and directories that begin with dot
directory_x/
.directory_z
.file_a
.file_b
directory_y/
echo 'alternative #1'
$ shopt -s dotglob
$ mv directory_x/* directory_y/
echo 'alternative #2'
$ mv directory_x/.[!.]* directory_y/
Rename files
$ rename --version
/usr/bin/rename using File::Rename version 0.20
$ rename 's/\.jpeg$/.jpg/' *
$ rename --version
rename from util-linux 2.30.2
$ rename .jpeg .jpg *
Debug