I have a log-file as .txt where I want the first four characters to be replaced by ****
or XXXX
to anonymize the data.
I am running the following command:
tail -f file.txt
I know I can cut the first characters the following way:
tail -f file.txt | cut -c4-
But I would then like to insert four wildcard characters.
How can I achieve this?
echo 1234567890 | sed 's/..../****/'
Output:
****567890