Linux mod 5 Flashcards

(78 cards)

1
Q

A program that provides text only interface for Linux and other UNIX like OSs.

Presents each user with a prompt, executes user commands and supports a custom environment for each user.

A

Shell

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

What does the # symbol indicate in

[root@Linux ~]#

A

Root user

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

What does the $ or % indicate

[bob@localhost ~]$
A

Non-root user

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

What are the different shells available?

A

Bourne Shell (sh)
Tenex C Shell(tcsh)
C Shell (csh)
Bourne-Again Shell (bash)

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

Display on-line manual pages about command.

A

man

Syntax: man

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

Clears the current screen

A

clear

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

Print working directory, displays the current working directory.

A

pwd

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

Displays the UNIX OS variant.

A

uname

uname -a Prints all information

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

Prints or sets the system date and/or time.

A

date

date -s
Sets date to date and time provided.

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

Lists directory contents in a tree-like format.

A

tree

tree -c Turn colorization on
tree -f Append a “/“ for directories

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

Exit the current shell

A

exit

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

Lists contents of a directory

A

ls
ls -l Long-list - shows ownership, permission, and links.
ls -i Inode number in the first field
ls -s number of file system blocks
ls -a List all files including invisible files

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

What are text files are viewed using text viewer utilities?

Don’t change file contents but allow forward and backward navigation as well as search.

A

Pagers

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

Displays text files one screen at a time.

A
less
Options: -b Backwards movement, one page at a time
/ Initiates a search for a string (word)
q Exits from less
SPACE BAR Advances one screen at a time
ENTER Key Advances one line at a time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Works like the less command but with fewer options.

A

more

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

Automatically prints the first 10 lines of a file to standard output.

A

head

Syntax: head

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

Command automatically displays the last 10 lines

A

tail

Syntax: tail

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

Displays file(s) contents to the screen and can concatenate (combine) files.

A

cat

Syntax: cat
cat >

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

Change directory

A

cd
Syntax: cd //
cd

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

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
21
Q

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
22
Q

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
23
Q

Second major hierarchy. User system resources, i.e., 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
24
Q

Shared libraries.

A

/lib

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Device files (block and character).
/dev
26
System administration and configuration files.
/etc
27
User home directories.
/home
28
Optional third-party software.
/opt
29
Processes used by system.
/proc
30
Root user's home directory.
/root
31
Temporaru files used by the system
/tmp
32
Variable size data like that found in log files
/var
33
In UNIX, the | current working directory is displayed using the ___ (print working directory) command.
pwd
34
The _______ is based on the present working directory.
relative path
35
An _______ in UNIX begins at the root ( / ) directory.
absolute path
36
Displays text to standard output.
echo Syntax: echo
37
The path statement is modified using the ____ command
PATH Example:[root@localhost etc]# PATH=$PATH:/usr/demo [root@localhost ~]# echo $PATH
38
All UNIX variances come with a visual editor pre-installed.
vi normally supplied with all UNIX systems requires very little memory uses standard alphanumeric keys for commands Syntax vi
39
Which modes does vi have?
There are only two modes of operation in the vi editor: Command Mode Characters typed perform actions like moving the cursor, cutting or copying text, or searching for a particular text string. vi opens in command mode. Insert Mode Actual text is typed or overwritten.
40
Insertion commands for vi:
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 place copied line onto the existing or next line 5p Places five lines of what was copied, at cursor
41
Deletion commands
x Delete current character r Replace current character dd Delete current line
42
Navigation commands
h Move cursor one place to the left l (lower case 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
43
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.
44
Creates an empty file and is also used to modify a files timestamp.
touch Options: -a Manipulates the file’s access date/time stamp Syntax: touch touch -a YYMMDDHHMM
45
Creates one or more directories
mkdir Options: -p Creates a directory where no parent exists (nested) Syntax: mkdir mkdir -p //
46
Copies files and directories
Options: -r Recursively copy directories. Syntax: cp cp –r
47
Moves or renames files and directories.
mv | Syntax: mv
48
Creates a link between files and directories.
ln Options: -s Creates a symbolic link to another file. Syntax: ln -s
49
Removes a file or a directory with contents if using the -r option.
rm Options: -r Remove a directory and its contents recursively -f Ignore nonexistent files, never prompt (force). Syntax: rm rm -rf
50
Searches a file or files for lines that contain strings of a certain pattern.
grep | Syntax: grep
51
Locates files having certain specified characteristics.
find | Syntax: find -
52
Displays full path (location) or most (shell) commands.
which | Syntax: which
53
Determines file type
file | Syntax: file
54
Displays a snapshot status of active processes. A process running in the background is called a daemon.
``` 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 ```
55
Stops a process from running using its PID
kill Options: -9 Used to kill a stubborn process that won’t die Syntax: kill [option]
56
Stops a process from running using its process name.
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. After modifying a daemon’s configuration file, use pkill -HUP to hang up and restart the daemon with the new configuration. Syntax: pkill [option]
57
Maintains a history file of all commands run by a particular user in that shell.
history history is also used to run previous commands by using an exclamation point (!) followed by the corresponding line number in the history output. Syntax: !
58
Prints the strings of printable characters in a file (not ASCII characters). Useful in determining contents of nono-text files (executables)
strings strings
59
Creates a typescript of the terminal session (everything printed on the terminal). CTRL+d ends the script session. View results using less.
script script
60
Used to switch from the current user account to another. It is often used to switch to root user to perform tasks requiring elevated privileges.
su su
61
Displays who the user is logged in as at this moment (after switching user)
whoami Syntax: whoami
62
Displays user login information including login name, time, terminal, and more.
who Syntax: who
63
Displays information about the user(s) logged in and what they are doing
w
64
_________is used on audio data because some | portions of the data can be thrown away without significant degradation of sound quality.
Lossy Compression
65
______compression creates a file smaller than the original that can later be reconstructed, maintaining all of its data and metadata.
Lossless
66
Compresses files and appends a .gz file extension. The original file is replaces.
gzip Syntax: gzip
67
Decompresses a file that was compressed with gzip.
gunzip | Syntax: gunzip
68
The tape archive ___ command is an archiving utility that has been around since the early days of UNIX and was designed to archive data to a tape drive.
tar
69
Tape archive utility used to archive files to tape or disk.
tar Options: c Create an archive t List table of contents of tar file x Extract, must be in target directory to extract z Compress the archived file using gzip (tarball) v Verbose, list each file as tar reads/writes f Read/write to or from a file C Change to directory Syntax: tar -[options]
70
Schedules a job/process for a one-time execution.
at Syntax: at ENTER at> [CTRL+d] Places the job into the queue and exits
71
Lists user's pending jobs.
atq
72
Deletes user's jobs identified by job number.
atrm
73
Schedules periodic jobs. The cron daemon (crond) checks the /etc/crontab every minute for any jobs that need to run. To create a cron job, the cron table (crontab) is created or modified.
crontab Options: -e Edit the crontab -l List crontab entries
74
Creates a new user or updates default new user information.
useradd Options: -d Specifies the path of the user’s home directory; Linux - users’ home directories are in /home -m Makes a home directory if it doesn’t already exist -n Assigns whatever group is in default Syntax: useradd -d /home/ -m -n
75
Deletes a user account
userdel Options: -r (Recursively) Removes the home directory for specified user Syntax: userdel -r
76
Enables a user to change their password (no user name) or for root to set and modify password settings.
passwd Syntax: passwd
77
Contains the system wide environment and startup programs. When a user logs on to a system for the first time and/or does not have a profile, the settings contained in the systems file are used to create the user’s profile.
/etc/profile
78
``` A tilde (~) references paths that start with a user’s home directory. Depending upon the shell and type of login used, users customize their environment by modifying either ~/.bash_profile,~/.bashrc, or ~/.profile. ```
~/.bashrc