โ† All Linux Flashcard Decks

CompTIA Linux+ Linux GNU and Unix Commands Flashcards

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

Read the first 5 CompTIA Linux+ Linux GNU and Unix Commands flashcards as text
  1. Which of the following commands is used to display the current working directory in Linux?

    Answer: pwd

    The `pwd` command (print working directory) displays the full path of the current directory you are operating in. This is a fundamental command for navigating the file system, as it helps users understand their current location within the directory hierarchy. It ensures you know exactly where commands will be executed or files will be created.

  2. Which of the following commands is used to change the ownership of a file in Linux?

    Answer: chown

    The `chown` command (change owner) is used to change the user owner and/or group owner of files or directories in Linux. This command is crucial for managing file permissions and ensuring that the correct users or groups have administrative control over specific resources. Proper ownership is a key aspect of Linux security.

  3. Which command is used to view the contents of a text file, one page at a time?

    Answer: less

    The `less` command is used to view the contents of a text file, allowing users to scroll forward and backward through the file one page or line at a time. Unlike `cat`, `less` does not load the entire file into memory, making it efficient for large files. It also offers powerful search capabilities, making it a versatile tool for file inspection.

  4. Which of the following commands is used to search for a specific pattern in a file in Linux?

    Answer: grep

    The `grep` command (global regular expression print) is used to search for specific patterns of text within files. It can filter lines that match a given regular expression, making it an indispensable tool for log analysis, code searching, and data extraction. `grep` is highly versatile and widely used for text processing in Linux.

  5. What does the chmod command do in Linux?

    Answer: Changes file permissions

    The `chmod` command (change mode) is used to change the file permissions (read, write, execute) for the owner, group, and others on a Linux system. These permissions dictate who can access and modify files and directories. Correctly setting permissions with `chmod` is fundamental for system security and access control.