linux chp1

Ace your homework & exams now with Quizwiz!

Which shell is used by Linux as the default command interpreter?

Bash shell

While you are typing a command, you misspell the name of a file you want to specify with the command. Which of the following command line key combinations enables you to go back and fix your error?

Ctrl+b

Use the who command to determine the idle time for users currently logged in, but output that information to a file called users_info. Next view the file you created.

Employ the command who -u > users_info and then type, for example, cat users_info.

View the files month and users_info in sequence by using:The less command.The more command.

First use the command line, less month ; less users_info and then type more month ; more users_info.

Create a file called who_info that contains the documentation for the who command. Next, use the less command to view the who_info file contents and scroll forward and backward through the information. Then use the tail command to view the final 12 lines of the who_info file. Finally, use the head command to view the first 12 lines of the who_info file.

First, use the command man who > who_info. Next, use the command less who_info and use the scroll keys, such as the Pg Dn and Pg Up keys. Then use the command tail -n12 who_info. Finally, use the command head -n12 who_info.

Use the command-line history function to determine the most recent two commands you entered.

If students have typed only the sequence of commands for these exercises, then by using the up arrow the last two commands should be who -b and who -uH ; w.

You're in a hurry and have just executed a command to print the contents of a file; and you decide you want another copy of the printout. What key sequence can you use to repeat the last command, which was used to print the file?

Press the up arrow key one time

Use the cal command to determine on what day of the week you were born.

Students should type cal plus the month they were born and the year, such as cal 9 1985.

Use the man program to determine what other commands you should also see in relation to the clear command

Students should type man clear. The other commands of interest are: tput and terminfo.

Use the man program to find out what the -R option does when used with the date command.

Students should type man date and determine that the -R option is used to show a date string in the rfc-822 format.

Use the whatis command to determine the purpose of the ls command.

Students should type whatis ls and see that this command is used to list directory contents.

Which of the following is the UNIX distribution originally developed through AT&T Bell Labs?

System V

What is the purpose of Telnet?

Telnet can be used to connect a UNIX , Linux, or Windows PC to a remote computer.

How would you describe the purpose of the more command?

The more command enables you to view a file's contents by scrolling down.

Run the who -H, cal 2009,, and clear commands using one command-line sequence. What do you end up with on the screen?

The screen ends up cleared.

Explain how you can run more than one command on a single command line.

To run more than one command on a single line, use the ; (semicolon) character to separate each command.

Run the who -uH and w commands using one command-line sequence to compare the results.

Type who -uH ; w. The w command shows additional information, such as JCPU, PCFU, and WHAT columns to view what users are doing.

You enter Cal on the command line to view a calendar but only see an error message. Explain why you got the error message.

UNIX and Linux are case sensitive, so to display a calendar you must use the cal command and not Cal.

You share a Linux computer with a coworker. What is the best way to exit your UNIX or Linux session when you are done?

Use a GUI menu option to log out or enter an appropriate command for the shell you are using, such as exit or logout (if there is no GUI desktop in use).

View the contents of the month file you created in Exercise 8.

Use any of the view commands, such as cat, more, or less.

Create a file called favorite_foods, and list your favorite foods, entering five or six or more. Press Enter after each favorite food so it appears on its own line (make certain you also press Enter after the final food item). After the file is created, add two more foods you like that are not on the list (press Enter after the final food item). View the list of foods to make certain the two items you added appear at the end of the list.

Use cat > favorite_foods, type the favorite foods, and press Ctrl+d to finish and save the information. Next, type cat >> favorite_foods enter the two new foods and press Ctrl+d.

View the documentation for who and then view the documentation for w. How are these commands similar?.

Use man who and then man w to view the documentation. As the documentation notes, who displays who is logged on and w displays not only who is logged on but what they are doing.

Clear the screen, and view the online manual to determine how to display today's date in UTC.

Use the clear command and then use the man date command for this exercise. .

Create a file called month containing the current month

Use the command cal > month.

Determine when the computer you are working on was last booted.

Use the command who -b.

Use the cal command to determine which year between 2005 and 2010 is a leap year.

Use the command, cal -j 2008, because 2008 is a leap year; also use cal -j 2012, because 2012 is also a leap year. Note that a leap year has 366 days in the Julian calendar.

Display the current UTC.

Use the command, date -u.

On which of the following types of computers might you find a UNIX or Linux operating system? (Choose all that apply.)

a mainframe computer, b. a desktop PC, c. a server, and d. a workstation for scientific research

You work at a law firm with eight other people. All of the eight computers on the firm's network use wireless connections to communicate with one another without a server. This is an example of which of the following?

a peer-to-peer network

Which of the following are examples of Linux distributions? (Choose all that apply.)

a. SUSE Linux Enterprise, b. Mandriva, c. Fedora, and d. Red Hat Enterprise Linux

Which of the following commands enable you to view the contents of a file? (Choose all that apply.)

a. less and b. cat

Before you make the note in Question 1, you decide to determine Friday's date, so that you can include it in your note. What Linux command can you use to quickly determine the Friday's date?

cal

Your boss drops by your office in a hurry to ask you to attend a meeting at 10:30 on Friday morning and you can't find a pen to make a note as a reminder. What Linux command can you use to make a quick note to store in a file called Meeting?

cat > Meeting

You need to type in a line of text to the end of a file called Annual_Report. Which of the following commands enables you to add the text?

cat >> Annual_Report

You have been entering lots of commands and now your terminal window is cluttered will all kinds of activity. What command can you use to clear your window of the clutter?

clear

Your international company is scheduling a meeting among managers in Canada, the United States, Spain, Sweden, and Hong Kong on the basis of Greenwich Mean Time (GMT). What command enables you to display the current time in GMT?

date -u

SSH can be used to ___________________.

log in remotely to another computer on a network

You have forgotten the purpose of the -n option in the cat command. Which of the following can you enter at the Linux command line to find out what the -n option does when used with cat?

man cat

You haven't changed your user account password for several months and now decide to create a new password. Which of the following commands should you use?

passwd

You are working with a new colleague who has entered the man command, but who does not know how to end the man session to return to the regular command prompt. What keystrokes do you show your colleague to end the man session? (Choose all that apply.)

q

In your document files, you often put the date you created the file and the date you last modified it in the last two lines of the file. What command can you use to look at only the last two lines of the file called, project?

tail -n 2 project

This is your first day on the job as a Linux server administrator and your boss gives you the password for root. What is root?

the administrative account that has complete access to a UNIX/Linux system

When you enter the who command, what information do you see? (Choose all that apply.)

the users on the local system

Use the history function to retrieve the command line you used in Exercise 19. Use the edit function to remove the word "clear" and replace it with "date." Next, go to the beginning of "cal" and delete the text on the line from "cal" to the end. Now, change the -H to -u. Finally, add "; date -u" so that your final command-line entry is: who -u ; date -u. Execute the command-line entries.

First, use the up arrow to retrieve the who -H ; cal 2008 ; clear command. Press Ctrl+b or the left arrow key to go to the beginning of clear and press Ctrl+k. Type the word date. Next, press Ctrl+b multiple times or use the left arrow key to go to the beginning of cal. Press Ctrl+k. Use the left arrow key or press Ctrl+b to move to the H. Press Del and type u. Use the right arrow key to go just beyond the semicolon and type date -u. Press Enter.

View the files, month and users_info, in sequence using only one command-line sequence of commands

For this exercise students might use the cat command, such as cat month ; cat users_info.


Related study sets

MORTON 10E CH 56 - Drug Overdose and Poisoning FINAL

View Set

peds exam 1: question 10 (patterns of growth and development)

View Set

Microeconomics Perfect Comp/Monopolistic Comp/Monopolys

View Set

Chapter 5b- Practical Applications of Classical Conditioning

View Set

Mental health and Illness Test #1

View Set

NUR 45200 Ch. 4 (1-10), 5 (11-19), 7 (20-29), 8 (30-39)

View Set

Stats 3.2 Conditional Probability and the Multiplication Rule

View Set