Question

In: Computer Science

Using Linux in VirtualBox Do the Following Exercise: Using the clear command At this point, you...

Using Linux in VirtualBox Do the Following Exercise:

Using the clear command

At this point, you screen might seem filled with commands and their results. Use the clear command anytime you want a clean slate. This exercise enables you to clear the screen now.

To clear the screen:

  1. Type clear on the command line, and press Enter. The command prompt is now in the upper-left corner of your screen. [No output or questions for this part.]

Viewing manual pages

You can use the manual pages to learn more about a command or program (if the program is documented in the manual pages). In addition, the whatis command provides a quick summary of specific command and programs. You use both the man and whatis command in this exercise. The database for the whatis command should already be created prior to using the command.

To display online help using man:

  1. Type man who in the command line, and press Enter. Do you see the explanation of the who command?                                                                         
  2. Press Enter one or more times to view additional lines of text. Next press the spacebar to view additional pages of documentation.
  3. Type q to exit the man program.
  4. Type man man and press Enter. You see the man page describing the man command. What is the purpose of the –M option?
  5. Type q to exit the man program.

To display a brief description of a command with the whatis command:

  1. Type whatis who and press Enter.
  2. Do you see a summary of the who command? Record it here:                                                     

Editing command-line input

[Do all 11 steps, but there is no need to record the output for your report.]

Entering multiple commands

You can execute multiple commands on one command line by using a semicolon between commands. You will practice running multiple commands in this assignment.

To enter multiple commands on the command line:

  1. Type date; cal and press Enter to view the current date and this month’s calendar. Record your screen:                                                                                                                           
  2. Type date; who –uH and press Enter. The date command produces the first line of the output; the remainder of the output is the results of the who command. Record your screen:                                                                                                                                                             

Using command history

In this assignment, you will use the command history capability of the Bash shell to recall commands you have used earlier. As you’ll discover the more you use Linux, this command can save a lot of time otherwise spent on repeated typing.

To use the command-line history:

  1. Type date and press Enter.
  2. Type who and press Enter.
  3. Type who –uH and press Enter.
  4. Type clear and press Enter.
  5. Press the up arrow key four times, the date command is recalled to the command line. Do not press Enter.
  6. Press the down arrow key twice. What command do you see?                                                    Press Enter to execute the command.

Changing your password

Your password is your means to protect your user account from others who might attempt to access it without your authorization. Plan to change your password often to keep your account secure. In this assignment, you will learn how to change your password.

To change your password:

[Do steps 1-4, but there is no need to record the output for your report.]

Using the cat command

The cat command has several purposes, but one of the most commonly used is to view the contents of a file. For example, in this assignment, you use the cat command to view a file called shells that resides in the /etc directory. This file contains a list of valid shell programs available through Linux.

To use cat to view the shell’s file:

  1. Type cat /etc/shells after the command prompt, and press Enter (the forward-slash (/) is used to indicate a directory or folder change.) What do you see on your system?                                                                                                                                                                       
  2. Sometimes, it is helpful to see a file’s contents displayed with line numbers. The –n option causes the cat command to display a number at the beginning of each line of output. Type cat –n /etc/shells and press Enter. You should see the same list of shells as before, but his time a number precedes each line.

Redirecting command-line output to a file

You already used the who command to find out who is logged in to the computer. In this assignment, you will use the same command with the > redirection symbol to save this information in a text file.

To save a file that lists the persons logged into the system:

  1. Make sure you are under the directory of /home/user, or type cd to move to the /home/user directory.
  2. Type who > current_users after the command prompt, and press Enter. The who command output does not appear on the screen but is redirected to a new disk file called current_users. Linux places this text file in the active directory (the directory on the disk where you are currently using the system).
  3. Type cat current_users after the command prompt, and press Enter to see a list of users currently using the system. Record your output:                                                             

Redirecting calendar output to a file

You can also use the redirection symbol with the cal command to save a calendar in a text file. For example, assume that you are involved in a development project with a projected deadline in the year 2018. You can save the calendar in a text file.

To save the year 2018 calendar in a file.

[Do steps 1-3, but there is no need to record the output for your report.]

Creating a new file with information you type in

As you work with Linux, suppose you remember that your instructor asked you to complete a few tasks by the end of the week. In this project, you will create a notes file to serve as a task reminder using the cat command with the > redirection symbol.

To create a new file:

  1. Type cat > notes after the command prompt, and press Enter.
  2. Type the following: Remember to order a new CD-ROM, and send the report by Thursday, and press Enter.
  3. Press Ctrl+d.
  4. To review the file you just created, type cat notes after the command prompt, and press Enter. The sentence you typed in step 2 should appear on the screen. Record your screen:                                                                                                                                                                  

After you create the notes file, let’s say you remember that your instructor also asked you to complete another task. You can append this second reminder to the existing notes file. You also want to include the appropriate monthly calendar in the file for reference.

To add information to an existing file:

  1. Type cat >> notes after the command prompt, and press Enter.
  2. Type the following: Also remember to make reservations for Sept. conference, and press Enter.
  3. Press Ctrl+d.
  4. To add the September calendar to your notes, type cal 9 2018 >> notes and press Enter.
  5. Type less notes and then press Enter to review the file. Record your observation:                                                                                                                                                                       

Type q to exit the file

Solutions

Expert Solution

Type man who in the command line, and press Enter. Do you see the explanation of the who command?

Yes as shown in the screenshot it will open help manual for who command

-M path, --manpath=path
By default, man uses manpath derived code to determine the path to search. This option overrides the $MANPATH environment variable and causes option -m to be ignored.

test@test-VirtualBox:~/canvas-lms$ whatis who
who (1) - show who is logged on

shell
*******

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)


Related Solutions

Using Linux in VirtualBox To display your system date: Type date in the command line, and...
Using Linux in VirtualBox To display your system date: Type date in the command line, and press Enter. What do you see?                                            You might see the abbreviation EDT (Eastern Daylight Time) instead of EST (Eastern Standard Time), or another time zone abbreviation, such as MDT (Mountain Daylight Time) or CST (Central Standard Time). Notice also that UNIX/Linux uses a 24-hour clock. Type Date in the command line, and press Enter. What error do you see?                                    The system error...
linux: Become the root user for this exercise. What command did you use to do this...
linux: Become the root user for this exercise. What command did you use to do this again? $ Now that you are root, create a new user on your system called labsevenuser. What is the command you used to create this user? # Set a new password for the new user you just created in step 2 above. What is the command you used to do this? # Create a new group called awesomepeople. Add the user you created in...
linux: Become the root user for this exercise. What command did you use to do this...
linux: Become the root user for this exercise. What command did you use to do this again? $ Now that you are root, create a new user on your system called labsevenuser. What is the command you used to create this user? # Set a new password for the new user you just created in step 2 above. What is the command you used to do this? # Create a new group called awesomepeople. Add the user you created in...
In MongoDB using Linux how do you Execute the command to find the size of a...
In MongoDB using Linux how do you Execute the command to find the size of a single document of your choosing from the enron database Execute the command to find the size of the collection of documents in the enron database
unix/Linux Create a tar command using the man command and the link referred to in To...
unix/Linux Create a tar command using the man command and the link referred to in To Practice and Explore: Text File Utilities #9. Preliminaries Use the man pages to learn more about tar Review the links referred to in To Practice and Explore: Text File Utilities #9 to see examples of using tar command Perform Use tar "to stuff" three files and then "unstuff" them into a new directory. Include the -v option. Task ll to show the original 3...
Using Virtualbox in Debian, write a simple program (a single .cpp file) in Linux shell C++...
Using Virtualbox in Debian, write a simple program (a single .cpp file) in Linux shell C++ Rules: -Use fork(), exec(), wait(), and exit() _______________________________________________________________________________________________________________________________________________ -A line of input represents a token group. -Each token group will result in the shell forking a new process and then executing the process. e.g. cat –n myfile.txt // a token group -Every token group must begin with a word that is called the command(see example above). The words immediately following a command are calledarguments(e.g....
Using Virtualbox in Debian, write a simple program (a single .cpp file) in Linux shell C++...
Using Virtualbox in Debian, write a simple program (a single .cpp file) in Linux shell C++ Rules: -Use fork(), exec(), wait(), and exit() _______________________________________________________________________________________________________________________________________________ -A line of input represents a token group. -Each token group will result in the shell forking a new process and then executing the process. e.g. cat –n myfile.txt // a token group -Every token group must begin with a word that is called the command(see example above). The words immediately following a command are calledarguments(e.g....
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how...
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how to create user accounts Understand how to create group accounts Creating good password policies Understanding permissions and file sharing Setup: You will need a Ubuntu Server VM Walk Through: You are a system administrator who has been tasked to create user accounts for new users on your system. You can pick whatever theme you like as long as there are protagonist and antagonist users:...
In LINUX Provide the command(s) and any additional steps to perform the following tasks. You will...
In LINUX Provide the command(s) and any additional steps to perform the following tasks. You will need to be running with root privileges. Create a symlink to the /etc/openldap/ directory named "ldapconf" in /tmp/. Find all .conf files in the /etc/ directory and its subfolders. Find all directories starting with "gnome" or "GNOME" anywhere under the /usr/share/ directory. Sam and Susan are members of the "sales" group. Sam has been working on a project that has grown too big for...
Linux What is the tar command? a. Can you compress files using tar? Please explain how...
Linux What is the tar command? a. Can you compress files using tar? Please explain how and provide a brief example. b. How do you create a tar file? Please provide an example. c. How do you extract files in a tar format? Please provide an example.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT