Free OSCP Kali Linux Questions and Answers — Questions and Answers
Question 1: Which one provides details on the command
- rm
- su
- mkdir
- man (Correct answer)
Correct answer: man
The `man` command (short for 'manual') is used in Linux to display the manual pages for commands, utilities, and functions. It provides comprehensive documentation, including a description of the command, its syntax, options, and examples. This makes `man` an invaluable tool for users to understand how to effectively use various command-line tools and system functions.
Question 2: Which directory you are in can be determined
- pwd (Correct answer)
- man
- whoami
- --help
Correct answer: pwd
The `pwd` command (short for 'print working directory') is used in Linux to display the full path of the current directory you are in. This command is fundamental for navigating the file system and understanding your current location within the directory hierarchy. It helps users orient themselves and ensures commands are executed in the intended location.
Question 3: The associated file displays the secret file.
- Is -I
- Is
- Is -s
- Is -a (Correct answer)
Correct answer: Is -a
In Linux, files and directories that start with a dot (`.`) are considered 'hidden' by default and are not shown with a regular `ls` command. To display these hidden files, including the special `.` (current directory) and `..` (parent directory) entries, the `ls -a` command (short for 'all') must be used. This allows users to view all contents of a directory, regardless of their hidden status.
Question 4: Carl is looking to make a folder. What instruction should he issue?
- mkdir (Correct answer)
- Touch
- nano
- rmdir
Correct answer: mkdir
The `mkdir` command (short for 'make directory') is used in Linux to create new directories (folders) in the file system. Users specify the desired name for the new directory as an argument to the command, and it will be created in the current working directory unless a full path is provided. This is the standard and most direct instruction for creating folders.
Question 5: Mike wants to replicate his files, but he also doesn't want them to be overwritten. What instruction should he issue?
- cp -a
- cp
- cp -m
- cp -i (Correct answer)
Correct answer: cp -i
The `cp` command is used to copy files and directories. The `-i` option stands for 'interactive', which prompts the user for confirmation before overwriting an existing file. This ensures that Mike's files will not be overwritten without his explicit consent, fulfilling his requirement to replicate files without overwriting them.
Question 6: What commands can read the content of a file?
- Whoami
- Touch
- Sudo
- Cat (Correct answer)
Correct answer: Cat
The `cat` command (short for concatenate) is a standard Unix/Linux utility primarily used to display the content of files on the standard output. It can also be used to combine multiple files or create new ones. The other options like `whoami`, `touch`, and `sudo` serve different purposes, such as identifying the current user, creating empty files, or executing commands with elevated privileges, respectively.
Question 7: What procedure deletes a folder?
- rmdir (Correct answer)
- delete
- mkdir
- delete
Correct answer: rmdir
The `rmdir` command is specifically designed to remove empty directories (folders) in Unix-like operating systems. If a directory contains any files or subdirectories, `rmdir` will fail and report an error. To delete non-empty directories, a different command like `rm -r` is typically used.
Which one provides details on the command