What single shell command will tell you the home directory, current user, and current history size?

Prepare for the Digital Forensics, Investigation, and Response Test. Study with multiple choice questions that include hints and explanations. Enhance your understanding of digital forensics principles and get ready for your exam!

Multiple Choice

What single shell command will tell you the home directory, current user, and current history size?

Explanation:
Think of the environment as the set of session-level variables a shell exposes. HOME stores the path of your home directory, USER holds your login name, and HISTSIZE (if exported) controls how many commands the shell keeps in history. The env command prints all exported environment variables, so it can show HOME and USER directly and, when present, HISTSIZE as well, giving you the home directory, the current user, and the history size in one shot. The other commands focus on a single piece of information: whoami shows just the user, pwd shows the current directory, and id shows user and group IDs, not the home path or history size.

Think of the environment as the set of session-level variables a shell exposes. HOME stores the path of your home directory, USER holds your login name, and HISTSIZE (if exported) controls how many commands the shell keeps in history. The env command prints all exported environment variables, so it can show HOME and USER directly and, when present, HISTSIZE as well, giving you the home directory, the current user, and the history size in one shot. The other commands focus on a single piece of information: whoami shows just the user, pwd shows the current directory, and id shows user and group IDs, not the home path or history size.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy