If you are searching for a file that contains a particular K
If you are searching for a file that contains a particular KEYWORD use grep. -- If you are trying to find a file by name, size, date, owner, etc., then use find. UNLESS OTHERWISE SPECIFIED ASSUME YOUR CURRENT WORKING DIRECTORY IS ~. ------------------- 1. I have a file with the following permissions: -rwxrwxrwx 1 pc pc ....... budget.doc I want to change the permissions so that the file can only be read and written to by the file\'s owner and group. What command would make that change? Use OCTAL notation(5 points). 2. Use UGOA notation to change the following file\'s permission from this: -rwxrwxrwx 1 pc pc ....... budget.doc to this: -rw------- 1 pc pc ....... budget.doc (5 points) 3. User evanhalen was just fired, and I need to remove his account from my server and remove his home directory, but I also want to create a backup of all files in evanhalen\'s home directory and save that to my ~/backups directory. What SINGLE command would do this? (5 points) 4. Yikes! I just ran the following command: # sudo chmod 000 ./mydirectory Now I can\'t read the directory or cd into it! Show me a command that would allow the directory\'s owner to cd to the directory and list the contents for the owner of the directory ONLY! (5 points) 5. I run a server that currently has 50 users logged in. I am interested in finding out if user \'evanhalen\' has logged in, and if so, when he logged in. What command sequence would I use to show me the status for \'evanhalen\' ONLY -- no one else (Hint: one of the commands is grep) (5 points) 6. What command would I use to find out the office number for \'evanhalen\' (assuming the /etc/passwd file contains this information) (5 points) 7. I plugged in my USB thumbdrive in Linux and it doesn\'t appear to work. What command would I run to identify whether the kernel loaded a driver? (5 points) 8. What is /dev/sda17? (I want a detailed explanation of EACH component) (5 points). 9. I want to manually mount a thumb drive (/dev/sda17) that has an EXT2 (Linux) file system. I created a directory called \'my_linux\' on which to mount it. Specify the command to manually mount the thumb drive on the directory \'~/my_linux\'. (5 points) 10. I\'m finished with the thumb drive from Question 9 above. Specify the command to unmount the drive. (5 points) 11. I think a program might be running that\'s using a network connection. What command would I use to display all ESTABLISHED TCP and UDP connections along with the name of the program which established the connection? 12. What command would I use to find all regular files under ~ that contain the whole word \"Harumph\" at the end of a line? (5 points) 13. What command would I use to find all regular files under my home directory whose file size is less than 5 bytes, whose extension is .foo, and whose contents contains the whole word \'Linux\' (case insensitive). 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) 14. I have /dev/sdc3 mounted on /home/pc/my_linux. My present working directory is /home/pc/my_linux I type \'umount /home/pc/my_linux\' but I get an error message. Why? What can I do to alleviate the problem? I want both the reason and the soluton! (5 points) 15. I want to find out how much space my home directory and all subdirectories are currently using and I also want that output to be friendly meaning I want to see KB, MB, etc in place of bytes. (5 points) 16. I typed \'who\' from the command line and saw the following: evanhalen pts/11 2014-10-15 3:00 (mint18.local) What does all that mean? (Tell me what EACH column means! 5 points). 17. I have a file called \"backup.tgz\" which is owned by user evanhalen. I want to change the owner of that file to user avanhalen. What command would do this? (5 points) 18. I want to create a new user shagar. I want his home directory to be /home/sammy, and I want his user ID to be 666. What single command would do this? (5 points) 19. Regarding question 18 above, I want to modify shagar so his shell is /bin/csh. What command would do this? (5 points) 20. I want to allow shagar to be able to use \'sudo.\' Explain what you would do to allow this in Mint. (5 points)
Solution
1.chmod 660.budget.txt
2.chmod u-x,g-wx,o-wx budget.txt
3.\"Rm -rf
5. who | grep ptownshendor
w | grep ptownshend
6. grep ptownshend /etc/passwd
7. mount
8. dev - device directory
s – scsi
d – device
f = 6th device
7 - partition on the drive
9. sudo mount -t ntfs /dev/sdc3 ~/my_usb
10. sudo umount /dev/sdc3 or sudo umount ~/my_usb
15. du –c
16. ruff - userpts/13 - attach to the 13 terminal2014-10-15 13:00 -time and date stamp(mint17.local) – owner
17. sudo chown ggrant backup.tgz
19. sudo usermod -s /bin/dash krichards
20. sudo usermod -G krichards
