Exam 1 Flashcards

(31 cards)

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

17
Q

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

18
Q

Counts these lines

19
Q

Temporarily grant administrative privileges to a regular case

20
Q

Switch to another user

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
How would I add the user to the group
Sudo usermod -aG dev_(name here)
26
How would I delete a user
Sudo userdel dev_(name here)
27
List all groups
Getent group
28
How to I open the python script
Nano my_python.py
29
How to check sudoers file
Sudo visudo
30
How to write to a file
Echo “hello” > [file name]
31
How to remove a file
Rm [file name]