{
 "source": "https://peabody.kids/flashcards/tech-linux-commands",
 "id": "tech-linux-commands",
 "title": "Linux and Terminal Commands",
 "category": "technology",
 "subject": "Operating Systems",
 "levels": [
  "9-12",
  "college",
  "adult"
 ],
 "description": "Command line basics for Linux, macOS and Unix-like systems.",
 "tags": [
  "Linux",
  "terminal",
  "command line",
  "bash"
 ],
 "frontLabel": "Command",
 "backLabel": "What it does",
 "cards": [
  [
   "ls",
   "List files and folders"
  ],
  [
   "ls -l",
   "List with details like size and permissions"
  ],
  [
   "ls -a",
   "List all files including hidden ones"
  ],
  [
   "cd folder",
   "Change into a folder"
  ],
  [
   "cd ..",
   "Go up one folder"
  ],
  [
   "cd ~ or cd",
   "Go to your home folder"
  ],
  [
   "pwd",
   "Print the current working directory"
  ],
  [
   "mkdir name",
   "Make a new folder"
  ],
  [
   "rmdir name",
   "Remove an empty folder"
  ],
  [
   "touch file",
   "Create an empty file or update its timestamp"
  ],
  [
   "cp a b",
   "Copy a file"
  ],
  [
   "cp -r a b",
   "Copy a folder and its contents"
  ],
  [
   "mv a b",
   "Move or rename a file"
  ],
  [
   "rm file",
   "Delete a file (no undo)"
  ],
  [
   "rm -r folder",
   "Delete a folder and contents (dangerous)"
  ],
  [
   "cat file",
   "Show a file's contents"
  ],
  [
   "less file",
   "View a file one page at a time"
  ],
  [
   "head file",
   "Show the first lines of a file"
  ],
  [
   "tail file",
   "Show the last lines of a file"
  ],
  [
   "tail -f file",
   "Follow a file as new lines are added"
  ],
  [
   "echo text",
   "Print text"
  ],
  [
   "grep pattern file",
   "Search for text in a file"
  ],
  [
   "grep -r pattern .",
   "Search recursively through folders"
  ],
  [
   "find . -name 'x'",
   "Find files by name"
  ],
  [
   "wc -l file",
   "Count lines in a file"
  ],
  [
   "sort file",
   "Sort lines"
  ],
  [
   "uniq",
   "Remove repeated adjacent lines"
  ],
  [
   "diff a b",
   "Show differences between two files"
  ],
  [
   "chmod",
   "Change file permissions"
  ],
  [
   "chmod +x file",
   "Make a file executable"
  ],
  [
   "chown",
   "Change the owner of a file"
  ],
  [
   "sudo",
   "Run a command with administrator privileges"
  ],
  [
   "su",
   "Switch user"
  ],
  [
   "whoami",
   "Show the current user name"
  ],
  [
   "man command",
   "Show the manual for a command"
  ],
  [
   "--help",
   "Show brief help for a command"
  ],
  [
   "history",
   "Show previous commands"
  ],
  [
   "clear",
   "Clear the terminal screen"
  ],
  [
   "Ctrl+C",
   "Stop the running command"
  ],
  [
   "Ctrl+D",
   "End input or log out"
  ],
  [
   "Ctrl+L",
   "Clear the screen"
  ],
  [
   "Up arrow",
   "Recall the previous command"
  ],
  [
   "Tab key",
   "Auto-complete a name"
  ],
  [
   "ps",
   "Show running processes"
  ],
  [
   "top or htop",
   "Show live process and resource usage"
  ],
  [
   "kill PID",
   "Stop a process by its ID"
  ],
  [
   "df -h",
   "Show disk space"
  ],
  [
   "du -sh folder",
   "Show a folder's size"
  ],
  [
   "free -h",
   "Show memory usage"
  ],
  [
   "uname -a",
   "Show system information"
  ],
  [
   "date",
   "Show the date and time"
  ],
  [
   "ping host",
   "Test network reachability"
  ],
  [
   "curl url",
   "Transfer data from a URL"
  ],
  [
   "wget url",
   "Download a file"
  ],
  [
   "ssh user@host",
   "Log in to a remote machine securely"
  ],
  [
   "scp",
   "Copy files securely between machines"
  ],
  [
   "tar -czf out.tar.gz folder",
   "Create a compressed archive"
  ],
  [
   "tar -xzf file.tar.gz",
   "Extract an archive"
  ],
  [
   "zip and unzip",
   "Compress and extract zip files"
  ],
  [
   "apt install pkg",
   "Install a package on Debian or Ubuntu"
  ],
  [
   "brew install pkg",
   "Install a package on macOS with Homebrew"
  ],
  [
   "| (pipe)",
   "Send the output of one command into another"
  ],
  [
   "> (redirect)",
   "Write output to a file, replacing it"
  ],
  [
   ">> (append)",
   "Add output to the end of a file"
  ],
  [
   "< (input redirect)",
   "Use a file as input"
  ],
  [
   "&& (and)",
   "Run the next command only if the first succeeds"
  ],
  [
   "& (background)",
   "Run a command in the background"
  ],
  [
   "* (wildcard)",
   "Matches any characters in filenames"
  ],
  [
   "~ (tilde)",
   "Your home directory"
  ],
  [
   ". (dot)",
   "The current directory"
  ],
  [
   ".. (dot dot)",
   "The parent directory"
  ],
  [
   "/ (root)",
   "The top of the file system"
  ],
  [
   "Absolute path",
   "A path starting from /"
  ],
  [
   "Relative path",
   "A path starting from the current folder"
  ],
  [
   "Environment variable",
   "A named value available to programs, like PATH"
  ],
  [
   "PATH",
   "A list of folders where the shell looks for commands"
  ],
  [
   "export VAR=value",
   "Set an environment variable"
  ],
  [
   "Shell",
   "A program that reads your commands"
  ],
  [
   "bash",
   "A popular shell"
  ],
  [
   "Kernel",
   "The core of an operating system"
  ],
  [
   "Linux creator",
   "Linus Torvalds, first released in 1991"
  ],
  [
   "Tux",
   "The penguin mascot of Linux"
  ],
  [
   "Permissions rwx",
   "Read, write and execute"
  ],
  [
   "Hidden file",
   "A file whose name begins with a dot"
  ],
  [
   "nano",
   "A simple text editor in the terminal"
  ],
  [
   "vim",
   "A powerful text editor, famous for being hard to exit (:q)"
  ]
 ]
}
