linux.fa23.assignment.3

txt

School

Daytona State College *

*We aren’t endorsed by this school

Course

CTS3348

Subject

Computer Science

Date

Feb 20, 2024

Type

txt

Pages

4

Uploaded by OrchidKing89

Report
You should immediately save this document as: yourFirstName.yourLastName.3.txt. Note: There are two deliverables for this assignment. Refer to the end of this document after the questions for instructions on the second deliverable. Note that without this second assignment deliverable, 20-points will be removed (1-point per question). You should answer all of the questions for this assignment by typing the answers in the spaces provided below the question. DO NOT USE A WORD PROCESSOR. Use a text editor like Notepad or gedit. A word Processor can alter your input and change a correct answer to something which no longer works. Below are questions related to the command line use of Linux. You can use the videos, book, man pages, and notes to answer these questions. Remember that Linux is CASE SENSITIVE. LS and ls are NOT the same command and I will count off for a question if you do not take this into account. Futhermore, a file or directory called "test" and "Test" are not the same. For each command, give me the ENTIRE COMMAND (command with any options and arugments) necessary to complete the task. If I ask you 'What command would I use to create a listing of files in ~/var/log?' The answer is not just 'ls'. This is only part of the full command. If you're unsure, a good rule of thumb is this: you should be able to enter your provided answer verbatim in to the terminal, hit Enter, and the task asked about is completed. **** All of these questions can be answered by viewing the videos, book, and the man pages. You will do well if you have followed along in Linux and tried the command along the way while watching the videos and reading the textbook. Practice makes perfect! ********* Unless otherwise specified assume your current working directory is ~. If you attempt an answer which changes your working directory, you can always use 'cd ~' to return to your home directory. Make sure to check your work! What's the correct answer? The one that works even if it may not have been the way I originally had in mind. There are 100 possible points. --No late assignments accepted-- ------------------- 1. I have a file with the following permissions: -rw-r--r-- 1 patrick patrick ....... batman.txt I want to change the permissions so that the file can be read and written to by the file's owner and group ONLY. What command would make that change? USE OCTAL
NOTATION ONLY (5 points). 2. Use UGOA notation to change the following file's permission from this: -rw-rw---- 1 patrick patrick ....... batman.txt to this: -rwxr--r-- 1 patrick patrick ....... batman.txt USE UGAO NOTATION ONLY - DO NOT USE OCTAL (5 points) 3. User rswanson has quit to pursue carpentry and I need to not only remove his account from my server, but backup the user's home directory AND then delete all files which were owned by the user. What SINGLE command would do this? Yes, this can be done using only one command. (5 points) (Hint: There are two commands which can create users and they have differing options. If you don't see the appropriate options in the man page to accomplish this task, check the other command) 4. Whoops! I just ran the following command: # sudo chmod 000 ~/Documents/FallFun/sep Now I can't read the directory or cd into it! Show me a command that would allow the directory's owner and group, and only the directory's owner and group - to cd to the directory and list the content. (5 points) 5. I run a server that currently has 50 users logged in. I am interested in finding out if user 'picard' has logged in, and if so, when they logged in. What command sequence would I use to show me the status for 'picard' ONLY -- no one else (Hint: There is a way to do this without pipe. If you use a command and pipe, one of the other commands you'll need is grep) (5 points) 6. I created a file SOMEWHERE on my hard drive. I don't recall the location, but I know the file name contains the word "porg". Note that I said "the file name contains" and not "the file contains". That's an important distinction. What command would I run to find that file? (5 points) 7. I have two files: bigger.txt and ontheinside.txt. I want to concatenate these files to a single file called tardis.txt. What command would I use? (5 points) 8. What is /dev/sdc2? (I want a detailed explanation of EACH component) (5 points). 9. I want to manually mount a thumb drive (/dev/sdb1) that has an NTFS (Windows) file system. I created a directory called 'evidence' on which to mount. Specify the command to manually mount the thumb drive on the directory '~/evidence'. Note: I don't want to see the word 'auto' as part of the answer. (5 points)
10. I have /dev/sdb1 mounted on ~/evidence. My current working directory is ~/evidence. When I try to unmount the device, I recieve this error message: /home/patrick/evidence: target is busy Why is this ocurring and what can we do to alleviate the problem? (The answer here should be words) (5 points) 11. We've identified the problem and I'm finished with the thumb drive from Questions 9 and 10. Now specify the command to unmount the drive. (5 points) 12. I think a program might be running that's using a network connection. What command would I use to display all listening and non-listening socks, of both TCP and UDP, and including the PID of the program/process associated with any connections? (Hint: Make sure to check the command output so you know the results are complete) (5 points) 13. What command would I use to find all files under ~ (the user's home directory) that contain the whole word "batman" at the end of a line only? (5 points) 14. What command would I use to find all regular files under the ~/Documents directory with file sizes less than 2MB, file names ending in .txt, and content which contains the whole word 'Penguin' (case sensitive). Make sure to print out the file's name that contains the keyword! (Hint: you will use grep as one of the commands). (5 points) 15. I want to find out how much space the /home directory and all subdirectories are currently using and I also want that output to be human friendly meaning I want to see these sizes in KB, MB, etc, when applicable. What full command will do this task? (5 points) 16. I typed 'who' from the command line and saw the following: bradmajors tty/1 2023-10-25 15:00 (mint21.local) What does all that mean? (Tell me what EACH component means! 5 points). 17. I have a file called "SugoLogs.tar" (Because you made it in assignment 2, right? Right!) which is owned by my user. I want to change the owner of that file to user 'gob' and the group to 'bluth'. What command would do this? (5 points) 18. I want to create a new user jharkness. I want his home directory to be /home/jack, I want his user ID to be 314, and I want his shell to be /bin/dash. What single command would do this? (5 points) 19. Regarding question 18 above, I want to modify the jharkness account so the shell used is /bin/bash. What command would do this? (5 points) 20. I want to allow jharkness to be able to use 'sudo.' Explain what you would do
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
to allow this in Mint. There should be words here as an answer not just a command. (5 points) Second Assignment Deliverable: Note: You will submit your answers document *and* the file which results by following the below procedure. Without this second assignment deliverable, 20- points will be removed (1-point per question). For the second assignment deliverable, we're going to create and submit a copy of a Linux system file. Not only is this a required assignment deliverable, but it will help me at times to provide better feedback should there be an error when running a command from an answer. Important: If you are using a Linux distrobution other than Mint/Ubuntu like Kali, CentOS, etc, you will need to email me so that I can give you modified directions for your particular environment. Steps to create the second assignment deliverable: 1. All questions have been answered or you are otherwise done working and ready to submit. 2. Close the terminal 3. Open again the terminal. This is important because we need to first close to terminal so that it can finish some operations in the background. 4. Run the command "cp ~/.bash_history ~/Desktop/yourLastName.bash.3.txt" without quotation marks and replacing yourLastName with your last name. This will produce a file on your Linux desktop called yourLastName.bash.3.txt (Vilkinofsky.bash.3.txt for me) 5. Either copy the file off the VM to submit or you can open the web browser in the VM, navigate to our class, and submit the yourLastName.bash.txt file directly to the assignment box