Reader Questions & Answers: 4 Super Easy Linux Fundamentals Exam Questions!

Hi, my name is JackTian.

Today, a reader sent me a private message to help me read a few basic exam questions. To be honest, this question is too simple. Simple things are decided to be done without complexity.

Without further ado, let's get to the point.


1. Check the file access permissions of the /etc/filesystems file. The current permissions of the /home/network/studentl file are rw- r- - r- -, change it to rwxrw - r- -. Set the permissions of the /opt/computer directory to 755.

ls -l /etc/filesystems | awk '{print $1}'
chmod 764 /home/network/studentl
chmod 755 /opt/computer

2. Create a user group named networks with a GID of 530, rename the networks user group to the teach user group, change the GID of the teacher user group to 506, and delete the teacher user group.

groupadd -g 530 networks
groupmod -n teach networks
groupmod -g 506 teacher
groupdel teacher

3. Create a user named Student, put the main directory in the /opt/ directory, specify the login shell as /sbin/nologin, and set the UID to 666. After the creation is completed, view the user information and change the user name of student to jack, then delete jack's user account and its home directory

useradd student -m -d /opt/student -s /sbin/nologin -u 666
grep student /etc/passwd
usermod -l jack student
userdel -r jack

4. Create a user subdirectory in the root directory, create user1, user2, and user3 subdirectories in this directory, and use the touch command to create test files in the corresponding directories. The test files are named user1.txt, user2.txt, user3.txt. Copy the /user/user1/user1.txt file to the /mnt directory and delete the /user/user3 subdirectory

mkdir -p /user/{
    
    user1,user2,user3}
touch /user/user1/user1.txt /user/user2/user2.txt /user/user3/user3.txt
mv /user/user1/user1.txt /mnt
rm -rf /user/user3

That's all for today;


Originality is not easy. If you think this article is useful to you, please like, comment or forward this article, because this will be my motivation to output more high-quality articles, thank you!

By the way, CSDN friends remember to give me a free follow! Just in case you get lost and can't find me next time.

See you next time!

Guess you like

Origin blog.csdn.net/jake_tian/article/details/117954123