
Power of Command Line Pt1

Flashcard
•
Instructional Technology
•
Professional Development
•
Hard
Wayground Content
FREE Resource
Student preview

28 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What is the proper command to use to compress the file filename.txt into the zip archive called myfile.zip?
Back
zip myfile.zip filename.txt
Answer explanation
The syntax for zipping a file into a zip archive is "zip myfile.zip filename.txt".
2.
FLASHCARD QUESTION
Front
What statement is used to get input from the terminal when a shell script is being run?
Back
read
Answer explanation
The read command is used to get input from the terminal when using a shell script.
3.
FLASHCARD QUESTION
Front
Consider the following script:
#!/bin/bash
ip=`route -n | grep UG | tr -s “ “ | cut -f 2 -d “ “`
echo “Checking to see if $ip is up..."
ping -c 5 $ip
What does the script output?
Back
Checking to see if ipaddress is up...
Answer explanation
The line in the script that starts with the echo command will cause the string, "Checking to see if $ip is up…" will be executed. When this is executed, the value of $ip will be replaced with the result of the command in the second line (which contains route).
4.
FLASHCARD QUESTION
Front
Which option can be used with tail to print the last 10 lines of a file and then keep printing any new lines that may be added continuously? Options: -n, -f, -x, -a
Back
-f
Answer explanation
The -f option is used to "follow" the contents of the file. This lets tail print the last 10 lines of a file (usually a log file) and continue to print out new lines to the screen as they are added to the file.
5.
FLASHCARD QUESTION
Front
Which command is used to make a shell variable known to subsequently executed programs?
Back
export
Answer explanation
The command export is used to make a shell variable known to subsequently executed programs. Essentially, the export command creates a globally accessible variable when it is run.
6.
FLASHCARD QUESTION
Front
What option can be used with cat to display line numbers with the text of a file to the screen? Options: #, -x, -n, -1
Back
-n
Answer explanation
The -n option will show the line numbers next to a file's contents when displayed to the screen. For example, "cat -n song.txt" will display the contents of the song.txt file with line numbers down the left column of the display.
7.
FLASHCARD QUESTION
Front
What is one of the most basic features of a shell script? Options: The ability to compile programs, The ability to run commands, The ability to ask for user input, The ability to display command output information
Back
The ability to run commands
Answer explanation
A shell script is a computer program designed to be run by the shell. Typical operations performed by shell scripts include file manipulation and command execution. The most basic scripts run commands in serial order and do not provide any output back to the screen or seek input from a user.
Create a free account and access millions of resources
Similar Resources on Wayground
18 questions
Basic C++ Programming Questions

Flashcard
•
University
20 questions
PPC and Economic Systems

Flashcard
•
12th Grade
23 questions
Air Force Enlisted and Officer Ranks 2024

Flashcard
•
12th Grade
21 questions
Econ Unit1 Review

Flashcard
•
12th Grade
20 questions
March Madness

Flashcard
•
KG - Professional Dev...
23 questions
Mandatos formales

Flashcard
•
KG - University
25 questions
AutoCAD Mastery Challenge

Flashcard
•
KG - University
16 questions
Somerset Rank Flashcard

Flashcard
•
Professional Development
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Instructional Technology
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
15 questions
Fun Random Trivia

Quiz
•
Professional Development
22 questions
Anne Bradstreet 1612-1672

Quiz
•
Professional Development
18 questions
Spanish Speaking Countries and Capitals

Quiz
•
KG - Professional Dev...
14 questions
Fall Trivia

Quiz
•
11th Grade - Professi...
15 questions
Disney Characters Quiz

Quiz
•
Professional Development
15 questions
Quiz to Highlight Q types & other great features in Wayground

Quiz
•
Professional Development