Linux Cases
Linux Cases
• LS -A: Show you all the les including the hidden les
• TOUCH: Used to create a le but you should add the le extension .txt
• Chmod : how to manage your permissions through terminal (Owner/ Groups / Users)
0 : No permission
1: Execute Permission
2: Write Permission
3: Write and Execute
4: Read Permission
5: Read and Execute Permission
6: Read and Write Permission
7: Read, Write, and Execute Permission
1
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
• Chown : change the owner of a le.
2
ff
fi
fi
fi
fi
fi
fi
Case 1:-
Your are working with open source company and they are using linux environment
and you need to do the following, creating 3 les, the rst le name is Ahmed, next
one is Muhammad, and the last one is Omar, and after creating the les make a
copy of each one and put Omar and Ahmed in a Folder names A, then Omar and
Muhammad in a folder names B, then Ahmed and Muhammad in a folder names C,
after that delete the les in folder A, then delete the folder itself, then check your
location, after checking your location search for the le Omar, nally delete all
folders, then clear the terminal screen.
3
fi
fi
fi
fi
fi
fi
fi
Case 2:-
Assume you are working on Google and they are working on open source
operating system, and your manager assigned for you the following task to be
applied through terminal but he advised you to work on a simple editor to help
you.
The task is creating a folder name special task, and including this folder create 4
folders, open the folder-1 and create 3 les, then go back to folder-2 and create 2
les, and add “Hello” as a massage in both les, then copy one of these les to
folder 3, and move the other le to folder 4, then delete the folder 3 and folder 2,
after that ensure that the folder deleted and not hidden then he asked you to
search for him for a le called “August”.
Finally, he told you a short story about his college and his old friend, and he told
him the command TAR but he forgot the role of tar and asked you to search about
it, then clear the terminal.
Step 1: Nano
Step 2: MKDIR
Step 3: CD
Step 4: MKDIR
Step 5: CD
Step 6: Touch
Step 7: CD..
Step 8: CD
Step 9: Touch
Step 10: ECHO
Step 11: CP
Step 12: MV
Step 13: CD..
Step 14: RM
Step 15: LS-A
Step 16: Locate
Step 17: MAN
Step 18: Clear
4
fi
fi
fi
fi
fi
fi
Case-3
Assume you are working on Google and they are working on open source
operating system, and your manager assigned for you the following task to be
applied through terminal but he advised you to work to check all the previous
history of anyone used the computer, then check all the running processes and
stop all to submit your task.
The task is download the zipped le of employees salaries from internet and set
yourself as a an owner of the le. then make a copy of it and make the manager is
the owner. Then give the permission for everyone to read the rst le but only you
and the manager can run read, execute, and write. And give no permission to
everyone for the second le expect you to have all the permission. After that
compare the size of two les, then check the computer storage in human
language, also check the storage while ignoring the systems les, then after 3
hours check your memory usage, to avoid losing your saved data, after that
change the name of clear command to cls.
Finally, he told you to change your password, and exit the terminal.
Step1: History
Step2: PS
Step3: Kill
Step4: Curl
Step5: Unzip
Step6: Chown
Step7: CP
Step8: Chown
Step9: Chmod 774
Step10: Chmod 070
Step11: Di
Step12: Df-h
Step13: Df-x
Step14: Free
Step15: Alias Clear = Cls
Step16: Passwd
Step17: Exit
5
ff
fi
fi
fi
fi
fi
fi
fi