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

Using Linux 1.Access Control Lists (ACL) offer a more advanced way to manage per

ID: 3799896 • Letter: U

Question

Using Linux

1.Access Control Lists (ACL) offer a more advanced way to manage permissions than the basic rwx. In the assignment you used them via the getfacl and setfacl commands. Explain what ACL can do that goes beyond basic Linux permissions.

2.Bibidi wants to find a file that she used in one of her projects. She does not remember in which project it was, but she knows that it's a small file that contained the word algorithm and had the .jar extension. Additionally, all her projects are in her home Project folder, and the file she wants was a library that's normally located within the lib folder of a project (no subfolder). How can

3.Bibidi efficiently find her file? Be detailed.        

a)           The accountant created a folder in which he saved taxes as Tax.xls. Later, he wrote another file also named Tax.xls and moved it into the same folder. Months later, he realizes that he needs to use the tax file that was initially in the folder. What is the problem?

b)            The IT person says that he may have created hard links to the initial Tax.xls file. Why would

that make a difference?

Write a script moveIfNotFull that will move a file into a directory only if that directory contains

less than X files, where X is given as argument. For example, if we write

./moveIfNotFull.sh bad.log ./tmp 10

and ./tmp has already 10 files or more, then bad.log should not be moved. Ensure that 3 arguments are provided, and that both the file and directory do exist.

4.Write a script isItHere.sh that takes as argument a filename. It shows "yes" if the file is in the current folder, and "no" otherwise

Explanation / Answer

1. I am explaining with the example.
  

Let us take 1. Team of players
2. Alice and George
  
Now break the permissions on file /home/loc/chegg.txt.

member : : r--
Team : : r--
other : : ---

See wo will win the file and which team with acl

# captain : uday
# Team : Members
  
we get
member : Alice:rw-
member : John :rwx
team : members : rwx
Above shows that member Alice has rw , john has rwx. and team has rwx like John?
The permissions like if member colomun has 1s-1 o/p.(ACL'S)
  
MASK:
mask:rwx
The team members will have this:
member :Alice : rw-
member :John : rwx
effective permissions of them are
member:Alice:rw- #effective:r--
member: John: rwx #effective:r-x

If an access deny occurs in acl it is not possible to give permission.This is why acl is beyond basic linuc permissions.

2.Bibidi can find the file by following commands
find . -type f ( -iname "*.jar" ) -exec grep -iR 'algorithm' {} +

In the above command find will look for ".jar" extension and grep will look for " algorithm" string which can leads finding the exact file.

3a. No os can support multiple files with same name in same folder unless we create hard links.If we try to store the os will prompt "already file with same name contains should rewrite the file".If os accepts means ambiquity comes so many os doesnt support.

3b. Hard link is the additional name to a file.If any changes are made to a hard link created, then these changes will also be visible when the file is opened by an alternative name.so there will be no problem to the files which we create hard link

4.Here im writing the script in two ways:
//first way
if [ -s /home/loc/chegg.txt ]
then
echo "yes"
else
echo "no"
fi
//second way:
FILE="chegg.txt" #here we directly give the file name

if [ -f "$FILE" ]; # in folder f it will check the existene
then
echo "yes"
else
echo "no"
fi

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