Options for Commands Flashcards

1
Q

How do you list all available pages in the man documentation for a particular command (what option can you use)

A

man -f {command name (install, ls etc)}

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

This will give us any command that has to do with list

A

man -k list

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

Create a parent directory along with a current directory

A

mkdir
-p option will create parent directories as needed

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

How to remove files while also skipping prompt

A

f option removes the prompt when deleting files or directories

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

Option to update a group ID

A

groupadd -g 1214

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

How do you create a new user without a default home directory but instead assign it to a new group you create?

A

useradd -M -g ops barry (-M will not create a home directory for the user) (-g will create a group)

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

Update a user ID

A

usermod -u 1244 rachel

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

Change group name

A

groupmod -n dev1 dev. dev has been changed to dev1

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

Chane home directory for a user

A

usermod -d /home/flash barry

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

What command outputs the first/last part of files and specifies the number of lines to output?

A

head -n or tail -n (tail -f is used to append data as it grows)

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

What command prints lines matching a pattern and ignores case

A

grep -i

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

What command sorts lines of text or numbers and what option can be used to sort numerically?

A

sort -n

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

what command terminates a process and what is the default signal it sends?

A

Kill
-sends SIGTERM signal 15
-9 SIGKILL terminates processes without allowing cleanup similar to killing computer without allowing it to gracefully shut down

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