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
Location of password information
/etc/shadow
26
Location of where group information is.
/etc/group
27
What command changes default permissions to files
Umask
28
How would you change default permissions to new files to makes user have RWE, RW, and RE
Umask 012
29
How would you add a Suid to a file?
chmod 4755(755 generic) *filename*
30
How would you add a Gid to a file?
chmod 2755(755 generic) *filename*
31
what does ps aux do and what does aux stand for?
reveals detailed process information. A - ps for all users U - Detailed information X - lists processes without a TTY
32
What does a TTY of "?" entail
? 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
How would you stop a process
ps u to find the PID then kill *PID*
34
How would you zip a file?
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
How would you unzip a file?
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
How would you unzip the file "myfile.tar.gz" explain
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
What are Debian and RPMs package managers that do not deal with dependencies?
Debian - dpkg RPM - RPM
38
What are Debian and RPMs package managers that deal with dependencies?
Debian - APT RPM - YUM
39
List all devices and explain what each of the four 1st bits of each line could mean
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
Directory where more detailed device information is?
/sysfs
41
Systems that automatically adds, removes and manages devices
udev
42
how to list only 1 of the 3 types of devices (list all 3)
lspci lsscsi lsusb
43
Directory: Essential ready-to-run programs (binaries), includes the most basic commands such as ls and cp.
/bin
44
Directory: Contains kernel boot loader files
/boot
45
Directory: Device files.
/dev
46
Directory: Core system configuration directory, should hold only configuration files and not any binaries.
/etc
47
Directory: Personal directories for users, holds your documents, files, settings, etc.
/home
48
Directory: Holds library files that binaries can use.
/lib
49
Directory: Used as an attachment point for removable media like USB drives.
/media
50
Directory: Temporarily mounted filesystems.
/mnt
51
Directory: Optional application software packages.
/opt
52
Directory: Information about currently running processes.
/proc
53
Directory: Information about the running system since the last boot.
/run
54
Directory: Contains essential system binaries, usually can only be ran by root.
/sbin
55
Directory: Site-specific data which are served by the system.
/srv
56
Directory: Storage for temporary files
/tmp
57
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.
/usr
58
Directory: Variable directory, it's used for system logging, user tracking, caches, etc. Basically anything that is subject to change all the time.
/var
59
this is a command line tool that supports both MBR and GPT partitioning
parted
60
this is the GUI version of parted
gparted