Question

LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check...

LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check the output)

  1. Display the command(s) used to do the following: create an empty file called history by using just a redirection operator. Verify and show. Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Wait 1 minute or more and then display the command(s) used to do the following: change the timestamp on the history file you just created. Verify/display the change. Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Display the command(s) used to do the following: back up the history file to the file history.bak. Verify/show it was backed up. Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Assume you have a subdirectory named datafiles directly under your current working directory (create it if it doesn’t exist). Display the command(s) used to do the following: copy the data1 and data2 files from your current working directory to the datafiles directory. Verify/show that the files are there. Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Assume you have 4 files (i.e., create them if they don’t exist): accounts1, accounts2, accounts3, and accounts4 (create them). Display the command(s) used to do the following: write the paste command that combines these files and separates the fields on each line with a “/” character, displaying the results to the screen. Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Display the command(s) used to do the following: how would you perform the action in the step above but instead write the results to the file total_accounts? Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Assume that you have multiple subdirectories and you want to locate all files that end with the extension “.c” (again, some of them if they don’t exist) in them using one command (including any in subdirectories). Display the command(s) used to do the following: what command can you use to search all of your subdirectories for this file extension? Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Create the subdirectory mytest. Display the command(s) used to do the following: copy an existing file into your new subdirectory. Delete the mytest subdirectory and its contents using one command. Show/verify all results (i.e., all commands and their corresponding outputs).
  1. You are worried about copying over an existing or newer file in another directory when you use the mv command. What are your options in this situation? Give an example. Explain others. Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Display the command(s) used to do the following: what command enables you to find all empty files in your source directory (the source directory is located under your home directory and was created in a previous homework assignment ... create it if it doesn’t exist)? Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Display the command(s) used to do the following: how can you find all files in your home directory that were modified in the last 7 days? Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Display the command(s) used to do the following: how can you put the contents of each line of the product1 file side by side with the contents of the product2 file but with only a dash in-between instead of a tab? Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Display the command(s) used to do the following: how can you use a command you have learned in this chapter to list the names of all users on your system? (Hint: Find out the name of the file in which user information is stored.) Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Type who and press “Enter” to view a list of logged-in users along with other information. Display the command(s) used to do the following: now use the who command (which you learned about in Chapter 1) with a command you learned in this chapter to view who is logged in but to suppress all other information that normally accompanies the who command (see pipe (|) symbol). Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Display the command(s) used to do the following: use a command to find the instances in which the word “host” is used in the /etc directory in file names. Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Display the command(s) used to do the following: use a command to find out which lines (i.e., output line numbers) in the my_list file contain the word “Foot” (create this file if it doesn’t exist). Show/verify all results (i.e., all commands and their corresponding outputs).
  1. Display the command(s) used to do the following: create a file called trees, containing the following individual lines using vi:

Oak tree

Pine tree

Spruce tree

Cottonwood

Maple tree

Use the vi editor to create a file called more_trees and copy in the contents of the trees file (if the first line is blank, delete it). Next, add the following trees at the end of the list.

Redwood

Willow tree

Use a command to compare the trees and more_trees files and that outputs the differences in columns.

Use a command to compare the trees and more_trees files and show the differences in terms of individual lines that differ.

Determine the number of bytes in both the trees and more_trees files using a 1-line command.

Use a command to replace the word “tree” with “plant” in the more_trees file and display the output to the screen.

Show/verify all results (i.e., all commands and their corresponding outputs).

  1. Display the command(s) used to do the following: create a new file, CD_list, and enter these lines in the file:

country:1000:210

rock:1001:380

classical:1002:52

alternative:1003:122

light rock:1004:151

light rock:1004:151

celtic:1005:44

jazz:1006:62

soundtracks:1007:32

soundtracks:1007:32

Use the sed command and a script file to add these lines to the end of the CD_list file:

hard rock:1008:70

misc:1009:22

Use a command to find the duplicate lines (records) in the CD_list file.

Use the uniq command to remove the duplicate lines in the CD_list file, placing the corrected information in a file called CD_list_new.

        Show/verify all results (i.e., all commands and their corresponding outputs).

  1. Display the command(s) used to do the following: in the CD_list_new file, replace the word “misc” with “other,” save the changes in the file CD_list_replace, and then compare the contents of the CD_list file with the CD_list_replace file to ensure your changes are implemented.

Use the grep command to find all of the lines that contain the word “celtic” in the CD_list_new file.

Show/verify all results (i.e., all commands and their corresponding outputs).

  1. Display the command(s) used to do the following: use a command to make all letters uppercase in the CD_list_new file and save the output to a file called CD_list_uppercase.

Use the sed command on the CD_list_new file to replace the words “light rock” with “easy listening” and the word “alternative” with “experimental.”

       Show/verify all results (i.e., all commands and their corresponding outputs).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Display the command(s) used to do the following: create an empty file called history by using just a redirection operator. Verify and show. Show/verify all results (i.e., all commands and their corresponding outputs).

touch history

Wait 1 minute or more and then display the command(s) used to do the following: change the timestamp on the history file you just created. Verify/display the change. Show/verify all results (i.e., all commands and their corresponding outputs).

touch -t 201010161000 history

Display the command(s) used to do the following: back up the history file to the file history.bak. Verify/show it was backed up. Show/verify all results (i.e., all commands and their corresponding outputs).

cp history history.bak

Assume you have a subdirectory named datafiles directly under your current working directory (create it if it doesn’t exist). Display the command(s) used to do the following: copy the data1 and data2 files from your current working directory to the datafiles directory. Verify/show that the files are there. Show/verify all results (i.e., all commands and their corresponding outputs).

mkdir datafiles
cp data1 data2 datafiles/

Assume you have 4 files (i.e., create them if they don’t exist): accounts1, accounts2, accounts3, and accounts4 (create them). Display the command(s) used to do the following: write the paste command that combines these files and separates the fields on each line with a “/” character, displaying the results to the screen. Show/verify all results (i.e., all commands and their corresponding outputs).

touch accounts{1..4}
cat accounts1 accounts2 accounts3 accounts4 > merged

We are allowed to do only 4 exercise out of any given.

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 :)

Add a comment
Know the answer?
Add Answer to:
LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • linux help Create a file called trees, containing the following individual lines: Oak tree Pine Tree...

    linux help Create a file called trees, containing the following individual lines: Oak tree Pine Tree Spruce tree Cottonwood Maple tree Pine Tree Copy in the contents of the trees to more_trees file. Next, add the following trees at the end of the list. Redwood Willow tree Use a command to compare the trees and more_trees files and show the differences in terms of individual lines that differ. Determine the number of bytes in both the trees and more trees...

  • COSC 3411 /ITAP 3411 Homework (UNIX Shell Commands) How would you ensure that all ordinary files...

    COSC 3411 /ITAP 3411 Homework (UNIX Shell Commands) How would you ensure that all ordinary files created by you have rw-rw---- as default permissions? How would you sort in the background a file called "bad.txt", and place the results in a file called "sort.txt"? Archive the contents of your home directory (including any subdirectories) using tar. Compress the tar archive with gzip. Now extract their contents. Use the “find” command to locate in /docs and /usr/docs all files that Begin...

  • Please write the Linux commands and run them. h. What is the command or commands that...

    Please write the Linux commands and run them. h. What is the command or commands that would list the contents of the /var/log directory in alphanumeric order? List the command and its output. i. What is the command or commands used to list the files in /var/log in order of their size? List the command and its output. j. What is the command or commands used to list the top 10 file who use the most disk space? What is...

  • do numbers 4-8 4. Given any directory, use the Is command to display: • all files...

    do numbers 4-8 4. Given any directory, use the Is command to display: • all files and sub-directories starting with the letter "D" (note do not list anything in any sub-directory) • its immediate sub-directories (sub-directories only, and no other ordinary files) its immediate hidden sub-directories only - take a screenshot (#3-3) that clearly shows the command and the result. 5. Assume that the following files are in the working directory: $ ls intro notesb ref2 section 1 section3 section4b...

  • Completion is a screenshot of the batch file showing all of the steps to create the file system s...

    Completion is a screenshot of the batch file showing all of the steps to create the file system shown below. Instructions Create a batch file clifilesystem.cmd using Notepad which performs the following steps to create the file system shown below. Also use a proper comment for each step before the command. Proof your work. Finally submit the clifilesystem.cmd file in Blackboard Figure 1. The clijfilesystem.cmd file system Work from Desktop unless using an absolute path Desktop NOS110 OS Labs Homework...

  • Unix/Linux The purpose of this lab is to practice the commands to manage and organize files...

    Unix/Linux The purpose of this lab is to practice the commands to manage and organize files and directories: How would one go about this? Thanks. Task 1: Preliminaries: 1) If you have not already done so, create a directory called bin under your HOME directory. 2) If you have not already made a copy (using ftp) of the file called famous.dat from the Assignment#1, do that now. 3) Make bin the active/working directory. Task 2: Perform all of the following...

  • Linux/Fedora: Write the commands required for the following tasks. Try out each command on your system...

    Linux/Fedora: Write the commands required for the following tasks. Try out each command on your system to ensure that it is correct: a. Make a hierarchical directory structure under /root that consists of one directory containing three subdirectories. b. Copy two files into each of the subdirectories. c. Create one more directory with three subdirectories beneath it and move files from the subdirectories containing them to the counterparts you just created. After you have completed these three steps at the...

  • A filename con comprise multiple embedded dots (e.g., a.b.c.d.e). True False A device file is not...

    A filename con comprise multiple embedded dots (e.g., a.b.c.d.e). True False A device file is not really a stream of characters and doesn't contain anything at all. True False Relative pathnames begin with the root directory. True False Running the ls -a command uniquely identifies directories and binary executables. True False What is the result of running mkdir -p share/man/cat1 from the command line? a. It creates the directory share. b. It creates the directory share/man. c. It creates the...

  • Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell...

    Unix questions, i need help on Hint: Commands to study to answer this question: predefined shell variables, and .profile script file, echo SHELL, HOME, PATH, MAIL and TERM are predefined shell variables. You can use the value of a shell variable in a shell command putting $ in front of it. For example, to display the value of the HOME directory of the user, specify $HOME in the echo command like echo $HOME. Do not give just the value of...

  • 1. Navigate to your home directory by typing cd. Now type ls and notice that there...

    1. Navigate to your home directory by typing cd. Now type ls and notice that there is a subdirectory called Downloads. Now navigate to the root of the file system by typing cd /. From here, which single command would you use to navigate directly to the Downloads folder that is located in your home directory? The output of the command would be as follows: 2. From the Downloads directory which single command would you use to navigate back up...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT