General Flashcards

1
Q

list the common shells

A

bash #The GNU Bourne Again Shell
sh #The Bourne shell upon which bash is based
tcsh #This shell is based on the earlier C shell
csh #The original C shell
ksh #The Korn shell; bourne shell+c shell+extended
zsh #The Z shell takes shell evolution further than the Korn shell

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

what is an internal command

A

a command that is built into the shell program

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

what is an external command

A

a command that is not built into the shell program

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

how do you reverse search for a command in your history

A

ctrl+r

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

how do you search for a command in your history

A

ctrl+s

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

how do you terminate a search through your command history

A

ctrl+g

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

how do you move your shell cursor to the beginning of the line

A

ctrl+a

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

how do you move your shell cursor to the end of the line

A

ctrl+e

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

how do you move the shell cursor back one character

A

Ctrl+b

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

how do you move the shell cursor forward one character

A

Ctrl+f

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

how do you delete the character under the shell cursor

A

Ctrl+d

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

how do you delete all text from the shell cursor to the end of the line

A

ctrl+k

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

how do you delete all of the text from the shell cursor to the beginning of the line

A

Ctrl+x and then Backspace

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

how do you transpose the character before the cursor with the character under the shell cursor

A

ctrl+t

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

how do you transpose the two words immediately before (or under) the shell cursor

A

Esc and then t

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

how do you convert text from the shell cursor to the end of the word to uppercase.

A

Pressing Esc and then u

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

how do you convert text from the cursor to the end of the word to lowercase

A

Esc and then l

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

how do you convert the letter under the cursor (or the first letter of the next word) to uppercase; leaving the rest of the word unaffected.

A

Esc and then c

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

how do you launch a full-fledged editor to edit a command at the shell

A

Ctrl+x followed by Ctrl+e

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

how do you set an enviornment variable

A

VARNAME=VALUE

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

how do you save an environment variable across sessions

A

export VARNAME

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

how do you set and save an environment variable across sessions

A

export VARNAME=VALUE

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

what is man section 1

A

Executable programs and shell commands

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

what is man section 2

A

System calls provided by the kernel

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

what is man section 3

A

Library calls provided by program libraries

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

what is man section 4

A

Device files (usually stored in /dev )

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

what is man section 5

A

File formats

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

what is man section 6

A

Games

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

what is man section 7

A

Miscellaneous (macro packages; conventions; and so on)

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

what is man section 8

A

System administration commands (programs run mostly or exclusively by root )

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

what is man section 9

A

Kernel routines

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

what is stdin’s file descriptor

A

0

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

what is stdout’s file descriptor

A

1

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

what is stderr’s file descriptor

A

2

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

how do you specify all numbers and letters in the tr command

A

[:alnum:]

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

how do you specify all uppercase letters in the tr command

A

[:upper:]

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

how do you specify all lowercase letters in the tr command

A

[:lower:]

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

how do you specify all numbers in the tr command

A

[:digit:]

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

how do you specify a range of characters in the tr command

A

You can specify a range of characters by separating them with dashes ( - ); as in A-M

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

how do you move forward one screen in less

A

spacebar

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

how do you move back one screen in less

A

Esc followed by v

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

how do you do a search in less

A

/STRING

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

how do you do a backward search in less

A

?STRING

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

how do you move to the next search result in less

A

n

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

how do you move to the previous search result in less

A

N

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

how do you go to a specific line in less

A

gNUMBER

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

how do you display the help system in less

A

h

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

what are the extended regular express characters

A

? + | ( )

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

what is the windows newline

A

/r/n

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

what is the mac newline

A

/n

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

what is the linux newline

A

/n

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

how could you use tr to convert from windows to linux format line endings

A

tr -d \r < dosfile.txt > unixfile.txt

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

how could you use sed to convert from linux to windows line endings

A

sed “”s/$/\r/”” unixfile.txt > dosfile.txt

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

describe the naming convention of this rpm package: string-a.b.c-x.y.rpm

A
string = Package Name
a.b.c = Version Number
x = Build Number
y = Architecture
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

How would you use rpm to install or upgrade package samba-4.1.9-4.fc20.x86_64.rpm from an RPM file that you have already downloaded to your local system

A

rpm -Uvh samba-4.1.9-4.fc20.x86_64.rpm

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

how would you query information on the installed package samba using rpm

A

rpm -qi samba

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

how would you convert samba-4.1.9-4.fc20.src.rpm to samba-4.1.9-4.fc20.src.cpio

A

rpm2cpio samba-4.1.9-4.fc20.src.rpm > samba-4.1.9-4.fc20.src.cpio

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

how would you extract samba-4.1.9-4.fc20.src.cpio

A

cpio -i –make-directories < samba-4.1.9-4.fc20.src.cpio

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

how would you extract samba-4.1.9-4.fc20.src.rpm on a system without rpm

A

rpm2cpio samba-4.1.9-4.fc20.src.rpm | cpio -i –make-directories

60
Q

how do you install samba_4.1.6+dfsg- 1ubuntu2.1404.3_amd64.deb

A

dpkg -i samba_4.1.6+dfsg-1ubuntu2.1404.3_amd64.deb

61
Q

how do you uninstall samba using dpkg

A

dpkg -r samba

62
Q

what information is displayed by ps

A

username; process id; parent process id; tty; cpu time; cpu priority; memory usage; command

63
Q

how do you send a program to the background

A

ctrl+z

64
Q

what is process signal 1 and what does it do

A

SIGHUP ; which terminates interactive programs and causes many daemons to reread their configuration files

65
Q

what is process signal 9 and what does it do

A

SIGKILL ; which causes the process to exit without performing routine shutdown tasks)

66
Q

what is process signal 15 and what does it do

A

SIGTERM ; which causes the process to exit but allows it to close open files and so on

67
Q

what is process signal SIGHUP and what does it do

A

1 ; which terminates interactive programs and causes many daemons to reread their configuration files

68
Q

what is process signal SIGHKILL and what does it do

A

9 ; which causes the process to exit without performing routine shutdown tasks)

69
Q

what is process signal SIGHTERM and what does it do

A

15 ; which causes the process to exit but allows it to close open files and so on

70
Q

what is an interrupt request

A

a signal sent to the CPU instructing it to suspend its current activity and to handle some external event such as keyboard input

71
Q

what is IRQ 0

A

system timer

72
Q

what is IRQ 1

A

keyboard

73
Q

what is IRQ 2

A

handles IRQ 8-15

74
Q

what is IRQ 3

A

COM2

75
Q

what is IRQ 4

A

COM1

76
Q

what is IRQ 5

A

LPT2 / Sound card

77
Q

what is IRQ 6

A

Floppy controller

78
Q

what is IRQ 7

A

parallel port

79
Q

what is IRQ 8

A

real time clock

80
Q

what is IRQ 12

A

ps2 mouse

81
Q

what is IRQ 13

A

floating point proc

82
Q

what is IRQ 14

A

primary IDE

83
Q

what is IRQ 15

A

secondary IDE

84
Q

what are i/o addresses

A

unique locations in memory that are reserved for communications between the CPU and specific physical hardware devices

85
Q

what is direct memory addressing

A

an alternative method of communication to I/O ports. Rather than have the CPU mediate the transfer of data between a device and memory; DMA permits the device to transfer data directly; without the CPU’s attention

86
Q

how does the BIOS boot process begin

A

the computer reading a boot sector (typically the first sector) from a disk and then executing that code

87
Q

how does the EFI boot process begin

A

the computer reading a boot loader file from a filesystem on a special partition; known as the EFI System Partition (ESP) . This file either can take a special default name or can be registered in the computer’s NVRAM

88
Q

what is the HAL Daemon

A

The Hardware Abstraction Layer (HAL) Daemon ; or hald ; is a user-space program that runs at all times (that is; as a daemon) and provides other user-space programs with information about available hardware

89
Q

what is the D-Bus

A

The Desktop Bus (D-Bus) provides a further abstraction of hardware information access. Like hald ; D-Bus runs as a daemon. D-Bus enables processes to communicate with each other as well as to register to be notified of events; both by other processes and by hardware (such as the availability of a new USB device).

90
Q

what is mbr partition code 0x0c

A

fat

91
Q

what is mbr partition code 0x05

A

old extended code

92
Q

what is mbr partition code 0x07

A

ntfs

93
Q

what is mbr partition code 0x0f

A

newer extended code

94
Q

what is mbr partition code 0x82

A

linux swap

95
Q

what is mbr partition code 0x83

A

linux filesystem

96
Q

what is mbr partition code 0x8e

A

LVM

97
Q

what directories should never be on a seperate partition from /

A
/bin
/dev
/etc
/lib
/sbin
98
Q

describe ext2fs

A

traditional Linux-native filesystem; no journaling

99
Q

describe ext3fs

A

ext2 with journaling

100
Q

describe ext4fs

A

ext3 with performance and size extensions

101
Q

describe ReiserFS

A

designed from scratch as a journaling filesystem for Linux. It’s particularly good at handling large numbers of small files (

102
Q

describe JFS

A

IBM developed the Journaled File System (JFS) for its AIX OS on mainframe systems and later reimplemented it on its attempt at a workstation OS; called OS/2. After the demise of OS/2; the OS/2 version of JFS was subsequently donated to Linux

103
Q

describe XFS

A

Silicon Graphics (SGI) created its Extents File System (XFS) for its IRIX OS and; like IBM; later donated the code to Linux. Like JFS; XFS is a very technically sophisticated filesystem. XFS has gained a reputation for robustness; speed; and flexibility on IRIX; but some of the XFS features that make it so flexible on IRIX aren’t supported well under Linux.

104
Q

describe Btrfs

A

is an advanced filesystem with features inspired by those of Sun’s Zettabyte File System (ZFS).

105
Q

describe FAT

A

old and primitive—but ubiquitous. It’s the only hard disk filesystem supported by DOS and early versions of Windows (such as the Windows 9 x series and the short-lived Windows Me). For this reason; every major OS understands FAT;

106
Q

describe NTFS

A

the preferred filesystem for Windows NT and beyond. Unfortunately; Linux’s NTFS support is rather rudimentary. As of the 2.6. x kernel series; Linux can reliably read NTFS and can overwrite existing files; but the Linux kernel can’t write new files to an NTFS partition. There are separate drivers outside of the kernel that you can use in Linux to create new files on an NTFS filesystem

107
Q

describe HFS[+]

A

Apple has long used the Hierarchical File System (HFS) with its Mac OS; and Linux provides full read/write HFS support. This support isn’t as reliable as Linux’s read/write FAT support; though; so you may want to use FAT when exchanging files with Mac users.

108
Q

describe ISO-9660

A

CD-ROMs; Linux Rock Ridge extensions; Joliet Windows extensions

109
Q

describe UDF

A

Universal Disc Format (UDF) is the next-generation filesystem for optical discs. It’s commonly used on DVD-ROMs and recordable optical discs. Linux supports it; but read/write UDF support is still in its infancy.

110
Q

describe the /etc/fstab file format

A
#device mount point filesystem options dump(1 means the dump program should do a dump) fsck(fsck check order, 0 means don't check)
e.g. UUID=3631a288-673e-40f5-9e96-6539fec468e9 \ /usr reiserfs defaults 0 0
111
Q

what does “credentials=/etc/creds” in the options column of the /etc/fstab signify

A

the login credentials(username and password) are stored in /etc/creds

112
Q

what characters should not be used in filenames

A
  • ? / \ “”
113
Q

what are the wildcard expansion characters

A

? * [a-z]

114
Q

what are the three timestamps on each file

A

Last file-modification time
Last inode change time
Last access time

115
Q

how would you compress ∼/my-work and gzip it into /media/pen/my-work.tgz

A

tar cvfz /media/pen/my-work.tgz ∼/my-work

116
Q

what are the file type codes displayed by ls -l

A
  • normal file
    d directory
    l symlink
    p named pipe (A pipe enables two running Linux programs to communicate with each other. One opens the pipe for reading; and the other opens it for writing; enabling data to be transferred between the programs)
    s socket (similar to a named pipe; but it permits network and bidirectional links)
    b block device (a file that corresponds to a hardware device to and from which data is transferred in blocks of more than 1 byte. Disk devices (hard disks; USB flash drives; CD-ROMs; and so on))
    c character device (a hardware device to and from which data is transferred in units of 1 byte. Examples include parallel port; RS-232 serial port; and audio devices)
117
Q

what does the directory execution bit do

A

When a directory’s execute bit is set; that means that the directory’s contents may be searched

118
Q

what does the write bit on a directory do

A

if a user can write to a directory; that user can create; delete; or rename files in the directory as well
use the sticky bit to alter this behavior

119
Q

what are the permissions of a symlink

A

always 777

trying to change it’s permissions will affect the file it points to

120
Q

how is set user id represented

A

4000
SUID
s in the owner’s execute bit
If the SUID bit is set on a file without execution permission set; the permission string appears with a capital S ; as in rwSr-xr-x . However; in this case; SUID will not function and the setting is called benign .

121
Q

how is set group id represented

A

2000
SGID
s in the group’s execute bit
f the SGID bit is set on a file without execution permission set; the permission string appears with a capital S ; as in rwsr-Sr-x . Also in this case the setting is benign.
SGID is also useful on directories. When the SGID bit is set on a directory; new files or subdirectories created in the original directory will inherit the group ownership of the directory rather than be based on the user’s current default group

122
Q

how is sticky bit represented

A

1000
t in the world’s execute bit
When this bit is present on a directory; the directory’s files can be deleted only by their owners; the directory’s owner; or root

123
Q

what is a typical default umask

A

002 or 022

124
Q

how would you set the permissions of newly created folders to have rwxrxrx permissions symbolically

A

umask u=rwx,g=rx,o=rx

125
Q

how would you add user quota support to a mount point in /etc/fstab

A

/dev/sdc5 /home ext4 usrquota 1 1

126
Q

how would you add group quota support to a mount point in /etc/fstab

A

/dev/sdc5 /home ext4 grpquota 1 1

127
Q

how would you add user and group quota support to a mount point in /etc/fstab

A

/dev/sdc5 /home ext4 usrquota,grpquota 1 1

128
Q

what is the old filesystem structure for linux called

A

FSSTND
Filesystem Standard
Standardized the programs that reside in
/bin and /usr/bin.
Specified that executable files shouldn’t reside in
/etc
Removed changeable files from the
/usr
enabling it to be mounted read-only (a useful security measure).

129
Q

what is the current filesystem structure

A

Filesystem Hierarchy Standard (FHS)

Shareable; Unshareable; Static; Variable

130
Q

what are some static shareable directories in FHS

A

/usr

/opt

131
Q

what are some static unshareable folders in FHS

A

/etc

/boot

132
Q

what are some variable shareable folders in FHS

A

/home

/var/mail

133
Q

what are some variable unshareable folders in FHS

A

/var/run

/var/lock

134
Q

what directories are recommended to have their own partition

A
/boot
/home
/opt
/tmp
/usr
/usr/local
/var
135
Q

how does grub legacy start a boot entry

A

title

136
Q

how does grub 2 start a boot entry

A

menuentry

137
Q

what is the system logger

A

syslogd
writes files to
/var/log/messages
/var/log/syslog

138
Q

what are the 3 popular initialization process methods used in linux

A

Unix System V (also called SysV)
Upstart (ubuntu; each service has a configuration file)
systemd (redhat) (this is the winner! everyone important is switching to it)

139
Q

describe runlevel 0

A

shutdown
A transitional runlevel; meaning that it’s used to shift the computer from one state to another. Specifically; it shuts down the system. On modern hardware; the computer should completely power down. If not; you’re expected to either reboot the computer manually or power it off.

140
Q

describe runlevel 1

A

also s or S
Single-user mode. What services; if any; are started at this runlevel vary by distribution. It’s typically used for low-level system maintenance that may be impaired by normal system operation; such as resizing partitions.

141
Q

describe runlevel 2

A

On Debian and its derivatives; a full multi-user mode with X running and a graphical login. Most other distributions leave this runlevel undefined.

142
Q

describe runlevel 3

A

On Fedora; Mandriva; Red Hat; and most other distributions; a full multi-user mode with a console (nongraphical) login screen.

143
Q

describe runlevel 4

A

Usually undefined by default and therefore available for customization.

144
Q

describe runlevel 5

A

On Fedora; Mandriva; Red Hat; and most other distributions; the same behavior as runlevel 3; with the addition of having X run with an XDM (graphical) login.

145
Q

describe runlevel 6

A

Used to reboot the system. This runlevel is also a transitional runlevel. Your system is completely shut down; and then the computer reboots automatically.

146
Q

what is a systemd unit

A

defines a service or action on the system

eg. mount; service; snapshot

147
Q

what are the systemd units

A
automount
device
mount
path
service
snapshot
socket
target