Flashcards › Technology & Coding › Operating Systems

Linux and Terminal Commands

Command line basics for Linux, macOS and Unix-like systems.

86 cardsGrades 9–12, College, Adult#Linux#terminal#command line#bash

0 of 86 known
86 cards
  • lsCommand
    List files and folders
  • ls -lCommand
    List with details like size and permissions
  • ls -aCommand
    List all files including hidden ones
  • cd folderCommand
    Change into a folder
  • cd ..Command
    Go up one folder
  • cd ~ or cdCommand
    Go to your home folder
  • pwdCommand
    Print the current working directory
  • mkdir nameCommand
    Make a new folder
  • rmdir nameCommand
    Remove an empty folder
  • touch fileCommand
    Create an empty file or update its timestamp
  • cp a bCommand
    Copy a file
  • cp -r a bCommand
    Copy a folder and its contents
  • mv a bCommand
    Move or rename a file
  • rm fileCommand
    Delete a file (no undo)
  • rm -r folderCommand
    Delete a folder and contents (dangerous)
  • cat fileCommand
    Show a file's contents
  • less fileCommand
    View a file one page at a time
  • head fileCommand
    Show the first lines of a file
  • tail fileCommand
    Show the last lines of a file
  • tail -f fileCommand
    Follow a file as new lines are added
  • echo textCommand
    Print text
  • grep pattern fileCommand
    Search for text in a file
  • grep -r pattern .Command
    Search recursively through folders
  • find . -name 'x'Command
    Find files by name
  • wc -l fileCommand
    Count lines in a file
  • sort fileCommand
    Sort lines
  • uniqCommand
    Remove repeated adjacent lines
  • diff a bCommand
    Show differences between two files
  • chmodCommand
    Change file permissions
  • chmod +x fileCommand
    Make a file executable
  • chownCommand
    Change the owner of a file
  • sudoCommand
    Run a command with administrator privileges
  • suCommand
    Switch user
  • whoamiCommand
    Show the current user name
  • man commandCommand
    Show the manual for a command
  • --helpCommand
    Show brief help for a command
  • historyCommand
    Show previous commands
  • clearCommand
    Clear the terminal screen
  • Ctrl+CCommand
    Stop the running command
  • Ctrl+DCommand
    End input or log out
  • Ctrl+LCommand
    Clear the screen
  • Up arrowCommand
    Recall the previous command
  • Tab keyCommand
    Auto-complete a name
  • psCommand
    Show running processes
  • top or htopCommand
    Show live process and resource usage
  • kill PIDCommand
    Stop a process by its ID
  • df -hCommand
    Show disk space
  • du -sh folderCommand
    Show a folder's size
  • free -hCommand
    Show memory usage
  • uname -aCommand
    Show system information
  • dateCommand
    Show the date and time
  • ping hostCommand
    Test network reachability
  • curl urlCommand
    Transfer data from a URL
  • wget urlCommand
    Download a file
  • ssh user@hostCommand
    Log in to a remote machine securely
  • scpCommand
    Copy files securely between machines
  • tar -czf out.tar.gz folderCommand
    Create a compressed archive
  • tar -xzf file.tar.gzCommand
    Extract an archive
  • zip and unzipCommand
    Compress and extract zip files
  • apt install pkgCommand
    Install a package on Debian or Ubuntu
  • brew install pkgCommand
    Install a package on macOS with Homebrew
  • | (pipe)Command
    Send the output of one command into another
  • > (redirect)Command
    Write output to a file, replacing it
  • >> (append)Command
    Add output to the end of a file
  • < (input redirect)Command
    Use a file as input
  • && (and)Command
    Run the next command only if the first succeeds
  • & (background)Command
    Run a command in the background
  • * (wildcard)Command
    Matches any characters in filenames
  • ~ (tilde)Command
    Your home directory
  • . (dot)Command
    The current directory
  • .. (dot dot)Command
    The parent directory
  • / (root)Command
    The top of the file system
  • Absolute pathCommand
    A path starting from /
  • Relative pathCommand
    A path starting from the current folder
  • Environment variableCommand
    A named value available to programs, like PATH
  • PATHCommand
    A list of folders where the shell looks for commands
  • export VAR=valueCommand
    Set an environment variable
  • ShellCommand
    A program that reads your commands
  • bashCommand
    A popular shell
  • KernelCommand
    The core of an operating system
  • Linux creatorCommand
    Linus Torvalds, first released in 1991
  • TuxCommand
    The penguin mascot of Linux
  • Permissions rwxCommand
    Read, write and execute
  • Hidden fileCommand
    A file whose name begins with a dot
  • nanoCommand
    A simple text editor in the terminal
  • vimCommand
    A powerful text editor, famous for being hard to exit (:q)

Download this deck

Want paper cards? Paste the plain-text download into the flashcard maker.