Exam 1 Flashcards

1
Q

This command shows the full path of the current working directory

A

pwd
Should look like this.

home/student

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

This command list files and directories in the current directory

A

ls

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

This command is used to change the directory

A

Cd

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

Move up one directory

A

Cd..

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

Change to root directory

A

Cd/

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

Used to visualize directory structure

A

Tree

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

To make a directory

A

Mkdir

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

Open your .bashrc file

A

nano ~/.bashrc

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

How do you create a file

A

touch

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

How would you make a file in a certain directory

A

Example

Touch home/index.html

Home is the directory and the file is index but only in the home directory

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

How would you create a root directory

A

Mkdir ~/my_website

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

This command is used to display the contents of files

A

Cat

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

What command prints text to the terminal

A

Echo

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

This command is used to sort lines of text alphabetically or numerically

A

Sort

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

This command searches for specific patterns in files

A

Grep

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

This command shows the first part of the file by default the first 10 lines

A

Head

17
Q

This command shows the last part of the file by default of the last 10 lines

A

Tail

18
Q

Counts these lines

A

Wc

19
Q

Temporarily grant administrative privileges to a regular case

A

Sudo

20
Q

Switch to another user

A

Su

21
Q

What is the command to create a group

A

Sudo groupadd <groupname></groupname>

22
Q

How can I check that the group has been made

A

grep <groupname> /etc/group</groupname>

23
Q

How to create a user with a home directory

A

Sudo useradd-m dev_(namehere)

24
Q

How would I create a password for the new user

A

Sudo passwd dev_(namehere)

25
Q

How would I add the user to the group

A

Sudo usermod -aG <group> dev_(name here)</group>

26
Q

How would I delete a user

A

Sudo userdel dev_(name here)

27
Q

List all groups

A

Getent group

28
Q

How to I open the python script

A

Nano my_python.py

29
Q

How to check sudoers file

A

Sudo visudo

30
Q

How to write to a file

A

Echo “hello” > [file name]

31
Q

How to remove a file

A

Rm [file name]