Flashcards › Technology & Coding › Operating Systems
Linux and Terminal Commands
Command line basics for Linux, macOS and Unix-like systems.
0 of 86 known
86 cards
- lsCommandList files and folders
- ls -lCommandList with details like size and permissions
- ls -aCommandList all files including hidden ones
- cd folderCommandChange into a folder
- cd ..CommandGo up one folder
- cd ~ or cdCommandGo to your home folder
- pwdCommandPrint the current working directory
- mkdir nameCommandMake a new folder
- rmdir nameCommandRemove an empty folder
- touch fileCommandCreate an empty file or update its timestamp
- cp a bCommandCopy a file
- cp -r a bCommandCopy a folder and its contents
- mv a bCommandMove or rename a file
- rm fileCommandDelete a file (no undo)
- rm -r folderCommandDelete a folder and contents (dangerous)
- cat fileCommandShow a file's contents
- less fileCommandView a file one page at a time
- head fileCommandShow the first lines of a file
- tail fileCommandShow the last lines of a file
- tail -f fileCommandFollow a file as new lines are added
- echo textCommandPrint text
- grep pattern fileCommandSearch for text in a file
- grep -r pattern .CommandSearch recursively through folders
- find . -name 'x'CommandFind files by name
- wc -l fileCommandCount lines in a file
- sort fileCommandSort lines
- uniqCommandRemove repeated adjacent lines
- diff a bCommandShow differences between two files
- chmodCommandChange file permissions
- chmod +x fileCommandMake a file executable
- chownCommandChange the owner of a file
- sudoCommandRun a command with administrator privileges
- suCommandSwitch user
- whoamiCommandShow the current user name
- man commandCommandShow the manual for a command
- --helpCommandShow brief help for a command
- historyCommandShow previous commands
- clearCommandClear the terminal screen
- Ctrl+CCommandStop the running command
- Ctrl+DCommandEnd input or log out
- Ctrl+LCommandClear the screen
- Up arrowCommandRecall the previous command
- Tab keyCommandAuto-complete a name
- psCommandShow running processes
- top or htopCommandShow live process and resource usage
- kill PIDCommandStop a process by its ID
- df -hCommandShow disk space
- du -sh folderCommandShow a folder's size
- free -hCommandShow memory usage
- uname -aCommandShow system information
- dateCommandShow the date and time
- ping hostCommandTest network reachability
- curl urlCommandTransfer data from a URL
- wget urlCommandDownload a file
- ssh user@hostCommandLog in to a remote machine securely
- scpCommandCopy files securely between machines
- tar -czf out.tar.gz folderCommandCreate a compressed archive
- tar -xzf file.tar.gzCommandExtract an archive
- zip and unzipCommandCompress and extract zip files
- apt install pkgCommandInstall a package on Debian or Ubuntu
- brew install pkgCommandInstall a package on macOS with Homebrew
- | (pipe)CommandSend the output of one command into another
- > (redirect)CommandWrite output to a file, replacing it
- >> (append)CommandAdd output to the end of a file
- < (input redirect)CommandUse a file as input
- && (and)CommandRun the next command only if the first succeeds
- & (background)CommandRun a command in the background
- * (wildcard)CommandMatches any characters in filenames
- ~ (tilde)CommandYour home directory
- . (dot)CommandThe current directory
- .. (dot dot)CommandThe parent directory
- / (root)CommandThe top of the file system
- Absolute pathCommandA path starting from /
- Relative pathCommandA path starting from the current folder
- Environment variableCommandA named value available to programs, like PATH
- PATHCommandA list of folders where the shell looks for commands
- export VAR=valueCommandSet an environment variable
- ShellCommandA program that reads your commands
- bashCommandA popular shell
- KernelCommandThe core of an operating system
- Linux creatorCommandLinus Torvalds, first released in 1991
- TuxCommandThe penguin mascot of Linux
- Permissions rwxCommandRead, write and execute
- Hidden fileCommandA file whose name begins with a dot
- nanoCommandA simple text editor in the terminal
- vimCommandA powerful text editor, famous for being hard to exit (:q)
Download this deck
- CSVExcel, Google Sheets, Numbers
- Anki / Quizlet (tab-separated)Import straight into Anki or Quizlet
- JSONFor programmers and apps
- Plain textOne card a line, “front : back”, ready for Peabody's flashcard maker to print
Want paper cards? Paste the plain-text download into the flashcard maker.