terminal bash 1 Flashcards
(30 cards)
The macOS Terminal is a
command-line interface.
In CLI, the left-hand side displays the _, while the right-hand side shows the _ where _.
In CLI, the left-hand side displays the prompt, while the right-hand side shows the cursor where the user types commands.
The prompt typically contains information such as the _.
The prompt typically contains information such as the username, computer name, current directory, and sometimes the active environment or git branch.
The default shell on macOS was _ until it was replaced by _ in macOS _, released in _.
The default shell on macOS was Bash until it was replaced by Zsh in macOS Catalina (version 10.15), released in October 2019.
Bash-команда обычно строится так:
[Команда] [Опции] [Ввод или путь к файлу или директории]
Print current working directory in bash
pwd
Set working dir to /Users/self in bash
cd ~
What is ~ called and what does it mean in terminal?
tilde symbol
/Users/<user> or home directory</user>
Open current working directory in a finder window in terminal
open .
Open ./folder1 in a finder window in terminal
open folder1
List content of cwd in current working dir in bash
ls
List content of ./forder in bash
ls forder
Change working dir to ./forder in bash
cd forder
Change working dir to parent dir in bash
cd ..
Clear terminal
clear
shortcut command k
Create text.txt in ./forder in bash
touch forder/text.txt
tab in terminal
autocompletion, or displays autocompletion options
Open ./text.txt in default app
open text.txt
Output command history
history
Open ./text.txt in nano editor
nano text.txt
Go through command history one by one
up and down arrow keys
Make dir called folder1/ in folder0
mkdir folder0/folder1
Remove dir folder0/ with text.txt inside
rm -r folder0
-r flag
recursive