Monday, January 9, 2023

homebrew rename

To remove first 5 characters from bunch of file names...

From a terminal 

brew install rename

You can use the following command when you are in the folder where you want to make the renaming:

rename -n -v  's/^(.{5})//' *

-n is for no action and -v to show what will be the changes. If you are satisfied with the results you can remove both of them, e.g.

rename 's/^(.{5})//' *

To remove the first 14 characters including spaces of the names of files/folders in the current folder...

rename -n -v  's/^(.{14})//' *

(credit: armtatoo on https://stackoverflow.com)


rename stopped working with ""


Press 'q' to close or escape from 'less' in the terminal window? AKA exit the 'less' command and return to the shell.

How to edit a file from the command line Mac OS X?

sudo vi filename

The following commands will be useful... ESC followed by ':q' to quit or ':quit!' to force quit

for more tips on using vi review https://www.eng.buffalo.edu/~yearke/unix/vi12.shtml

Sharing 360° video?

So, you've got a 360 degree video file from your GoPro. What to do with it? Well, share it on YouTube. YouTube supports uploading and pl...