โ† All ACSP Flashcard Decks

Command-Line Interface Flashcards

6 cards from real ACSP practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Command-Line Interface flashcards as text
  1. A technician needs to find all files ending with the `.log` extension within the `/Users/Shared/` directory that have been modified in the last 48 hours. Which of the following commands is the most precise way to accomplish this?

    Answer: find /Users/Shared/ -name "*.log" -mtime -2

    The `find` command is the standard utility for searching file hierarchies based on specific criteria. The path `/Users/Shared/` sets the starting point, `-name "*.log"` filters for files matching the log extension, and `-mtime -2` specifically selects files with a modification time of less than two 24-hour periods ago.

  2. In the command `ps aux | grep 'Final Cut Pro'`, what is the primary function of the pipe `|` character?

    Answer: It sends the standard output of the `ps aux` command to be used as the standard input for the `grep` command.

    The pipe `|` is a core shell feature used for chaining commands. It redirects the standard output (stdout) of the command on its left (`ps aux`) to become the standard input (stdin) for the command on its right (`grep 'Final Cut Pro'`). This allows the `grep` command to filter the process list generated by `ps`.

  3. A script named `backup.sh` needs to be run, but when the user tries `./backup.sh`, the shell returns a 'Permission denied' error. The output of `ls -l backup.sh` is `-rw-r--r--`. Which command will make the script executable for the file's owner only?

    Answer: chmod u+x backup.sh

    The `chmod` command modifies file permissions. The `u+x` syntax specifically adds (`+`) the execute (`x`) permission for the user (`u`) who owns the file. The original permissions `-rw-r--r--` were missing the 'x' bit for the owner, which is required to run the file as a program. `chmod 755` would also work but it would grant execute permissions to the group and others as well, which is more permissive than required.

  4. A support professional needs to generate a comprehensive report of a Mac's hardware, including details about memory, PCI cards, and attached USB devices, directly from the command line. Which utility is the command-line equivalent of the System Information app?

    Answer: system_profiler

    The `system_profiler` command is the command-line interface to the same information framework used by the graphical System Information application. It can be used to generate detailed reports on numerous hardware and software data types.

  5. To ensure a critical software update process is not interrupted, an administrator needs to prevent a Mac from sleeping for the duration of a single command. Which of the following is the BEST way to run `softwareupdate -iaR` while temporarily preventing system sleep?

    Answer: caffeinate softwareupdate -iaR

    The `caffeinate` command is designed to prevent sleep. When a command is passed as an argument to `caffeinate`, it creates a sleep assertion that remains active only for the life of that command's process. This is the most targeted and safest method, as sleep behavior returns to normal as soon as the command completes. Using `pmset` would change the system's settings persistently.

  6. A technician needs to view a live, continuous stream of all new system and application log messages as they are generated to diagnose an intermittent issue. Which command provides this real-time view into the macOS unified logging system?

    Answer: log stream

    The `log stream` command taps directly into the macOS unified logging system and displays messages from all subscribed processes in real-time as they are created. While `tail -f` was used for legacy log files, it does not work with the modern unified logging database. `log show` is used for querying historical logs, not for live streaming.