Shell Programming

Card Set Information

Author:
randycapped
ID:
270165
Filename:
Shell Programming
Updated:
2014-04-11 07:08:12
Tags:
Linux Shell Unix
Folders:
Unix
Description:
Simple commands for Unix
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user randycapped on FreezingBlue Flashcards. What would you like to do?


  1. What would the output from the following command be given the list of files given?

    Command: echo *

    Give the meaning in English.
    • print all files

    The echo command prints  (or echoes)  at the terminal whatever else you happen to type on the line (with some exceptions)

    The asterisk * matches zero or more characters, meaning that x* matches the file x as well as x1, x2, xabc... and so on.
  2. What would the output  from the following command be given the list of files given?

    Command: echo m[a-df-z]*

    Give the meaning in English.
    • Print to terminal by using echo anything that starts with the letter m followed by [any lower case letter except for e] followed by zero or more characters *
  3. What would the output from the following command be given the list of files given?

    Command: echo jan*

    Give the meaning in English.
    • Print to terminal by using echo anything that starts with jan followed by zero or more characters *
  4. What would the output from the following command be given the list of files given?

    Command: echo ?????

    Give the meaning in English.
    • Print to terminal by using echo anything that matches 5 characters ?????
  5. What would the output from the following command be given the list of files given?

    Command: echo jan?? feb?? mar??

    Give the meaning in English.
    • Print to terminal by using echo anything that starts with jan feb or mar followed by two characters ??
  6. What would the output from the following command be given the list of files given?

    Command: echo *[!0-9]

    Give the meaning in English.
    • Print to terminal by using echo anything that starts with any characters * that [are not ! followed by a numerical 0-9 character]
  7. What would the output from the following command be given the list of files given?

    Command: echo [A-Z]*

    Give the meaning in English.
    The answer should be A-Z since there is nothing in the list that matches any uppercase character followed by any characters.

    •  However, the answer I got was:
    • It was still marked correct as this happens sometimes with different systems.
  8. What would the output from the following command be given the list of files given?

    Command: echo *.*

    Give the meaning in English.
    • Print to terminal by using echo anything that starts with any character * followed by a dot . followed by any character *
  9. What would the output from the following command be given the list of files given?

    Command: echo *02

    Give the meaning in English.
    • Print to terminal by using echo anything that starts with any character * and ends with 02.
  10. What would the output from the following command be given the list of files given?

    Command: echo [fjm][ae][bnr]*

    Give the meaning in English.
    • Print to terminal by using echo anything that starts with a character f , j or m [fjm] followed by a character of a or e [ae] followed by a character of b, n or r [bnr] followed by any characters *

What would you like to do?

Home > Flashcards > Print Preview