LINUX Redhat Fourth Unit exercises

Source: Internet
Author: User

  1. Execute the find/etc-name passwd command under the student user and manage its output requirements as follows:

    * Show all correct output, mask error output

    find/etc/-name passwd 2>>/dev/null

    650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8F/5C/wKiom1jblpSQoNLbABGJkGcXbZU448.png-wh_500x0-wm_ 3-wmp_4-s_4202433481.png "title=" screenshot from 2017-03-29 19-01-30.png "alt=" Wkiom1jblpsqonlbabgjkgcxbzu448.png-wh_50 "/>


    * Save correct number out to/tmp/find.out, error number out to/tmp/find.err

    find/etc/-name passwd >>/tmp/find.out 2>>/tmp/find.err

    650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/8F/5A/wKioL1jbl0vwmGhVAAqClllAvdw003.png-wh_500x0-wm_ 3-wmp_4-s_2186560934.png "title=" screenshot from 2017-03-29 19-13-36.png "alt=" Wkiol1jbl0vwmghvaaqclllavdw003.png-wh_50 "/>
    * Create/tmp/find.all file, and save all output to this file

    find/etc/-name passwd &>>/tmp/find.all

    650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/8F/5C/wKiom1jbl8Lx1D9WAAxi6xlMCTY863.png-wh_500x0-wm_ 3-wmp_4-s_4143383265.png "title=" screenshot from 2017-03-29 19-15-32.png "alt=" Wkiom1jbl8lx1d9waaxi6xlmcty863.png-wh_50 "/>
    * Save all output to/tmp/find.all again, and keep the contents of the source file

    find/etc/-name passwd &>>/tmp/find.all

    650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/8F/5A/wKioL1jbmHvDcHkCAAzF1bsKL0Y093.png-wh_500x0-wm_ 3-wmp_4-s_546749926.png "title=" screenshot from 2017-03-29 19-18-45.png "alt=" Wkiol1jbmhvdchkcaazf1bskl0y093.png-wh _50 "/>
    * Block all output from this command

    find/etc/-name passwd &>>/dev/null

    650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/8F/5C/wKiom1jbmMKC0Vy7ABF4xe9hucc105.png-wh_500x0-wm_ 3-wmp_4-s_4097865153.png "title=" screenshot from 2017-03-29 19-19-56.png "alt=" Wkiom1jbmmkc0vy7abf4xe9hucc105.png-wh_50 "/>
    * Show all output of this command and save output to any file on the desktop

    find/etc/-name passwd 2>&1 | Tee find.out

    650) this.width=650; "src=" http://img.blog.csdn.net/20170330103517807 "alt=" 20170330103517807 "/>


    * Save correct output to/tmp/find.out.1, mask error output

    find/etc/-name passwd >/tmp/find.out.1 2>/dev/null
    650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/8F/5A/wKioL1jbm5Pg04dgAAzXo1JbtZE936.png-wh_500x0-wm_ 3-wmp_4-s_1923687753.png "title=" screenshot from 2017-03-29 19-31-58.png "alt=" Wkiol1jbm5pg04dgaazxo1jbtze936.png-wh_50 "/>
    2. Processing documents in document/usr/share/mime/packages/freedesktop.org.xml requirements are as follows:

    * Locate the line containing ICH in this file and save these lines to/root/lines

    grep ich/usr/share/mime/packages/freedesktop.org.xml >/root/lines

    650) this.width=650; "Src=" http://img.blog.csdn.net/20170329224129349?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqvc29saxr1zgvftq==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" Southeast "/>


    * Replace the space in/root/lines with vim, but keep the contents of the file

    %s/^\ *//g

    650) this.width=650; "Src=" http://img.blog.csdn.net/20170329224201146?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqvc29saxr1zgvftq==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "alt=" Southeast "/>


LINUX Redhat Fourth Unit exercises

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.