Linux Commands Quiz
30 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does the command 'git clone' perform?

  • Changes ownership of files in a directory.
  • Displays information about active processes.
  • Copies a repository from a remote source to local. (correct)
  • Copies a repository from local to remote server.
  • Which command would you use to schedule a command to run at a specific time?

  • at (correct)
  • top
  • export
  • killall
  • What is the purpose of the 'gzip' command?

  • Uncompresses files created by 'compress'.
  • Creates a bit-by-bit copy of a storage device.
  • Compresses files into a .gz format. (correct)
  • Changes the permissions of files and directories.
  • What does the command 'kill' require to function properly?

    <p>The process ID (PID) of the target process.</p> Signup and view all the answers

    Which command is specifically for managing log files?

    <p>logrotate</p> Signup and view all the answers

    What information does 'ifconfig' provide?

    <p>Active network interfaces and their statistics.</p> Signup and view all the answers

    What does the command 'renice' modify?

    <p>The priority of a running process.</p> Signup and view all the answers

    Which command would you use to check for errors on a storage device?

    <p>fsck</p> Signup and view all the answers

    Which command lets you view all environment variables?

    <p>set</p> Signup and view all the answers

    What is the function of the 'mount' command?

    <p>To make a storage device accessible to the system.</p> Signup and view all the answers

    What is the primary function of the command 'modprobe'?

    <p>Adds or removes modules from the running Linux kernel</p> Signup and view all the answers

    Which command would you use to scan for and manage Bluetooth devices?

    <p>hcitool</p> Signup and view all the answers

    What does the 'crontab' command allow you to do?

    <p>Schedule tasks to run at specified times</p> Signup and view all the answers

    Which command can you use to print kernel messages stored in the kernel ring buffer?

    <p>dmesg</p> Signup and view all the answers

    The 'uname' command, when used with the -a option, provides what type of information?

    <p>Comprehensive system information</p> Signup and view all the answers

    What is the effect of using the 'update-rc.d' command?

    <p>Manages system startup scripts for automatic service launching</p> Signup and view all the answers

    Which command would you use to examine and modify Linux kernel parameters during runtime?

    <p>sysctl</p> Signup and view all the answers

    Which command is intended for viewing or editing the list of currently loaded kernel modules?

    <p>lsmod</p> Signup and view all the answers

    What is the purpose of the 'l2ping' command in Linux?

    <p>Testing network connectivity at the link layer</p> Signup and view all the answers

    Which command would be used for a graphical interface to manage system startup services?

    <p>rcconf</p> Signup and view all the answers

    Which command is used to delete files and directories, including all contents within them?

    <p>rm</p> Signup and view all the answers

    What does the 'grep' command primarily do in a Linux environment?

    <p>Filters and displays specific lines in a file</p> Signup and view all the answers

    Which command would you use to view the documentation or help files of other Linux commands?

    <p>man</p> Signup and view all the answers

    How can you list all files in a directory, including hidden ones?

    <p>ls -a</p> Signup and view all the answers

    If you want to view the first 20 lines of a file named 'example.txt', which command would you use?

    <p>head -20 example.txt</p> Signup and view all the answers

    Which command is utilized to change directories in the terminal?

    <p>cd</p> Signup and view all the answers

    What does the 'pwd' command return when executed in the terminal?

    <p>The present working directory</p> Signup and view all the answers

    Which command will create a new directory named 'Projects'?

    <p>mkdir Projects</p> Signup and view all the answers

    What is the function of the 'tail' command in Linux?

    <p>To display the last few lines of a file</p> Signup and view all the answers

    What does the 'apt-get install' command achieve?

    <p>Downloads and installs software packages</p> Signup and view all the answers

    Study Notes

    Linux Commands

    • pwd: Displays the current working directory. Example: /home/user
    • whoami: Returns the currently logged-in user.
    • cd: Changes the directory from the terminal.
    • ls: Lists the contents of a directory. -1 for more info; -a to show hidden files.
    • aircrack-ng --help: Displays help for the aircrack-ng wireless cracking tool.
    • man: Provides documentation (man pages) about Linux commands.
    • locate: Searches the file system for files or directories.
    • find: Similar to locate but more focused, allows advanced search parameters and wildcards.
    • ps: Displays all running processes. aux switch displays process info.
    • cat: Creates new files. > redirects input, >> appends to a file.
    • mkdir: Creates new directories.
    • cp: Copies files.
    • mv: Moves and renames files.
    • rm: Removes files and directories. -r removes directories and all contents.
    • head: Displays the first 10 lines of a file. -n option to change number of lines.
    • tail: Displays the last 10 lines of a file. -n option to change number of lines.
    • nl: Displays file content with line numbers.
    • grep: Filters and displays lines containing a specific pattern or keyword.
    • more: Displays a file one page at a time. Press ENTER to advance, q to quit.
    • less: Similar to more, allows scrolling up and down, and searching.
    • apt-cache search: Searches package lists for software packages.
    • apt-get install: Downloads and installs software packages from repositories.
    • git clone: Copies a repository from a remote source (like GitHub) to your local system.
    • chmod: Changes file and directory permissions.
    • chown: Changes ownership of files and directories.
    • top: Displays dynamically updating info about active processes and system resource usage.
    • kill: Terminates or stops a process using its PID.
    • killall: Terminates all processes with a given name.
    • renice: Modifies the priority of a running process.
    • at: Schedules commands to be executed at a specific time.
    • env: Displays default environment variables.
    • set: Displays all environment variables.
    • export: Makes an environment variable available to other programs.
    • gzip: Compresses files.
    • gunzip: Uncompresses .gz files.
    • bzip2: Compresses files creating a .bz2 archive.
    • bunzip2: Uncompresses .bz2 files.
    • compress: Compresses files.
    • uncompress: Uncompresses files compressed with compress.
    • dd: Creates bit-by-bit copies of storage devices, for data recovery.
    • fdisk: Lists partitions on connected drives. -1 to list all partitions.
    • lsblk: Lists block devices (hard drives, partitions, removable media).
    • mount: Mounts a storage device (like a USB drive).
    • umount: Unmounts a storage device.
    • df: Displays disk space available.
    • fsck: Checks for errors on a storage device.
    • logrotate: Manages log files.
    • service: Starts, stops, or restarts services.
    • mysql: Logs into the MySQL database.
    • ifconfig: Shows active network interfaces, IP addresses, MAC addresses, network stats.
    • iwconfig: Similar to ifconfig, but for wireless networks.
    • iwlist: Scans for available wireless networks, displays info like SSID, signal strength, channel.
    • nmcli: Command-line interface for managing network connections.
    • hcitool: Tool for interacting with the Bluetooth stack, scanning devices etc.
    • 12ping: Sends Layer 2 pings to test network connectivity.
    • uname: Displays system information, including the kernel version. -a for details.
    • lsmod: Lists currently loaded kernel modules.
    • modprobe: Adds or removes modules from the running Linux kernel.
    • sysctl: Modifies kernel parameters at runtime.
    • dmesg: Prints or controls the kernel ring buffer, storing kernel messages.
    • crontab: Edits the cron table, for scheduling tasks.
    • update-rc.d: Manages system startup scripts.
    • rcconf: GUI-based tool to update rc.d scripts, manages services that start at boot.

    Important Notes

    • --help or -h can often display usage instructions for a specific command
    • man command provides detailed information for most commands.
    • Many commands accept options/switches that modify their behavior (-a, -1, -r, -n).
    • The > and >> symbols are used to redirect input to files, the > overwrites the file and >> appends to the file.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Linux Commands PDF

    Description

    Test your knowledge of essential Linux commands with this quiz. From managing files to navigating directories, this quiz covers a range of commands that every Linux user should know. Perfect for beginners and those looking to refresh their command-line skills.

    More Like This

    Comandos Linux y línea de comandos
    22 questions
    Linux Command Line Basics
    5 questions
    Linux Commands Quiz
    48 questions

    Linux Commands Quiz

    DeftStrontium avatar
    DeftStrontium
    Use Quizgecko on...
    Browser
    Browser