In: Computer Science
Please answer the following questions thank you!!
1) Assume file1.txt was created more recently than file2.txt. You can test this using which of the following conditions?
A) [ file1.txt –n file2.txt ]
B) [ file1.txt –nt file2.txt ]
C) [ file1.txt –ot file2.txt ]
D) [ -newer file1.txt file2.txt ]
E) None of these, there is no such test
2) We want to test to see if file1.txt is not readable. Which of these conditions will do so?
A) [[ -w file1.txt && -x file1.txt ]]
b) [[ -r != file1.txt ]]
c) [[ -r –ne file1.txt ]]
d) [ ! file1.txt ]
e) [ ! –r file1.txt ]
Question 1) Answer Option B
Reason: Option A is incorrect because it use '-n' gives you the number and not the date it was created on
Option B is correct because we use nt command in order to check if a file or directory is newer than the other.
Option C is incorrect because it will not display the newer file.
Option D is incorrect because newer it is used to find file within a specified time
Question 2) Answer Option C
Option A is incort because using this command we can check if a file is readible or writable.
Option B is incorrect because because it is not used to check if a file is readible
Option C is correct because using this command we if we read a file and is not equal to the text file.
Option D is incorrect because it does not have any command to check for readable access.
Option E is incorrect because it is not a command for checking the visibility of a file.
If you liked the solution then give a thumbs up ? it will be really appreciated ?