Linux Flashcards

1
Q

What is the command to partition/ make a new file system?

A

mkfs -t ext4 /dev/sdb3

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

What is the command to mount the file system?

A

mount /dev/sdb3

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

What is the command to check for how much disk space is free?

A

df

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

What is the command to unmount the partition?

A

unmount /dev/sdb3

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

What are the contents of an inode?

A
username
UID
GID (default group)
Comment
home directory
shell
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the command to create a new user account?

A

useradd

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

What is the command to delete an account

A

userdel

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

What is the command to modify an account?

A

usermod -c

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

What is the command to create a group?

A

groupadd

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

What is the command to delete a group?

A

groupdel

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

What is the command to modify a group?

A

groupmod -g 1337

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

How do you switch users?

A

su

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

How do you check for which user account is current?

A

whoami

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

How do you run super user commands?

A

sudo

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

How to switch super users?

A

sudo su

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

What are the different file systems under the root?

A
bin
boot
dev
etc
home
root
run
sbin
tmp
usr
var
17
Q

What is the command to copy files?

A

cp f1.txt /home/mtork/lesson5/dir1

18
Q

What is the command to only copy files with a certain extension and add verbose?

A

cp -v *.txt /home/mtork/lesson5/dir1

19
Q

What is the command to copy directories recursively?

A

cp -r dir2/ dir3/

20
Q

What is the command to rename files?

A

mv dir4 dir44

21
Q

how to check the last n lines of a file?

A

tail -n 100 /var/log/messages

22
Q

How to create an archive and list it?

A
tar -cf archive.tar foo bar
# Creates archive.tar from files foo and bar
tar -tvf archive.tar
# List all files in archive.tar verbosely.
tar -xf archive.tar
# Extract all files from archive.tar
23
Q

How to create a compressed file?

A

gzip file1.txt

24
Q

How to uncompress a file?

A

gunzip file1.txt

25
What is the command to create a soft link to a file?
ln -s /etc/hosts host_softlink
26
What is the command to create a hard link?
ln linkfile.txt /tmp/hlinkfile.txt
27
What is the command to remove the hard link?
rm linkfile.txt
28
How to perform a search for any file that has the word passwd in it regardless of case?
locate -i passwd
29
How to check the size of all files while inside of a directory?
df -h
30
How to check the size of a file in a directory?
df -h /etc/file.txt