1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Random Linux+ Question #53

Discussion in 'Linux+' started by tripwire45, Aug 5, 2005.

  1. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    You are searching for a file in your home directory that is called "testfile" and contains the word "reviewing". You are currently on the command line in your home directory. What are some of the ways you could conduct a search to locate the file containing this word? Choose all that apply.

    1. cat testfile | grep reviewing
    2. grep reviewing testfile
    3. grep reviewing *
    4. grep testfile reviewing
    5. grep * reviewing
    6. cat reviewing | grep testfile

    Answers later.
     
    Certifications: A+ and Network+
  2. starfury6

    starfury6 Nibble Poster

    53
    0
    33
    1, 3 and 4
     
    Certifications: RHCT4, RHCT5
    WIP: SCSA
  3. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    How about 1, 2, and 3?
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  4. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    Answer time. Freddy's correct. The answer is 1, 2, and 3. Answer 1. is easy. You cat the filename and then grep the word you are looking for. 2 works because you are using grep to search for the word reviewing in a file named testfile. 3 works the same way but substitutes a wildcard so you are searching for the word reviewing in all files in the current directory.
     
    Certifications: A+ and Network+

Share This Page

Loading...