July 28 Jobs

Source: Internet
Author: User

1. Convert the contents of the/etc/issue file to uppercase and save to the/tmp/issue.out file

[Email protected] ~]# cp/etc/issue/[[email protected] ~]# Cat Issue |  Tr ' A-Z ' A-Z ' >/tmp/issue.out[[email protected] ~]# cat/tmp/issue.outcentos RELEASE 6.8 (FINAL) KERNEL \ r on an \mtty Is \lhostname are \ntime is \ t

2. Convert the current system login user's information to uppercase and save to the/tmp/who.out file

[email protected] ~]# who | Tr ' A-Z ' A-Z ' >/tmp/who.out[[email protected] ~]# cat/tmp/who.outroot TTY1 2008-08-09 19:54root pts/ 1 2008-08-10 01:07 (10.10.10.1)

3, a Linux user to the root email, request the message titled "Help", the message body is as follows:

Hello, I am Username, the system version is here,pleasehelp me to check it, thanks!

Operating system Version Information

[[email protected] ~]$ echo  "hello, i am $ (whoami)  the system  version is here, please help me to check it. $ (cat / etc/redhat-release) " | mail -s " Help " root[[email protected] ~]$  logoutyou have new mail in /var/spool/mail/root[[email protected] ~]#  mail>n  8 [email protected]  sun aug 10 06:46  18/ 690    "Help" & 8message  8:from [email protected]  sun  Aug 10 06:46:24 2008Return-Path: <[email protected]>X-Original-To:  rootdelivered-to: [email protected]date: sun, 10 aug 2008 06:46:24 + 0800to: [email protected]subject: helpuser-agent: heirloom mailx 12.4 7/29/ 08content-type: text/plain; charset=us-asciifrom: [email protected]status: rhello, i am ping  The system version is here, please help me to check it.  CentOS release 6.8  (Final)

4, the/root/file list, displayed as a line, and the file name separated by a space

[Email protected] ~]# Ls/root | Tr ' \ n ' ' A anaconda-ks.cfg a.txt b c D install.log install.log.syslog issue manpages-zh-1.5.1.tar.gz test1 test10 test11

5. The contents of the File1 file are: "1 2 3 4 5 6 7 8 9 10" Calculates the sum of all numbers

[[email protected] ~]# echo "1 2 3 4 5 6 7 8 9 10" | Tr ' + ' | Bc55

6. Remove the ' ^m ' character from the Windows text file

[Email protected] ~]# cat-a a.txtaaaaaaaa^m$bbbbbbbbbbbbbbb^m$ccccccccccccccccccc^m$vvvvvvvvvvvvvvvvvvvvvvvvv^m$[ [email protected] ~]# Cat A.txt | Tr-d ' \ r ' >new.txt | Cat NEW.TXTAAAAAAAABBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCVVVVVVVVVVVVVVVVVVVVVVVVV

7, processing string "Xt.,l 1 jr#! $mn 2 c*/fe3 uz4", keep only the numbers and spaces

[[email protected] ~]# echo "Xt.,l 1 jr#ifconfigmn 2 c*/fe 3 uz 4" | Tr-d ' [[: alpha:]][[:p UNCT:]] ' 1 2 3 4

8. Display the path variable in a separate row for each directory

[Email protected] ~]# echo $PATH | Tr ': ' \ n '/usr/lib64/qt-3.3/bin/usr/local/sbin/usr/local/bin/sbin/bin/usr/sbin/usr/bin/root/bin

9. Delete blank lines of the specified file

[email protected] ~]# cat File2aaaabbbbccccdddd[[email protected] ~]# cat File2 | Tr-s ' \ n ' aaaabbbbccccdddd

10. Display each word (letter) in the file in a separate line with no blank lines

[[email protected] ~]# cat File2aaaabbbbccccdddd[[email protected] ~]# tr-cs ' [: Alpha:] ' \ n ' < file2aaaabbbbccccdddd


July 28 Jobs

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.