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

Random Linux+ Question #38

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

  1. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    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 Administrator Administrator

    6,771
    102
    221
    Wot's with all the {[}]()<>
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Looking at doing ..................
  3. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    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
    179
    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...