question 5.Which command would you type to view the detailed contents of a direc
ID: 3802218 • Letter: Q
Question
question 5.Which command would you type to view the detailed contents of a directory, including file permssions?
ls
ld -p
dir -a
ls -l
QUESTION 7-Which directory holds most of the system configuration files in Unix?
/root
/bin
/etc
/var
QUESTION 13
You asked your team to collect the serial numbers of all your equipment for insurance purposes. Unfortunately some members of the team visited the same rooms and you are certain that some of the lists they sent in contain the same serial numbers.
Assuming you have three text files of serial numbers named "serials-andy", "serials-mary", and "serials-pat", how would you remove all the duplicate serial numbers?
(You can verify your answer by creating three files with these names, puting some random numbers in them with some duplicates, and trying the commands)
cat serials-* | sort | uniq
sort serials* | uniq -d
uniq serials-* | sort
uniq serials-andy | uniq serials-mary | uniq serials-pat
QUESTION 17
Traditional Unix permissions can be assigned two which three categories of users?
a .r - The root user
u - Regular users
x - Exclude everyone
b .s - The system administrator
r - Regular users
w - The world, or everyone
c .u - The user that owns the file
g - A specific group of users
o - Other users, or everyone.
d .o - The owner of the file
p - The public
n - Nobody
QUESTION 18
You have a file named Homework with the following permissions:
-rw-r--r-- 1 fsmith staff 12 Feb 20 14:08 Homework
Which command would you type to make sure that you were the only one with permission to view the contents of the file? (permissions should look like this when done)
-rw------- 1 fsmith staff 12 Feb 20 14:08 Homework
chmod rwx Homework
chmod go-r Homework
chmod 777 Homework
chmod r-* Homework
QUESTION 19
You have finished your thesis, and want to set the permissions so that it is hard to accidentally delete or overwrite the file.
Normally, if you were to type "rm Thesis.txt", it would just delete it without asking. Or, if you moved a file with the same name into the same directory as your original Thesis.txt, it would overwrite it with the new version.
Which command would change the permissions for a file called Thesis.txt so that you are less likely to delete or overwrite it by accident?
a.chmod a+rwx Thesis.txt
chmod a-w Thesis.txt
chmod a+w Thesis.txt
chmod o-rwx Thesis.txt
a.ls
b.ld -p
c.dir -a
d .ls -l
Explanation / Answer
Answers:
(5). (d) ls -l
ls command is used to display the content inside the directory. And using -l option with it gives you the same details along with file permission details, whether it is a file or a directory, and other stuff. So, the answer is (d).
(7). (c) /etc
/etc directory in the unix file system is used to store its configuration files.
(13). (a) cat serials-* | sort | uniq
The best and easiest way is to do as per the hint given. I created the same way and the required output removing duplicates was generated in (a). In (a), the command cat serials-* first listing all the content of the files whose name start from serials. After getting the content, it is sorted and the result is given to uniq command to remove the duplicates.
(17). (c) u - The user that owns the file
g - A specific group of users
o - Other users, or everyone.
(18). (b) chmod go-r Homework
chmod command is used to change the file permissions. So, when we write go-r, it will remove all the permissions for read for all other users except the owner. So, the final permissions will be as per given in the question.
(19). (b) chmod a-w Thesis.txt
Here, you don't want to make sure it is not accidently overwritten or deleted because the file is so important.
So, to do this, a-w is used so that all the write permissions are removed as '-' is used. So no one will be able to delete it or modify it without write permission.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.