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
what is man section 3
Library calls provided by program libraries
26
what is man section 4
Device files (usually stored in /dev )
27
what is man section 5
File formats
28
what is man section 6
Games
29
what is man section 7
Miscellaneous (macro packages; conventions; and so on)
30
what is man section 8
System administration commands (programs run mostly or exclusively by root )
31
what is man section 9
Kernel routines
32
what is stdin's file descriptor
0
33
what is stdout's file descriptor
1
34
what is stderr's file descriptor
2
35
how do you specify all numbers and letters in the tr command
[:alnum:]
36
how do you specify all uppercase letters in the tr command
[:upper:]
37
how do you specify all lowercase letters in the tr command
[:lower:]
38
how do you specify all numbers in the tr command
[:digit:]
39
how do you specify a range of characters in the tr command
You can specify a range of characters by separating them with dashes ( - ); as in A-M
40
how do you move forward one screen in less
spacebar
41
how do you move back one screen in less
Esc followed by v
42
how do you do a search in less
/STRING
43
how do you do a backward search in less
?STRING
44
how do you move to the next search result in less
n
45
how do you move to the previous search result in less
N
46
how do you go to a specific line in less
gNUMBER
47
how do you display the help system in less
h
48
what are the extended regular express characters
? + | ( )
49
what is the windows newline
/r/n
50
what is the mac newline
/n
51
what is the linux newline
/n
52
how could you use tr to convert from windows to linux format line endings
tr -d \\r < dosfile.txt > unixfile.txt
53
how could you use sed to convert from linux to windows line endings
sed ""s/$/\r/"" unixfile.txt > dosfile.txt
54
describe the naming convention of this rpm package: string-a.b.c-x.y.rpm
``` string = Package Name a.b.c = Version Number x = Build Number y = Architecture ```
55
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
rpm -Uvh samba-4.1.9-4.fc20.x86_64.rpm
56
how would you query information on the installed package samba using rpm
rpm -qi samba
57
how would you convert samba-4.1.9-4.fc20.src.rpm to samba-4.1.9-4.fc20.src.cpio
rpm2cpio samba-4.1.9-4.fc20.src.rpm > samba-4.1.9-4.fc20.src.cpio
58
how would you extract samba-4.1.9-4.fc20.src.cpio
cpio -i --make-directories < samba-4.1.9-4.fc20.src.cpio
59
how would you extract samba-4.1.9-4.fc20.src.rpm on a system without rpm
rpm2cpio samba-4.1.9-4.fc20.src.rpm | cpio -i --make-directories
60
how do you install samba_4.1.6+dfsg- 1ubuntu2.1404.3_amd64.deb
dpkg -i samba_4.1.6+dfsg-1ubuntu2.1404.3_amd64.deb
61
how do you uninstall samba using dpkg
dpkg -r samba
62
what information is displayed by ps
username; process id; parent process id; tty; cpu time; cpu priority; memory usage; command
63
how do you send a program to the background
ctrl+z
64
what is process signal 1 and what does it do
SIGHUP ; which terminates interactive programs and causes many daemons to reread their configuration files
65
what is process signal 9 and what does it do
SIGKILL ; which causes the process to exit without performing routine shutdown tasks)
66
what is process signal 15 and what does it do
SIGTERM ; which causes the process to exit but allows it to close open files and so on
67
what is process signal SIGHUP and what does it do
1 ; which terminates interactive programs and causes many daemons to reread their configuration files
68
what is process signal SIGHKILL and what does it do
9 ; which causes the process to exit without performing routine shutdown tasks)
69
what is process signal SIGHTERM and what does it do
15 ; which causes the process to exit but allows it to close open files and so on
70
what is an interrupt request
a signal sent to the CPU instructing it to suspend its current activity and to handle some external event such as keyboard input
71
what is IRQ 0
system timer
72
what is IRQ 1
keyboard
73
what is IRQ 2
handles IRQ 8-15
74
what is IRQ 3
COM2
75
what is IRQ 4
COM1
76
what is IRQ 5
LPT2 / Sound card
77
what is IRQ 6
Floppy controller
78
what is IRQ 7
parallel port
79
what is IRQ 8
real time clock
80
what is IRQ 12
ps2 mouse
81
what is IRQ 13
floating point proc
82
what is IRQ 14
primary IDE
83
what is IRQ 15
secondary IDE
84
what are i/o addresses
unique locations in memory that are reserved for communications between the CPU and specific physical hardware devices
85
what is direct memory addressing
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
how does the BIOS boot process begin
the computer reading a boot sector (typically the first sector) from a disk and then executing that code
87
how does the EFI boot process begin
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
what is the HAL Daemon
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
what is the D-Bus
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
what is mbr partition code 0x0c
fat
91
what is mbr partition code 0x05
old extended code
92
what is mbr partition code 0x07
ntfs
93
what is mbr partition code 0x0f
newer extended code
94
what is mbr partition code 0x82
linux swap
95
what is mbr partition code 0x83
linux filesystem
96
what is mbr partition code 0x8e
LVM
97
what directories should never be on a seperate partition from /
``` /bin /dev /etc /lib /sbin ```
98
describe ext2fs
traditional Linux-native filesystem; no journaling
99
describe ext3fs
ext2 with journaling
100
describe ext4fs
ext3 with performance and size extensions
101
describe ReiserFS
designed from scratch as a journaling filesystem for Linux. It's particularly good at handling large numbers of small files (
102
describe JFS
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
describe XFS
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
describe Btrfs
is an advanced filesystem with features inspired by those of Sun's Zettabyte File System (ZFS).
105
describe FAT
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
describe NTFS
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
describe HFS[+]
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
describe ISO-9660
CD-ROMs; Linux Rock Ridge extensions; Joliet Windows extensions
109
describe UDF
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
describe the /etc/fstab file format
``` #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
what does "credentials=/etc/creds" in the options column of the /etc/fstab signify
the login credentials(username and password) are stored in /etc/creds
112
what characters should not be used in filenames
* ? / \ ""
113
what are the wildcard expansion characters
? * [a-z]
114
what are the three timestamps on each file
Last file-modification time Last inode change time Last access time
115
how would you compress ∼/my-work and gzip it into /media/pen/my-work.tgz
tar cvfz /media/pen/my-work.tgz ∼/my-work
116
what are the file type codes displayed by ls -l
- 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
what does the directory execution bit do
When a directory's execute bit is set; that means that the directory's contents may be searched
118
what does the write bit on a directory do
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
what are the permissions of a symlink
always 777 | trying to change it's permissions will affect the file it points to
120
how is set user id represented
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
how is set group id represented
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
how is sticky bit represented
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
what is a typical default umask
002 or 022
124
how would you set the permissions of newly created folders to have rwxrxrx permissions symbolically
umask u=rwx,g=rx,o=rx
125
how would you add user quota support to a mount point in /etc/fstab
/dev/sdc5 /home ext4 usrquota 1 1
126
how would you add group quota support to a mount point in /etc/fstab
/dev/sdc5 /home ext4 grpquota 1 1
127
how would you add user and group quota support to a mount point in /etc/fstab
/dev/sdc5 /home ext4 usrquota,grpquota 1 1
128
what is the old filesystem structure for linux called
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
what is the current filesystem structure
Filesystem Hierarchy Standard (FHS) | Shareable; Unshareable; Static; Variable
130
what are some static shareable directories in FHS
/usr | /opt
131
what are some static unshareable folders in FHS
/etc | /boot
132
what are some variable shareable folders in FHS
/home | /var/mail
133
what are some variable unshareable folders in FHS
/var/run | /var/lock
134
what directories are recommended to have their own partition
``` /boot /home /opt /tmp /usr /usr/local /var ```
135
how does grub legacy start a boot entry
title
136
how does grub 2 start a boot entry
menuentry
137
what is the system logger
syslogd writes files to /var/log/messages /var/log/syslog
138
what are the 3 popular initialization process methods used in linux
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
describe runlevel 0
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
describe runlevel 1
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
describe runlevel 2
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
describe runlevel 3
On Fedora; Mandriva; Red Hat; and most other distributions; a full multi-user mode with a console (nongraphical) login screen.
143
describe runlevel 4
Usually undefined by default and therefore available for customization.
144
describe runlevel 5
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
describe runlevel 6
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
what is a systemd unit
defines a service or action on the system | eg. mount; service; snapshot
147
what are the systemd units
``` automount device mount path service snapshot socket target ```