# a single first slash means first occurrence
# if you use a double first slash it means ALL occurrences
In the example above we are searching in the variable $file for ".txt-marked" and replacing with nothing (the empty part after the last / means we are replacing with nothing or actually removing it).
How to replace all occurrences?
The only difference is where the first slash goes. If you use double slashes it means to replace ALL occurences.