Command Line Flashcards

1
Q

terminal

A

an application which allows access to underlying shells

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

Why Terminals?
1) More fine-grained, predictable, and direct control
2) Automation and programmability
3)

A

1) More fine-grained, predictable, and direct control
2) Automation and programmability
3) Common interface across operating systems

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

Why Terminals?
1) More fine-grained, predictable, and direct control
2)
3) Common interface across operating systems

A

1) More fine-grained, predictable, and direct control
2) Automation and programmability
3) Common interface across operating systems

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

Why Terminals?
1)
2) Automation and programmability
3) Common interface across operating systems

A

1) More fine-grained, predictable, and direct control
2) Automation and programmability
3) Common interface across operating systems

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

Why Terminals?
1) M
2) A
3) C

A

1) More fine-grained, predictable, and direct control
2) Automation and programmability
3) Common interface across operating systems

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

command line

A

a spot where commands are entered by the user for a given shell

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

pwd

A

print working directory - where the command line is

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

which ________

A

Find out where ________ (a command) is located on system

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

echo ________

A

prints whatever _________ is in the terminal or adds __________ to a file

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

What does this command do?
echo “A change to file_1.txt”»file_1.txt

A

This command added the line A change to file_1.txt to the file_1.txt file.

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

What does this command do?
echo “Brown Fox Runs”

A

prints out “Brown Fox Runs” in the terminal

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

What is the $PATH?

A

A environment variable that allows the system to search for a command in all directories defined by the variable

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

typical $PATH directories:

A

/usr/bin
/bin
/usr/sbin
/sbin

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

ls ________

A

display the contents of ____________ a directory or folder

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

ls .

A

lists the contents of the current folder

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

ls ..

A

lists the contents of one folder up

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

cd __________

A

change directory to ___________

18
Q

cd ..

A

move one folder up

19
Q

mv

A

move or rename folders or files - (Destructive)

20
Q

mv old_name new_name

A

renames the file old_name to new_name

21
Q

mv ../file_to_move ./

A

moves file_to_move from one directory up into your current directory

22
Q

mv file_name/ ../

A

moves file_name one directory up

23
Q

mkdir __________

A

makes a new folder or multiple new folders

24
Q

rmdir __________

A

removes a empty folder or multiple empty folders (Destructive)

25
Q

touch __________

A

creates an empty file. Can also update a timestamp of the file

26
Q

cp

A

copies a file to a new location. can also copy entire directories.

27
Q

cp ../file_to_copy ./

A

copies file_to_copy from one directory up into your current directory

28
Q

rm

A

removes a file, directory, multiple file, or multiple directories (Destructive)

29
Q

rm remove_me

A

removes the file remove_me

30
Q

rm remove_me1 remove_me2

A

removes the files remove_me1 and remove_me2

31
Q

rm -r __________

A

removes a directory and all of it contents (very destructive)

32
Q

man __________

A

manual page for ___________(command) Press q to exit

33
Q

man cp

A

manual page for cp

34
Q

whatis _________

A

basic description of ____________

35
Q

What does the -l in ls -l do?

A

-l: This flag tells ls to show the output in long format, which includes additional information about each file or directory, such as its permissions, owner, size, and modification time.

36
Q

What does the -a in ls -a do?

A

-a: This flag tells ls to show all files, including hidden files (which are typically files whose names start with a dot).

37
Q

What does the -la in ls -la do?

A

It tells the system to apply both the -a and -l flags

38
Q

what does the . after a git command do?

A

A period (.) after a command is used as shorthand to refer to the current working directory. This is commonly used in commands that require a path argument, such as the git add command.

For example, if you run the command git add ., Git will stage all the changes in the current directory and its subdirectories for the next commit.

39
Q

What does echo $0 print?

A

The command “echo $0” is used to print the name of the current shell that is running. The “$0” represents the name of the currently running script or shell.

40
Q

What does echo $SHELL print?

A

The command “echo $SHELL” is used to print the absolute path of the current shell that is running. The “$SHELL” variable contains the path of the current shell interpreter that is being used by the user.

41
Q

What does echo $PATH print?

A

The command “echo $PATH” is used to print the list of directories that are currently in the search path for executable programs. The “$PATH” variable contains a colon-separated list of directories where the shell looks for commands when a user enters a command name.