Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Introduction to LINUX/UNIX. ---- . Creating a file in Vi. ASSUME THERE ARE FILES

ID: 641685 • Letter: I

Question

Introduction to LINUX/UNIX. ---- .

Creating a file in Vi. ASSUME THERE ARE FILES AND DIRECTORIES WHERE THERE ARE QUESTIONS THAT WOULD REQUIRE THEM TO EXIST. In other words "file does not exist" is not a correct answer. When required state the whole command line contents to make the utility work correctly to meet the requirements of the question. Be careful! If it were me, I would actually try each command, even if I had to create a file to try it on.

Provide the command and options, or output for the following:

NOTE: You will at least have to create files for questions 15-20, in your actual home directory. Also, you may wish to create some of the other files used to check what you "think" the answers are...be careful.

1. Command to find all lines containing the string "dogs" in a file called pet-list.

2. Command to display the contents of c1, c2, and c3 (and all other files that start with a c and have only one other character in their name out of directory that has 100 files starting with "c" and ending in a number.

3. What is contained in the file after the following: cat file123 > file123?

4. What is contained in the file1 after the the command: echo file1 >> file1 is ran?

5. True or False. The command "sort any-file" displays the same thing as "sort < any-file"?

6. True or False. CTRL+D and CTRL+C do the same thing?

7. The command "sleep 50 &" does what?

8. Name two commands could you use to display the contents of a file in your display?

9. How would you stop the accidental overwriting of files?

10. How would you find where the command ls is located in the system file tree?

11. You create a script and wish to allow everyone to run execute it, what would you do?

12. How would you stop acceptance of the CTRL+D by the shell?

13. What command would display the 4th and 1st words from each line of a file.

14. What command would show what environmental variables are currently set to on or off.

15. What is the path to most utilities we have used including the"pwd" utility,?



16. Create a listing of all words that Linux knows of that contains the word "dog", and save it as dog_doodoo.

17. Create a file from dog_doodoo that only shows the words that contain the word "dogs" sorted in reverse order and saved as detros_sgod, which is dogs_sorted backwards.

18. Create a file called flat_cat that shows the count of all words that Linux knows of with the word cat in them.

19. Create a script called my_details containing your user name, login name, shell being used, and home directory.

20. Create a script that does the following called my_script
Displays everyone logged in
Pauses for 2 seconds
Displays a listing of the directory in long form
Pauses for 2 seconds
Displays today's date
Pauses for 1 second
Displays a calendar from Sept. 1752 only
Pauses for 2 seconds
Asks the user how they are doing today
Adds a line containing only Doug Peterson's (dpeterso) line from the password file
Displays Goodbye

Explanation / Answer

1. grep "dogs" pet-list

2. cat c.

3. It will be empty. Contents get erased.

4. The contents of file will be appended to the same file

5. True

6. False

7. create a background process which sleeps for 50 time duration

8. cat , less,more

9. By setting no clobber option by set -o noclobber

10. How would you find where the command ls is located in the system file tree?

11. You create a script and wish to allow everyone to run execute it, what would you do?

12.By setting IGNOREOFF

13. By cat filename | awk -F ' ' '{print $1 $4}'

14. set

15. find command gives the path

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote