I have several files with spaces in their names. I wanted to replace the spaces with underscores: For example, I used Code: rename -n 's/ /_/g' *.htm to get Code: 02 09 dp.htm renamed as 02_09_dp.htm 02 10 dp.htm renamed as 02_10_dp.htm 02 11 dp.htm renamed as 02_11_dp.htm In the code I know that "s" stands for substitute but what is "g"? (It should be clear that I don't know perl but I know that spaces in filenames can be bad things in *nix.) This is with Ubuntu. Edit: -n does a mock run to let one know what will happen without actually doing anything. It can be replaced with -v (for verbose) or just removed when doing the real thing.