Linux 文件内容大小写转换
如果是单个文件,用cat file | tr a-z A-Z > newfile 可以将文件内容转换为大写。cat file | tr A-Z a-z > newfile可以转换为小写。
也可以用 awk '{print toupper($1)}' file > newfile
本文介绍了如何在Linux中使用cat、tr和awk命令来转换文件内容的大小写,包括将文本从大写转换为小写,或将小写转换为大写。
如果是单个文件,用cat file | tr a-z A-Z > newfile 可以将文件内容转换为大写。cat file | tr A-Z a-z > newfile可以转换为小写。
也可以用 awk '{print toupper($1)}' file > newfile
2875
1万+

被折叠的 条评论
为什么被折叠?