-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlevel1_questions.py
80 lines (80 loc) · 4.17 KB
/
level1_questions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
level1_questions = [
{
"question": "What command lists files in a directory?",
"options": ["ls", "cd", "pwd"],
"answer": "ls",
"explanation": "The 'ls' command is used to list directory contents. It can be used with various options like '-l' for long format, '-a' to show hidden files, or '-h' for human-readable file sizes."
},
{
"question": "How do you create a new directory?",
"options": ["mkdir", "rmdir", "touch"],
"answer": "mkdir",
"explanation": "The 'mkdir' command creates new directories. You can create multiple directories at once or use the '-p' option to create parent directories as needed."
},
{
"question": "Which command is used to change the current directory?",
"options": ["cd", "pwd", "mv"],
"answer": "cd",
"explanation": "The 'cd' (change directory) command is used to navigate the file system. You can use '..' to move up one directory or '/' to move to the root directory."
},
{
"question": "How do you display the current working directory?",
"options": ["pwd", "ls", "cd"],
"answer": "pwd",
"explanation": "The 'pwd' (print working directory) command shows the full path of the current directory you are in."
},
{
"question": "Which command is used to remove a file?",
"options": ["rm", "rmdir", "mv"],
"answer": "rm",
"explanation": "The 'rm' command is used to delete files. Use it with caution as it will permanently remove files."
},
{
"question": "How can you display the content of a file in the terminal?",
"options": ["cat", "ls", "rm"],
"answer": "cat",
"explanation": "The 'cat' command is used to display the contents of a file. It can also be used to concatenate multiple files and display their combined output."
},
{
"question": "Which command is used to copy files or directories?",
"options": ["cp", "mv", "rm"],
"answer": "cp",
"explanation": "The 'cp' command is used to copy files or directories from one location to another."
},
{
"question": "What command is used to move or rename files?",
"options": ["mv", "cp", "rm"],
"answer": "mv",
"explanation": "The 'mv' command is used to move files from one directory to another or to rename files. Unlike 'cp', it does not duplicate the file."
},
{
"question": "Which command is used to view the first few lines of a file?",
"options": ["head", "tail", "cat"],
"answer": "head",
"explanation": "The 'head' command is used to display the first few lines of a file. By default, it shows the first 10 lines, but you can customize the number with the '-n' option."
},
{
"question": "What command is used to view the last few lines of a file?",
"options": ["tail", "head", "grep"],
"answer": "tail",
"explanation": "The 'tail' command is used to display the last few lines of a file. By default, it shows the last 10 lines, but you can use the '-n' option to change the number of lines displayed."
},
{
"question": "How can you search for a specific pattern in a file?",
"options": ["grep", "find", "sed"],
"answer": "grep",
"explanation": "The 'grep' command is used to search for a specific pattern in a file or output. It supports regular expressions and various options for refining the search."
},
{
"question": "Which command is used to change file permissions?",
"options": ["chmod", "chown", "mv"],
"answer": "chmod",
"explanation": "The 'chmod' command is used to change the permissions of a file or directory. You can use symbolic or numeric modes to specify permissions for the owner, group, and others."
},
{
"question": "How do you display all currently running processes?",
"options": ["ps", "top", "kill"],
"answer": "ps",
"explanation": "The 'ps' command displays information about currently running processes. It can show a snapshot of current processes with options like '-e' for all processes and '-f' for a full-format listing."
}
]