Stuart Linux Flashcards

1
Q

Augment: Display more details about files in current directory.

A

ls -l

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

Augment: Display all files(even the hidden ones)

A

ls -a

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

How do you find out a file type of a file?

A

file

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

While using the less command how would you find the word “server3”

A

/server3

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

How would you copy the file test.1 to /home/bin

A

cp test.1 /home/bin

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

Augment: how would you copy a directory “dir1” to /home/lib

A

cp -r dir1 /home/lib

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

How would you search for a file named networkinfo.txt throughout the system and again through the /home/bin folder

A

find / -name networkinfo.txt
find /home/bin -name networkinfo.txt

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

How would you output the list of objects in your current directory to the sample.txt file

A

ls > sample.txt
> Overwrites
» adds the output to the end

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

How would you see what the home directory is?

A

echo $home or env

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

How would you extract the 10 character from each line of sample.txt? how about the 3rd field?

A

cut -c 10 sample.txt
cut -f 3 sample.txt

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

How would you sort sample.txt alphabetically and numerically?

A

sort
sort -n

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

How do you get the character/word/line count of a file

A

wc (-c/w/l)

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

this command add numbers beside each line

A

nl

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

This lets you search for words or numbers in a file. also how do you make it case insensitive

A

grep
grep -i

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

how to VIM edit a file

A

VIM file

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

how to enter insert mode

A

i

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

how to copy a letter/line in VIM

A

y for a character and yy for a line

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

how to delete in vim

A

d in command mode delete or backspace otherwise.

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

in VIM how to get out of insert mode

A

esc

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

how to paste in VIM

A

p

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

in VIM how to save

A

:w

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

in VIM how to quit

A

:q
or :q! to quit without saving

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

how to save and exit in VIM

A

:wq or ZZ

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

Location of where user information is held

A

/etc/passwd

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

Location of password information

A

/etc/shadow

26
Q

Location of where group information is.

A

/etc/group

27
Q

What command changes default permissions to files

A

Umask

28
Q

How would you change default permissions to new files to makes user have RWE, RW, and RE

A

Umask 012

29
Q

How would you add a Suid to a file?

A

chmod 4755(755 generic) filename

30
Q

How would you add a Gid to a file?

A

chmod 2755(755 generic) filename

31
Q

what does ps aux do and what does aux stand for?

A

reveals detailed process information.
A - ps for all users
U - Detailed information
X - lists processes without a TTY

32
Q

What does a TTY of “?” entail

A

? means it is a daemon that starts on boot and is terminated on shutdown. other TTY’s are associated with terminal instances and can come and go.

33
Q

How would you stop a process

A

ps u to find the PID
then kill PID

34
Q

How would you zip a file?

A

tar cvf “new file name” “files you want to zip” “file2 you want to zip”
c - create
v - tell the program to be verbose and let us see what it’s doing
f - the filename of the tar file has to come after this option, if you are creating a tar file you’ll have to come up with a name

35
Q

How would you unzip a file?

A

tar xvf
x - extract
v - tell the program to be verbose and let us see what it’s doing
f - the file you want to extract

36
Q

How would you unzip the file “myfile.tar.gz” explain

A

tar xzf myfile.tar.gz - usually XVF works, however since the file has a .gz zip it needs to unzip with gunzip 1st. the “z” option unzips with gunzip 1st.

37
Q

What are Debian and RPMs package managers that do not deal with dependencies?

A

Debian - dpkg
RPM - RPM

38
Q

What are Debian and RPMs package managers that deal with dependencies?

A

Debian - APT
RPM - YUM

39
Q

List all devices and explain what each of the four 1st bits of each line could mean

A

ls -l /dev
c - Character - not a physical device, increases functionality of system.
b- Block - These devices transfer data, but in large fixed-sized blocks. You’ll most commonly see devices that utilize data blocks as block devices, such as hard drives, filesystems, etc.
p - Pipe - Named pipes allow two or more processes to communicate with each other, these are similar to character devices, but instead of having output sent to a device, it’s sent to another process.
s - Socket - Socket devices facilitate communication between processes, similar to pipe devices but they can communicate with many processes at once.

40
Q

Directory where more detailed device information is?

A

/sysfs

41
Q

Systems that automatically adds, removes and manages devices

A

udev

42
Q

how to list only 1 of the 3 types of devices (list all 3)

A

lspci
lsscsi
lsusb

43
Q

Directory: Essential ready-to-run programs (binaries), includes the most basic commands such as ls and cp.

A

/bin

44
Q

Directory: Contains kernel boot loader files

A

/boot

45
Q

Directory: Device files.

A

/dev

46
Q

Directory: Core system configuration directory, should hold only configuration files and not any binaries.

A

/etc

47
Q

Directory: Personal directories for users, holds your documents, files, settings, etc.

A

/home

48
Q

Directory: Holds library files that binaries can use.

A

/lib

49
Q

Directory: Used as an attachment point for removable media like USB drives.

A

/media

50
Q

Directory: Temporarily mounted filesystems.

A

/mnt

51
Q

Directory: Optional application software packages.

A

/opt

52
Q

Directory: Information about currently running processes.

A

/proc

53
Q

Directory: Information about the running system since the last boot.

A

/run

54
Q

Directory: Contains essential system binaries, usually can only be ran by root.

A

/sbin

55
Q

Directory: Site-specific data which are served by the system.

A

/srv

56
Q

Directory: Storage for temporary files

A

/tmp

57
Q

Directory: This is unfortunately named, most often it does not contain user files in the sense of a home folder. This is meant for user installed software and utilities, however that is not to say you can’t add personal directories in there. Inside this directory are sub-directories for /usr/bin, /usr/local, etc.

A

/usr

58
Q

Directory: Variable directory, it’s used for system logging, user tracking, caches, etc. Basically anything that is subject to change all the time.

A

/var

59
Q

this is a command line tool that supports both MBR and GPT partitioning

A

parted

60
Q

this is the GUI version of parted

A

gparted