1. 将/etc/issue文件中的内容转换为大写后保存至/tmp/issue.out文件中
[root@ccfire ~]# cat /etc/issue
\S
Kernel \r on an \m
[root@ccfire ~]#
[root@ccfire ~]# cat /etc/issue | tr 'a-z' 'A-Z' > /tmp/issue.out
[root@ccfire ~]#
[root@ccfire ~]# cat /tmp/issue.out
\S
KERNEL \R ON AN \M
2. 将当前系统的用户登录信息转换为大写后保存至/tmp/who.out文件中
[root@ccfire ~]# who
root :0 2021-06-24 10:39 (:0)
root pts/0 2021-06-24 10:49 (:0)
[root@ccfire ~]#
[root@ccfire ~]# who | tr 'a-z' 'A-Z' > /tmp/who.out
[root@ccfire ~]#
[root@ccfire ~]# cat /tmp/who.out
ROOT :0 2021-06-24 10:39 (:0)
ROOT PTS/0 2021-06-24 10:49 (:0)
[root@ccfire ~]#
[root@ccfire ~]# w
10:53:51 up 23 min, 2 users, load average: 0.00, 0.08, 0.14
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root :0 :0