With tr
:
# Converts upper to lower case
$ tr '[:upper:]' '[:lower:]' < input.txt > output.txt
# Converts lower to upper case
$ tr '[:lower:]' '[:upper:]' < input.txt > output.txt
Or, sed
on GNU (but not BSD or Mac as they don't support L
or U
):
# Converts upper to lower case
$ sed -e 's/(.*)/L1/' input.txt > output.txt
# Converts lower to upper case
$ sed -e 's/(.*)/U1/' input.txt > output.txt
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…