terminal bash 1 Flashcards

(30 cards)

1
Q

The macOS Terminal is a

A

command-line interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In CLI, the left-hand side displays the _, while the right-hand side shows the _ where _.

A

In CLI, the left-hand side displays the prompt, while the right-hand side shows the cursor where the user types commands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The prompt typically contains information such as the _.

A

The prompt typically contains information such as the username, computer name, current directory, and sometimes the active environment or git branch.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The default shell on macOS was _ until it was replaced by _ in macOS _, released in _.

A

The default shell on macOS was Bash until it was replaced by Zsh in macOS Catalina (version 10.15), released in October 2019.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Bash-команда обычно строится так:

A

[Команда] [Опции] [Ввод или путь к файлу или директории]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Print current working directory in bash

A

pwd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Set working dir to /Users/self in bash

A

cd ~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is ~ called and what does it mean in terminal?

A

tilde symbol
/Users/<user> or home directory</user>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Open current working directory in a finder window in terminal

A

open .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Open ./folder1 in a finder window in terminal

A

open folder1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

List content of cwd in current working dir in bash

A

ls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

List content of ./forder in bash

A

ls forder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Change working dir to ./forder in bash

A

cd forder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Change working dir to parent dir in bash

A

cd ..

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Clear terminal

A

clear

shortcut command k

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Create text.txt in ./forder in bash

A

touch forder/text.txt

17
Q

tab in terminal

A

autocompletion, or displays autocompletion options

18
Q

Open ./text.txt in default app

A

open text.txt

19
Q

Output command history

20
Q

Open ./text.txt in nano editor

A

nano text.txt

21
Q

Go through command history one by one

A

up and down arrow keys

22
Q

Make dir called folder1/ in folder0

A

mkdir folder0/folder1

23
Q

Remove dir folder0/ with text.txt inside

A

rm -r folder0

24
Q

-r flag

25
Bash считает пробел _. Чтобы ввести название файла с пробелом, понадобятся _.
Bash считает пробел **концом команды**. Чтобы ввести название файла с пробелом, понадобятся **кавычки или обратный слэш**.
26
Open dir ./Your Mother in finder
`open "Your Mother”` `open Your\ Mother`
27
Sudo stands for
single user do
28
Многим командам требуется доступ с _. Ввод в командную строку перед текстом самой команды _ дает _ и возможность произвести необходимые операции _.
Многим командам требуется доступ с **уровня администратора**. Ввод в командную строку перед текстом самой команды **sudo** дает **привилегии администратора** и возможность произвести необходимые операции **без смены аккаунта на аккаунт админа**.
29
Find all files ending with “.txt” in cwd
`find . -name “*.txt”``
30
«звездочки» (*) указывают на то, что используется _
regex (регулярные выражения)