I am using Mac Terminal and I need to delete end of filename.
Example of filename : 1516092009.M432844P7000.camel5,S=14022,W=14295/2,
I need to delete the end /2, and I tried command:
rename 's/\/2,//g' * which I think should work but don't. Not all of files in folder have this end.
Any ideas? Thank you
1516092009.M432844P7000.camel5,S=14022,W=14295is a directory and2,is the file./in it.ls -alpfor some of these files./2,in the Finder browser, it will end in:2,when viewed in Terminal. cf apple.stackexchange.com/questions/173529/…. If you want to rename in the command line, you'll need to use the filename as visible in shell.ls -dfor one of the files. Jesse is totally correct in saying that a filename can't contain a/character, not on any Unix system. If you see a/in a filename, then that is the result of decoding some other combination of characters in a particular application, as user4556274 suggests.