nos 120

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which of the following is the right way to use the string constant, Enter your ID:, in the C language?

"Enter your ID:"

What is the purpose of the top command and how can you use it to stop a process?

The top command enables the user to monitor CPU-intensive tasks. A process/task can be stopped when you enter the k command and provide the PID.

The IP address ____ is the standard designation for loopback communications.

127.0.0.1

Your department is developing its own set of marketing applications. In a meeting, a member of the department asks whether a menu can be set up in the GNOME desktop for easy access to the new applications .What is your response?

A menu can be set up and launched from a Panel in GNOME.

Your company has assigned you to revise 22 scripts. Since you use the vi editor, how can you set it to automatically display lines as numbered so it is easier for you towork on these revisions?

Create the .exrc file in your home directory so this file contains the line :set number

The ____ file is run each time you log in or give the command to set Bash as your current shell, but not when you run a subshell.

.bash_login

A new programmer whom you are training is writing a C program and wants to place comment lines in the program. Which of the following characters should be used at the beginning and end of the comments?

Use / at the beginning of the comments and / at the end

Shell scripts run more quickly than compiled programs.

False

One of your colleagues has written a Perl script, but it does not run on some people s computers who use a different Linux distribution or who do not use the Bash shell. Which of the following might be the problem?

The script does not have a beginning line that contains the path to Perl, such as #!/usr/bin/perl

Comments lines begin with an

#

To run a program in the background, append the ____ character to the end of the command used to start the program.

&

Which of the following characters are placed right after a function name when you create a shell function?

()

When you create a section name in a man page, such as the DESCRIPTION section, what tag should you use just before the section name?

.SH

You colleague is creating an HTML-based Web page and wants the first line to have the largest heading size, and so he uses the tag .This tag isn t producing the expected result. What tag should he use instead?

<H1>

When you enter echo $CLR your screen clears very quickly.Which of the following commands must you have entered previously to enable use of echo $CLR to clear the screen?

CLR = `clear`

When you have the default GNOME desktop set up, how can you quickly access the contents of your home directory?

Double-click the icon that is labeled with your account name and the word Home.

You have spent the last two hours creating a report in a file and afterwards you use cat to create a new file. Unfortunately the new file name you used was the same as the name you used for the report, and now your report is gone.What should you do next time to prevent this from happening?

Enter the command, set -o noclobber before you start

If a source file contains ____ errors, it cannot be converted into an executable file.

False

Shell scripts can automatically access variables created and assigned on the command line.

False

Name a file manager in either GNOME or KDE and suggest five things you can accomplish with it.

GNOME has Nautilus and KDE has Knoqueror. Common actions you can accomplish via both include, view files and folders, create folders, delete or move files and folders, copy and paste files and folders, configure permissions, open a document or program, and access the Internet.

For which of the following logic structures used within a script is fi the final line for that logic structure? (Choose all that apply.)

If

A colleague at work has overheard you discussing the spaceship operator and is curious about what this is. What do you tell him?

It performs numeric sorts in Perl

You have written the following line in a Perl program: $filein = $ARGV[0]; What is the purpose of this line?

It saves the name of a file passed from the command line in ARGV[0]

To view a list of the files in a directory, including the hidden files, you should enter ____.

Ls -a

You currently have four open windows in KDE and are out of space on your desktop. Because you are feverishly working on a project, you need to leave all four windows open and start three new windows to access other data and programs.What can you do to make your work easier?

Open the new windows on another desktop.

You want to use a more lively desktop background than the one installed by default via KDE. How can you set up a new desktop background?

Right-click an open spot in your current desktop background and click Configure Desktop.

Your network has a combination of Linux and MicrosoftWindows computers.There is aWindows server that offers shared files for clients to access.Which of the following enables you to access the shared files from your Linux computer?

Samba

Sometimes when you walk away from your desk and come back you find your work associate from a nearby cubicle using the Internet on your computer, because he says your connection is faster. How can you best protect your computer from this type of intrusion?

Set up a screensaver and have it lock your computer when it is activated.

Your new colleague is tuning the performance of her computer and is planning to set the runlevel to 6 to speed it up.What is your advice?

The runlevel should never be set to 6.

When you enter test -d tmp ; echo $?, you see a 0 displayed on the screen.What does this mean?

The tmp directory exists

You have created the following expression in Perl: $value < 2842.What does this expression mean?

The variable value is less than 2842

A .bash_logout file in each Bash user's home directory executes commands when the user logs out

True

What started as a simple C program has now turned into several program modules asyou have refined it over the past several months.The problem is that now you do notalways remember which modules you have changed at what time.What should you do?

Use the make utility and create makefiles

In the following statement, when is Could not open students file displayed? Open (FILEIN, "students") || warn "Could not open students file \n" ;

When open (FILEIN, "students" is false

You have created a series of scripts that use the same environment variables. However, when you run these scripts, some of them do not seem to recognize the environment variables you have set.What is the problem?

You need to use the export command so these variables have global use

You ve written a C program, but are now getting an error message about the use of standard input and output statements when you compile the program. Which of the following might be the cause?

You omitted the preprocessor directive for the file stdio.h

You frequently use the command ls -a and want to save time by just entering l to do the same thing.Which of the following commands enables you to set your system to view hidden files by only entering l ?

alias l=" ls -a"

You have a specialized data file, called customers, in which the fields in the file are separated by the character ^.You want to view this file with a colon between the fields before you convert it to remove the ^ characters and insert colons.Which of the following commands enables you to view the file in this way?

cat customers | tr "^" "."

Gives the owner read, write, and execute permissions.

chmod 755

What would you expect to find in the HOME environment variable?

the path name for the users home directory What would you expect to find in the HOME environment variable?

Your company is launching a marketing campaign, and to start, you've created a file called promotion in normal uppercase and lowercase letters that will be used to place text for ads on the Internet and in newspapers.When you show the promotional text to your boss, she is curious about how it would look in all uppercase letters for emphasis.Which of the following commands enables you to convert the text and save the result to the file, promotion_uppercase?

dd if=promotion of=promotion_uppercase conv=ucase

You have written a shell program that creates four temporary files.Which of the following commands can you use to remove these files when the script has completed its work?

del

In Perl, the control sequence \n is used to

designate a new line

You've obtained over a hundred large graphics files to use in publications, but you want to be sure there is enough available disk space on your computer to store these files.Which of the following commands should you use?

df

When you type for wood maple spruce oak pine at the command line and then pressEnter, what should you type next at the > prompt?

do

The following example shows a(n) ____ variable: %animals = ('Tigers', 10, 'Lions', 20, 'Bears', 30);

hash

Assume the script you are creating takes data input to use for updating a file. Before taking the data input, which of the following should you consider?

input validation

Perl is a(n) ____ language, which means that statements are read and immediately executed.

interpreted

Once in a while after your system has been improperly shut down, such as during a power outage, it reboots into the command line. After you log in, what command can you use to start XWindow and your desktop?

startx

Create a simple function that determines if the string variable, text, contains no characters (is of zero length).

stringtest() { test -z $text echo $? }

What symbol is typically used at the start and end of a flowchart?

terminator

How can you specify which device to use for a restore from a backup tape created by the dump command?

use the -f option

You have recently met with your company's budget committee about creating a script to for producing the same budget reports at the end of each month. Because this is an important undertaking you've started by creating a flowchart.What step should you take next?

write pseudocode before you create the actual script

antother name for xwindow is

x11

What character shows that you are starting a block of code in the C and C++ languages?

{

You use the chexec command to indicate that a (shell script) file can be executed.

False

What are three examples of looping logic structures that can be used in the Clanguage?

for while do-while

You are gathering information about the amount of disk space occupied by users' home directories.

du

You are working on a report about disk usage on your company's server to help determine if it is time to purchase additional disks.Which of the following commands enables you to obtain disk usage statistics for your report?

du -h | more

When you assign values for an array, what character should precede the name of the array?

@

What is the difference between a "compiler" and an "interpreter"?

Compilers and interpreters have similar functions: They take a program written in some programming language and translate it into machine language. A compiler does the translation all at once. It produces a complete machine language program that can then be executed. An interpreter, on the other hand, just translates one instruction at a time, and then executes that instruction immediately. (Java uses a compiler to translate java programs into Java Bytecode, which is a machine language for the imaginary Java Virtual Machine. Java Bytecode programs are then executed by an interpreter.)

A programmer in your group has written the following subroutine, which does not work. What is the problem? run sort { if ($a < $b) { -1; } elsif ($a == $b) { 0; } else { +1; } }

He should replace "run" with "sub"

The .bashrc file is a hidden file contained in ____ directory.

Your home

Which of the following statements enables you to print File updated. on the screen when a C++ program is finished?

cout << "File updated.\n";

The UNIX/Linux shell acts as a(n) ____ when reading script files.

interpreter

The ____ utility manages a firewall and packet filtering.

iptables The ____ utility manages a firewall and packet filtering.

You've purchased a new program for your computer, but the computer seems to slow down when you run the program.Which of the following commands enables you to monitor the memory usage as you run the program so you can determine if the program is a memory hog?

Free

Name a function that enables you to read the contents of a file and another function that enables you to write to the file in the C language.

fgetc() fputc()

The programmer you are training wants to write code to determine when the end of a file has been reached. Which of the following can he use?

feof ()

Your current working directory contains a series of files that start with the word "account" combined with a, b, c, d, and e, such as accounta, accountb, and so on. Which of the following commands enables you to view the contents of all of these files? (Choose all that apply.)

more account [ a,b,c,d,e ]


Conjuntos de estudio relacionados

Org Behavior Test Bank Chapter 1

View Set

Combining Forms: Muscles and Related Structures

View Set

Wireless_chp6_Communication for wireless Networking

View Set

Grow Your Business with Google Ads: Module 1

View Set