5.4 Flashcards

1
Q

Files in UNIX are treated as ______ meaning they can contain any characters.

A

Byte streams

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

Linux provides a standard hierarchy for all UNIX-like OSs called the ___________. Under this directory structure, all directories and file fall under a root directory.

A

Linux File System Hierarchy

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

In Linux OSs the __ character indicates the root of the file system.

A

( / ) forward slash

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

The system administrator’s (root user) home directory.

A

/root

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

Directory that contains a subdirectory for each user who has logged on to the system.

A

/home

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

Enables each user to save individualized system preferences when logged on.

A

Profiles

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

Contains the system wide environment and startup programs in UNIX.

A

/etc/profile

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

A ___ character references paths that start with a user’s home directory.

A

( ~ ) tilde

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

Directory that contains static files of the boot loader; required to boot the system

A

/boot

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

Directory that contains essential command binaries (e.g., cp, mkdir, ls, less).

A

/bin

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

Directory that contains essential system binaries. Commands intended for use by privileged users (e.g., init, fdisk, ifconfig, lsmod).

A

/sbin

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

Second major hierarchy. User system resources such as user binaries and associated documentation, libraries, and header files.

A

/usr

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

Directory that contains shared libraries.

A

/lib

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

Directory that contains device files (block and character).

A

/dev

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

Directory that contains system administration and configuration files.

A

/etc

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

Directory that contains user home directories

A

/home

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

Directory that contains optional 3rd party software.

A

/opt

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

Directory that contains processes used by the system.

A

/proc

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

Directory that contains the root user’s home directory.

A

/root

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

Directory that contains temporary files used by the system.

A

/tmp

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

Directory that contains variable size data such as log files.

A

/var

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

Which command displays the current working directory in UNIX?

A

/pwd

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

Display text to standard output. (UNIX)

A

echo

Syntax: echo (standard output)

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

Creates a typescript of the terminal session (everything printed on the terminal). CTRL + d ends the script session. View results using less. (UNIX)

A

script

Syntax:
script (filename)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Prints system information. (UNIX)
uname Options: -a (Print all information.)
26
Lists directory contents in a tree-like form . (UNIX)
tree Options: - C (Turn Colorization on) - F (Append a "/" for directories)
27
Lists contents of a directory. (UNIX)
ls Options: - l (Long list - shows ownership, permission, and links) - i (Displays inode number in the first field) - s (Displays number of file system blocks used by file) - a (List all files including invisible files)
28
Creates an empty file. (UNIX)
touch Options: -t (Manipulates the file's access date/time stamp) Syntax: touch (newemptyfile) touch -t YYMMDDHHMM (filename)
29
Creates a link between files or directories. (UNIX)
ln Options: -s (Creates a symbolic link to another file (similar to a shortcut in Windows) ) Syntax: ln -s (filename) (linkname)
30
Copies a file to a file or copies multiple files to a directory. (UNIX)
cp Options: -r (Recursively copy directories.) Syntax: cp (source-filename) (destination-filename) cp -r (source-directory) (destination-directory)
31
Moves or renames files and directories. (UNIX)
mv Syntax: mv (original-filename) (new-filename)
32
Removes an empty directory. (UNIX)
rmdir Syntax: rmdir (emptydirectory)
33
Removes a file (UNIX)
rm Options: - r (Remove a directory and its contents recursively.) - f (Ignore nonexistent files, never prompt (force) Syntax: rm (filename) rm -rf (directory_with_files)
34
A program used to create and modify text files.
Text Editor
35
Unix Text Editor
vi (vee-eye, short for visual)
36
What are three appealing aspects of vi?
* vi is normally supplied with all UNIX systems * vi requires very little memory * vi uses standard alphanumeric keys for commands
37
Creates or edits a text file. (UNIX)
vi Syntax: vi (filename)
38
What are the two modes of operation in the vi editor?
Command mode and Insert Mode
39
Characters typed perform actions like moving cursor, cutting or copying text, or searching for a particular text string. vi opens in this mode.
Command Mode
40
Actual text is typed or overwritten.
Insert Mode
41
What are 7 common Insertion Commands?
i (Insert before cursor) a (Append after cursor) o (Insert below current line) O (Insert above current line) yy (Copy line into memory (yank-yank) ) p (Works with yy to (put) whatever line was copied, onto the existing or next line) 5p (Places five lines of what was copied, at cursor)
42
What are 3 deletion command?
x (Delete current character) r (Replace current character) dd (Delete current line)
43
What are 5 navigation commands?
``` h (Move cursor one place to the left) l (Move cursor one place to the right) j (Move cursor one place down) k (Move cursor one place up) / (Searches within the document for a string) ```
44
What are 3 additional commands?
:set nu (Displays line numbers for each line of text) :(line number) Jumps to a given (line number) :set nonu (Removes line numbers from each line of text)
45
What are 4 exit commands?
:w (Writes (saves) latest changes to the file) :q (Quits, leaving vi open in command mode) :q! (Quits vi without saving changes) :wq! (Saves file and any changes, and quits vi.)
46
What are text viewer programs called?
Pagers
47
Displays file contents one screen at a time. (UNIX)
more Syntax: more (filename)
48
Displays the first 10 lines of a file. (UNIX)
head Syntax: head (filename)
49
Displays the last 10 lines of a file. (UNIX)
tail Syntax: tail (filename)
50
Displays file(s) contents to the screen and can concatenate (combine) files. (UNIX)
cat Syntax: cat (filename) (other_filename) cat (filename1) (filename2) > (bothfiles) cat (filename1) >> (newfile)
51
Locates files having certain specified characteristics. (UNIX)
find Syntax: find (directory_to_start_from) -(options) (patterns)
52
Displays full path (location) of most (shell) commands. (UNIX)
which Syntax: which (command)
53
Displays a snapshot status of active processes. (UNIX)
ps Options: - e (Lists information about every process running) - l (Displays in a long format) - f (Generates a list in full mode format) Syntax: ps -elf
54
A process running in the background is called what?
Daemon
55
Stops a process from running using its PID. (UNIX)
kill Options: -9 (Used to kill a stubborn process that won't die) Syntax: kill [option] (pid)
56
Stops a process from running using its process name. (UNIX)
pkill Options: - 9 (Used to kill a stubborn process that won't die) - HUP (Used to immediately re-spawn a process to effect configuration changes. Stands for Hang-Up) Syntax: pkill [option] (process_name)
57
Maintains a history file of all commands run by a particular user in that shell. (UNIX)
history Syntax: history
58
Character to run a command from the history log. (UNIX)
( ! ) exclamation point Syntax: ! (line number from history command output)
59
Determines file type. (UNIX)
file Syntax: file (filename)
60
Prints the strings of printable characters in a file. (UNIX)
strings Syntax: strings (filename)
61
Displays who the user is logged in as; at this moment (after switching user.) (UNIX)
whoami Syntax: whoami
62
Displays user login information including login name, time, terminal, and more. (UNIX)
who Syntax: who
63
Displays information about the user(s) logged in and what they are doing. (UNIX)
w Syntax: w
64
Prints or sets the system date and/or time. (UNIX)
date Options: -s (date/time) Syntax: date
65
Tape archive utility used to archive files to tape or disk. (UNIX)
tar Options: c (Create) t (List table of contents of tar file) x (Extract, must be in target directory to extract) v (Verbose, list each file as tar reads/write) f (Read/write to or from a file) c (Change to directory) Syntax: tar [options] (destination-file) (source)
66
Compresses files and saves them with a .gz file extension. (UNIX)
gzip syntax: gzip (filename)
67
Decompresses a gzip compressed file. (UNIX)
gunzip Syntax: gunzip (filename)
68
Compresses files and saves them with a .bz2 file extension. (UNIX)
bzip2 Syntax: bzip2 (filename)
69
Decompresses a bzip2 compressed file. (UNIX)
bunzip2 Syntax: bunzip2 (filename)
70
Schedules a job/process for a one-time execution. (UNIX)
at Syntax: at (scheduled time) ENTER at> (Job/process to be performed at the scheduled time) [CTRL + d] (Places the job into the queue.)
71
List user's pending jobs. (UNIX)
atq
72
Deletes user's jobs identified by job number. (UNIX)
atrm
73
Schedules periodic jobs. (UNIX)
crontab Options: - e (Edit the crontab) - l (List crontab entries)