0728 Day work

Source: Internet
Author: User

Exercise 1: Convert the contents of the/etc/issue file to uppercase and save to the/tmp/issue.out file
[[Email protected] ~]# TR [: Lower:] [: Upper:] >/tmp/issue.out </etc/issue [[email protected] ~]# TR ' A-Z ' A-Z ' &G T /tmp/issue.out </etc/issue use tee to output to a file while displaying [[email protected] ~]# TR ' A-Z ' A-Z ' </etc/issue | Tee/tmp/issue.outcentos RELEASE 6.8 (FINAL) KERNEL \ r on an \m\l\t\u
Exercise 2: Convert the current system login user's information to uppercase and save to the/tmp/who.out file
[Email protected] wu]# Who-a | TR [: Lower:] [: Upper:] >/tmp/who.out[[email protected] ~]# Who-a | Tr ' A-Z ' A-Z ' >/tmp/who.out
Exercise 3: A Linux user sends an email to root asking for a message titled "Help" with the following message: Hello, I am username, the systemversion is here,pleasehelp me to check it,thanks! Operating system Version Information
echo "Hello, I am $USER, the system version is here, please help me to check it, thanks! > ' Cat/etc/centos-release ' | Mail-s Help Root
Exercise 4: The/root/file list is displayed as a line, separated by a space between the filenames.
M1:echo ' ls/root ' al3a Documents install.log.syslog Music templatesm2:[[email protected] ~]# Ls/root | Tr ' \ n '
Exercises the contents of the 5:file1 file are: "1 2 3 4 5 6 7 8 9 10" Calculates the sum of all numbers
[[email protected] ~]# seq-s ' 1 9 > F[[email protected] ~]# cat F1 2 3 4 5 6 7 8 9[[email protected] ~]# echo $ ((' t R ' + ' < f ')) 45
Exercise 6: Remove the ' ^m ' character from the Windows text file
Tr-d "\ r" < Oldfile > newfile# "^m", you need to type with CTRL + V + CTRL + M
Exercise 7: Handling the string "Xt.,l 1 jr#! $mn 2 c*/fe3 uz4", keeping only the numbers and spaces
[[email protected] ~]# echo ' xt.,l 1 jr#! $mn 2 c*/fe3 uz4 ' > F[[email protected] ~]# TR-CD [:d igit:] < f1234


0728 Day work

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.