SG2 Flashcards
4-File Management
Q: What command is used to create an empty file?
A: touch filename
4-File Management
Q: How do you copy a file?
A: cp source destination
4-File Management
Q: How do you move a file?
A: mv source destination
4-File Management
Q: What command removes a file?
A: rm filename
4-File Management
Q: How do you display the contents of a file?
A: Use cat, less, or more.
5-User Management
Q: How do you check your username?
A: whoami
5-User Management
Q: What command shows logged-in users?
A: who or w
5-User Management
Q: How do you switch users?
A: su username or sudo -i
5-User Management
Q: How do you change a user’s password?
A: passwd username
6-File Permissions & Ownership
Q: What does chmod 755 file do?
A: Grants the owner full permissions and gives read & execute permissions to others.
6-File Permissions & Ownership
Q: How do you change file ownership?
A: chown user:group filename
6-File Permissions & Ownership
Q: What does ls -l display?
A: Detailed file information, including permissions, owner, and size.