Random Linux+ Question #38

Discussion in 'Linux+' started by tripwire45, Jul 20, 2005.

  1. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    You want to redirect the output of several commmands at once to a file called "collect". You want to collect the output of the "id" command and the "ls -l" commands for both your home directory and the /bin directory to this file. Of the choices below, which command will accomplish your task? Choose only one answer.

    1. (id ; ls -l ~ ; ls -l /bin) > collect
    2. (id : ls-l ~ : ls -l /bin) > collect
    3. [id . ls-l ~ . ls -l /bin] > collect
    4. {id \ ls-l ~ \ ls -l /bin} > collect
    5. ((id : ls -l ~ : ls -l /bin)) > collect
    6. {id ; ls -l ~ ; ls -l /bin} > collect

    Answer later.
     
    Certifications: A+ and Network+
  2. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    Wot's with all the {[}]()<>
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  3. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    If you mean all the brackets, when you want to run multiple commands in a single shell, you have to contain them. Your job is to determine which command syntax is correct to accomplish the stated goal. Good luck, AJ. :biggrin
     
    Certifications: A+ and Network+
  4. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    Answer time. The correct answer is #1. If you want to process several commands at the same time and redirect them to the file "collect", all of the commands must be contained in parenthesis and each command must be separated by a semi-colon.
     
    Certifications: A+ and Network+

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.