Linux test Flashcards
(98 cards)
What command lists the contents of a directory in long format?
ls -l
How do you search for a string in files within a directory?
grep -r
What command displays the amount of disk space used and available on mounted filesystems?
df -h
How do you show all currently running processes on a system?
ps aux
What is the command to create a new directory?
mkdir
How do you check the last 10 lines of a file?
tail
What command changes file permissions?
chmod
How do you switch to the root user account?
sudo su or su -
What command displays the kernel version?
uname -r
How do you copy a file from one location to another?
cp
How do you create a new user on a Linux system?
sudo useradd
How do you set or change a user’s password?
sudo passwd
What command lists all users currently logged into the system?
who
How do you display information about a specific user?
id
What is the command to modify a user’s properties such as their home directory or shell?
sudo usermod
How do you delete a user and their home directory?
sudo userdel -r
How do you lock a user account?
sudo usermod -L
What file contains the list of users and their home directories?
/etc/passwd
How do you add a user to a group?
sudo usermod -aG
How do you check which groups a user belongs to?
groups
What command displays real-time system processes and their resource usage?
top
How do you kill a process by its PID?
kill
What command sends a kill signal to all processes with a given name?
pkill
How do you view the process tree?
pstree