Linux Class Flashcards

1
Q

man

A

Displays Manual Page

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

cd

A

Change directory

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

pwd

A

present working directory

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

obtain system information command including kernal version

A

uname -a

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

What is the basic GUI environment called?

A

X Window referred as ‘X’

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

What is the program that controls the appearance of windows in the X Window System?

A

Windows Manager, ex. Kwin, Metacity, XFWM

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

A combination of Window Manger and a consistent interface that provides the overall desktop experience?

A

Desktop Environment, ex. XFCE, GNOME, KDE
The default manager for XFCE is XFWM/

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

search for patterns within a file

A

grep

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

Piped commands - output of command into file

A

|

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

>

A

Redirects out put of command into file

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

Appends file with the output of a command

A

> >

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

allows you to run a single command with your permissions

A

sudo

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

su

A

changes user in shell on the fly (without logging off and back on.

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

view directory listing

A

ls

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

formatted listing with hidden files

A

ls -al

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

create a directory file

A

mkdir

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

delete file

A

rm file

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

delete file

A

rm file

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

delete directory and files

A

rm -r dir

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

force remove file

A

rm -f file

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

force remove directory dir

A

rm -rf dir

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

create or update file

A

touch file

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

places standard input into file

A

cat > file

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

output the first 10 lines of a file

A

head file

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

output the last 10 lines of the file

A

tail file

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

output the contents of file as it grows, starting with the last 10 lines

A

tail -f file

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

display all running processes

A

ps

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

kill processes id pid

A

kill pid

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

change the permissions of file to octal, which can be found separately for user, group.

A

chmod {octal} file

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

read, write, execute for all chmod setting

A

chmod 777

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

rwx for owner, rx for group and world

A

chmod 755

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

connect to host as user using SSH

A

ssh user@host

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

connects to host on port as a user using SSH

A

ssh -p port user@host

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

search pattern in files

A

grep {pattern} {files}

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

search recursively for pattern in dir

A

grep -r {pattern} {files,dir}

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

shows the current date and time

A

date

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

shows this month’s calendar

A

cal

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

who you are logged in as

A

whoami

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

display information about user

A

finger {user}

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

The root directory

A

/

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

Executable programs needed when running in minimal troubleshooting mode
Common commands like ls, cd,

A

/bin

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

File and directories needed to boot the Linex Kernel. including the kernel images pointed to by LILO (the LInux LOader) or GRUB.

A

/boot

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

Device files that are used for accessing physical hardware. Files that represent devices on the system. Device nodes

A

/dev

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

Contains configuration files that are used by programs and services

A

/etc

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

used for local user home directories. Each user directory can be extended by the respective user and will contain their personal files as well as user-specific configuration files (X preferences)

A

/home

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

shared libraries that are used by programs
32 bit software libraries

A

/lib

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

Directories used for mounting devices in the file system tree. Provides temporary mount points for external, remote, and removable file systems.
This is the legacy directory for manually mounting volumes.

A

/mnt

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

Used for optional packages that may be installed on the system. Like Google Chrome

A

/opt

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

the home directory for the root user

A

/root

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

Executable programs for systems administration commands. Cannot be used by regular users. commands like fdisk and ifconfig

A

/sbin

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

Directory that may be used for data used by services like HTTP, FTP or NFS

A

/srv

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

Temporary files that may be deleted without any warning

A

/tmp

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

Subdirectories for program files.

Contains local software, libraries, games, etc

A

/usr

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

Bourne Again shell

A

Bash

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

Login shell

user @ hostname : ~ $

A

read and sources /etc/profile

ssh sessions (remote login)

user @ hostname : ~ $

logging in to the system at prompt

su - to root

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

Non login shell

A

X terminal

reads and sources .bashrc (user settings for non log in shell)

Prompt: Bash- $

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

Where are Global Bash login shell settings stored

A

/etc/profile

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

Where is Bash settings and user customization for login shells stored?

A

~/ .bash_profile

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

Where are User Bash non-login settings and can use to make all shells act like login shells

A

~/ .bashrc

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

read contents

A

cat

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

prompt = $

A

normal user

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

prompt = #

A

root user

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

help pages and most detail is info page

A

man

–help

info

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

long listing with ’human readable’ sizes

A

ls -lh

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

cd ..

A

directory up

66
Q

cd /

A

absolute

67
Q

cd XXXX

A

relative path

68
Q

Permission change using?

A

chmod <###> file name

69
Q

Permission layout

A

### ###

Owner

Owner Group

Other Group

70
Q

rwx is what number

A

7

71
Q

Commands and file names are

A

CASE SENSITIVE

72
Q

d rwxr-xr-x 2 barry users 4.0K Aug 7 11:26 Data/

A

Type Permissions 2 Owner/Group Size Modified Time Object Name

73
Q

copy

A

cp

74
Q

copy a directory

A

cp -r

75
Q

move a file or directory

A

mv

76
Q

display image ?

A

display

77
Q

means the parent of the current directory, not the root directory

A

../

78
Q

Chmod Octal mode for read (r)

A

4

79
Q

Chmod Octal mode for write (w)

A

2

80
Q

Chmod Octal mode for execute (x)

A

1

81
Q

How to view files and sub directories (command)

A

ls -R

82
Q

wget

A

get file online

83
Q

How to determine if inserted device is registered is using what command

A

dmesg

84
Q

To see a list of media

A

lsscsi

85
Q

Logs and other variable files will be found here

A

/var

86
Q

Dynamic run time files for system daemons like udev and udisk. You can find external volumes from the disktop

A

/run

87
Q

64 bit software libraries

A

lib64

88
Q

standard place for system wide removable media

A

/media

89
Q

background process

A

daemons

90
Q

view devices that have detected and show the partitions that we might try to mount

A

lsblk

91
Q

fstab is located where and what is it

A

/etc/fstab and it is “File System Table”

92
Q

To change the permissions of ‘file1.txt’ to read and write (no execute) for all users I could use:

Select one:

chown root file1.txt
chmod 777 file1.txt
chmod 666 file1.txt
chattr -a file1.txt
none of these answers is correct

A

chmod 666 file1.txt

93
Q

In the following command, what does the “.” signify?
find . -name “myfile.txt”

Select one:

starting in the current directory
include hidden files
only include files with a ‘.’ in the name
nothing, that is invalid syntax
none of these answers is correct

A

starting in the current directory

94
Q

Command line math can be accomplished with:

Select one:

xcalc or calc
xcalc or bc
bc or shell expansion
bcalc or $[[y+x]]

A

bc or shell expansion

95
Q

Which command shows my current directory?

Select one:

cd
pwd
whereami
ls -pwd

A

pwd

96
Q

The Linux Kernel:

Select one:
Includes GNU Utilities and commands that interface with the user.
handles the interaction between the computer hardware and software.
uses the same code as the Solaris Unix.
was written by Sandor Clegane.

A

handles the interaction between the computer hardware and software.

97
Q

Default STDERR is usually _________________.

Select one:
the shell you are currently working in.
the file that is specified with the command
/dev/null if no output target is given
the first pipe in the next command chain
none of these answers is correct

A

the shell you are currently working in.

98
Q

If I want to save and exit a vi editing session, I can use which command from command mode:

Select one:
:w!
:ZZ
:q!
:wx!
none of these is correct

A

:ZZ

99
Q

System configuration files are usually found in the __________ directory

Select one:
/var
/sys
/etc
.config/
none of these is correct

A

/etc

100
Q

To find out the permissions of files in a directory, I can use the following command:

Select one:
chmod
chattr
ls -la
ls -F

A

ls -la

101
Q

The following command will show me all the lines in the /etc/passwd file that contain the string “Harry”:

Select one:
find Harry /etc/passwd
cat /etc/passwd | grep harry
find /etc/passwd -name harry
grep -i harry /etc/passwd

A

grep -i harry /etc/passwd

102
Q

The permissions for the octal value 760 are:

Select one:
r–r–r–
rw-r–r–
rwxrw—-
r–rw-rw-

A

rwxrw—-

103
Q

This file contains known file systems to be mounted:

Select one:
a./etc/fstab
b./etc/mounts
c./proc/mounted
d./etc/fsblock

A

/etc/fstab

104
Q

What does GNU stand for:

Select one:
a.GNU’s not Unix
b.General Non Unix
c.Geeks Need Unix
d.None of these answers is correct

A

GNU’s not Unix

105
Q

This directory usually contains system binary files that are run by root:

Select one:
a./lib (on a 32bit or 64bit system)
b./sysbin
c./dev/root/bin
d./bin/sys/
e.none of these is correct

A

none of these is correct

106
Q

It is possible to obtain the serial number from a USB flash drive using:

a.hdparm -I
b.lsscsi
c.cat /dev/usb | grep serial
d.lsusb -v

A

lsusb -v

107
Q

Which command will remove a directory and it’s contents:

Select one:
a.ls -l <dir>
b.deletedir <dir>
c.rm -rf <dir>
d.rm *
e.none of these answers is correct</dir></dir></dir>

A

rm -rf <dir></dir>

108
Q

The chown command can be used to:

a.Change the attributes of a file (immutable, undeletable, etc.)
b.Change the type of a file (block device, link, etc.)
c.Change the user group the file belongs to
d.None of these answers is correct

A

Change the user group the file belongs to

109
Q

Linux distributions can have different package management systems. Which of the following is true?

Select one:
a.Package managers never install optional dependencies
b.Package managers always install optional dependencies
c.Package managers from all Linux distributions use the same software repositories
d.Package managers allow you to keep track of what packages are installed.

A

Package managers allow you to keep track of what packages are installed.

110
Q

When redirecting output, the difference between “>” and “2>” is:

Select one:
a.”>” will overwrite existing content, “2>” will append to the front of a file.
b.”>” will append to the beginning of a file, “2>” will append to the end.
c.”>” will overwrite existing content, “2>” will append to the end of a file.
d.”>” redirects standard output, “2>” redirects standard output twice
e.”>” redirects standard output , “2>” redirects standard error
f.”>” overwrites standard output, “2>” redirects standard output

A

”>” redirects standard output , “2>” redirects standard error

111
Q

I can redirect the output of a command to the input of another command using:

Select one:
a.the > symbol
b.the&raquo_space; symbol
c.a pipe symbol ‘|’
d.either the > symbol or the&raquo_space; symbol
e.none of the above

A

a pipe symbol ‘|’

112
Q

The following command would append the string “Hello World” to file.txt:

Select one:
a.echo “Hello World”&raquo_space; file.txt
b.echo “Hello World” > file.txt
c.cat “Hello World”&raquo_space; file.txt
d.cat “Hello World” | file.txt
e.none of these answers is correct

A

echo “Hello World”&raquo_space; file.txt

113
Q

If the first ten characters of the “ls -l” output for a given object are:
crw-rw—-

Select one:
a.the object is a c programming language file with read and write permissions for the owner and members of the owner’s group (octal permissions 550).
b.the object is marked ‘cleared’ (deleted) by the kernel and the permissions do not matter.
c.the octal value for the object’s permissions is 440.
d.the object is a character device file with read and write permissions for all users in the owner’s group
e.the object is a regular file with read and write permissions for the owner and members of the owner’s group (octal permissions 660).
f.the object is marked ‘cleared’ (deleted) by the kernel but the permissions read and write for the owner and other members of the owner’s group.

A

the object is a character device file with read and write permissions for all users in the owner’s group

114
Q

I can see what storage media is attached to my system (and recognized) with:
Select one:
a.lsblk, dmesg, lsscsi
b.lsscsi and hwshow
c.lsdisk and lsblk
d.dmesg and lsblock

A

lsblk, dmesg, lsscsi

115
Q

Which command is used to view processes running on a system?
Select one:
a.ls
b.ps
c.procls
d.cat -p
e.none of these answers is correct

A

ps

116
Q

The two (primary) modes of the vi editor are:
Select one:
a.input and output
b.execute (command) and input
c.keybind and escape
d.normal (command) and insert

A

normal (command) and insert

117
Q

In a directory listing, files that start with a ‘dot’ (.file) are ________________________.
Select one:
a.hidden unless you use “ls -lr” to view the directory listing
b.hidden unless you use “ls -a” to view the directory listing
c.in the parent directory
d.hidden unless you use the –unhide option to ls

A

hidden unless you use “ls -a” to view the directory listing

118
Q

To obtain a listing of the files in the current directory, including hidden files and details of files (size, permissions, etc.):
Select one:
a.ls -ah
b.ls -lh
c.ls -la
d.ls –show-all –sizes

A

ls -la

119
Q

Command to list attached PCI devices

A

lspci

120
Q

How to blacklist a driver

A

/etc/modprobe.d
will override drivers in /lib/modpobe.d

121
Q

Command to list usb devices like usb wireless network adaptor

A

lsusb

122
Q

Command to see disks and partitions that are attached to your system

A

lsblk

123
Q

Command for disk information is _________________, but does not show partitions but gives more information about the actual media

A

lsscsi

124
Q

What command creates and list partitions

A

fdisk

125
Q

Best way to determine how and if an inserted device is registered is to use _____________________

A

dmesg

126
Q

what directory does a user manually attach a file system that weren’t mounted on startup.

A

/mnt

127
Q

Command to manually mount a filesystem

A

mount -t (filesystem type) -o (options) (device) (mountpoint)
example
mount -t ext4 /dev/sdb1 /mnt/analysis

128
Q

How to get FS type using what command

A

file -s
file -s /dev/sdb1

129
Q

How do you unmount the FS that is mounted at /mnt/

A

umount
umount /mnt/analysis

130
Q

How to look at the current mounted?

A

findmnt –real

131
Q

what is the /etc/fstab

A

file system table

132
Q

How you search for files based on any number of criteria like dates, sizes, name patterns, object type, etc

A

find (start dir) (criteria)
example: find /etc -iname fstab

133
Q

redirection for stdin

A

<
take input from infile rather than keyboard

134
Q

redirection for stdout:

A

> send output to file

135
Q

redirection for stderr

A

2>
send any error messages to the file

136
Q

wc

A

word count
default
lines - words - bytes

137
Q

VIM: insert text under the curser

A

i

138
Q

VIM: append text after the curser

A

a

139
Q

VIM: open a new line under the current line

A

o

140
Q

VIM: open a new line above the current line

A

O

141
Q

VIM: cut the character under the curser

A

x

142
Q

VIM cut the character b4 the curser

A

X

143
Q

VIM: cut the entire line the cursor is on

A

dd

144
Q

VIM: cut to the end of the current word

A

dw

145
Q

VIM: copy

A

y, yw, y$

146
Q

VIM: paste

A

p before curser
P after curser

147
Q

VIM: save and continue

A

:w

148
Q

VIM: save and quit

A

:wq

149
Q

VIM: save and quit without prompt

A

:wq!

150
Q

VIM: first line

A

gg

151
Q

VIM: end of file

A

G

152
Q

system initialization and service management is called.

A

Slack uses BSD or System V init

Others use Systemd

153
Q

where is the kernel image stored

A

/boot
bzImage or vmlinuz

154
Q

/home/$USER/.bashrc

A

This file is sourced by bash for non login shells. An example is
opening a terminal window on a desktop.

155
Q

This is the global bash initialization file for login shells.

A

/etc/profile

156
Q

SYSTEM INIT: where does scripts get invoked if executable

A

depending on run level … looks in etc for either rc.d or rc.M,

157
Q

Difference between hosts.allow, hosts.deny, and iptables

A

host* files access at the application level, whereas iptables blocks network traffic at specified physical network interface.

158
Q

How to check iptable rules

A

iptables -S

159
Q

What is the package management software for Slackware

A

slackpkg

160
Q
A