Linux Questions Flashcards

1
Q

$

A

variable Use $ to retrieve the value of a variable, but not to create or change it.

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

/etc/password

A

contains all the accounts on the system -log in name, password info, user id, group id. etc….

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

ln

A

utility is used to create hard links

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

ln -s

A

utility is used to create soft (or symbolic) links

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

The -i option to ls

A

prints out in the first column the inode number

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

cat

A

Used for viewing files that are not very long; it does not provide any scroll-back.

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

tac

A

Used to look at a file backwards, starting with the last line.

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

less

A

Used to view larger files because it is a paging program; it pauses at each screen full of text, provides scroll-back capabilities, and lets you search and navigate within the file. Note: Use / to search for a pattern in the forward direction and ? for a pattern in the backward direction. (An older program named more is still used, but has fewer capabilities.)

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

tail

A

Used to print the last 10 lines of a file by default. You can change the number of lines by doing -n 15 or just -15 if you wanted to look at the last 15 lines instead of the default.

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

head

A

The opposite of tail; by default, it prints the first 10 lines of a file.

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

Displays Linux system information

A

uname -a

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

Displays kernel release information

A

uname -r

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

show which version of redhat is installed

A

cat /etc/redhat-release

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

show how long the system has been running + load

A

uptime

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

show system host name

A

hostname -I

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

show system reboot history

A

last reboot

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

show current date and time

A

date

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

show month;s calendar

A

cal

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

Quotes that contains strings and any variable or commands within them get evaluated or acted on

A

“double quotes”

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

Anything within these quotes gets treated literally, disables any special character functionality

A

‘single quotes’

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

This character disables any special character functionality that immediately follows it

A

\ (ie) $3.00 prints as $3.00 -won’t try to evaluate the 3.00 as a variable

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

_________ quotes around spaces or an escape character preceding a space will be treated literally

A

double quotes (or both double and single quotes)

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

\ (before”enter”)

A

Allows us to extend the command to multiple lines- this escapes out the enter key as the end of the command

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

________________What to do?
________________ How to do it?
________________ What to do it on?

A

Command
-Options
Arguments

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

searches a local database of files and folders looking for items that match the search criteria.

A

locate

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

searches the file system for files that match the search criteria. _____/path/to/folder -name * if we don’t provide a directory here, the command will start in the directory we are in. can give it part of the file name ‘*.xml’

A

find

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

locates binary source and/or man pages for a command

A

whereis

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

add a new user command?

A

adduser or useradd

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

a new user will typically own everything ______ and ______ the new users home directory.

A

including and beneath

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

Change ownership of the file named myfile to student use:

A

chown student myfile

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

changes the group ownership

A

chgrp

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

change the ownership and group ownership of many files at the same time, (only be used by the root user)

A

chown

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

ability to run commands as the root user without knowing the root password.

A

sudo

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

sudo users and which commands they can use are kept here.

A

/etc/sudoers

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

command that lets you edit the sudoers file

A

visudo

36
Q

Allows us to extend the command to multiple lines- escapes out the enter key

A

\ (before”enter”)

37
Q

disk usage command

A

df (disk free)

38
Q

disk free human friendly

A

df -h

39
Q

disk free inodes report

A

df -i

40
Q

du

A

displays the number of disk blocks used by directories

41
Q

displays the number of disk blocks used by directories

A

du

42
Q

encoding information using fewer bits

A

data compression

43
Q

compression utility on Linux - works on a single file

A

gzip

44
Q

Changes ownership of the file named student to myfile

A

chown myfile student

45
Q

To compress a group of files you may have to _____

A

collect them first with ar

46
Q

other compression utilities on Linux

A

zip, unzip

bzip 2, bunzip2

47
Q

backs up part or all of your files or filesystems

A

tar

48
Q

tar will compress/uncompress if you use the ___ option

A

z

49
Q

schedules a (1) job for future execution

A

at

50
Q

schedules any number of jobs each at repeated times in the future

A

crontab

51
Q

files that an administrator uses to control which users can use the cron and at commands

A

at. deny
at. allow
cron. deny
cron. allow

52
Q

A file is stored in _____________ and then executed at the appropriate time by the ___ daemaon.

A

/var/spool/at/somename

atd

53
Q
shows job number assigned to you (using at) 
#what is in the queue
A

atq

54
Q

removes at job

A

atrm (then number of job ie 2)

55
Q

In the past ________ was the packet manager of choice.

A

rpm (Red Hat Package Manager)

56
Q

_____ extends the capabilities of rpm with additional features that simplifies package management

A

yum (Yellowdog Updater Modified)

57
Q

One of the original text editors for Unix-like operating systems

A

vi

58
Q

Successor to the vi text editor. Offers the same functionality plus extra features

A

vim

59
Q

insert text under cursor in vim

A

i

60
Q

writes the vim/vi files out to disk without quitting

A

:w

61
Q

writes the vim/vi files out to disk (save), then quit (same as zz)

A

:wq

62
Q

to append text to line in vim

A

shift a

63
Q

to start an empty file in vim or vi, type:

A

vim (or vi)

64
Q

Any keystroke that is a command for modifying script puts you in insert mode. Press _________ to go to ________ mode in vim.

A

escape, command

65
Q

quit vim/vi without saving (ex command)

A

q!

66
Q

When you are in command mode in vim, the following commands will move you into insert or append mode.

A

A move cursor to end of line
I move cursor to begining of a line
O open a line above where cursor is located
a move cursor to just after current character
i move cursor to just before current character
o open a line below where cursor is located

67
Q

reads first 20 lines of somefilename

A

head -n 20 somefilename

68
Q

reads first 10 lines of somefilename

A

head somefilename

69
Q

reads last 20 lines of somefile

A

tail -n 20 somefilename

70
Q

reads last 10 lines of somefile

A

tail somefilename

71
Q

use tail to follow a command as it gets updated example

A

tail -f /var/log/secure

72
Q

to stop a running tail

A

Ctrl + C

73
Q

to stop any command that is running at the command prompt

A

Ctrl + C

74
Q

grep

A

searches and prints out matches

75
Q

searches and prints out matches

A

grep

76
Q

grep < >

A

pattern

77
Q

grep < >

A

file to search

78
Q

grep ignore case

A

grep -i < file to search >

79
Q

used to send output of one command as input to another

A

pipe command |

80
Q

used to redirect standard output to new location

A

> (writes over) &raquo_space; (appends)

81
Q

searches for lines that begin with a given word

A

grep -i ‘^republic’ filename

82
Q

finds lines that begin with a certain character

A

grep ‘^[Aa]’ filename

83
Q

finds lines that do not begin with a certain character

A

grep ‘^[^Aa]’ filename

84
Q

finds lines with a certain second character (h)

A

grep ‘^.[h]’ filename

85
Q

find lines with www followed by anything

A

grep ‘www*’ filename

86
Q

Changing user permissions to read and write only user

A

chmod 600 file or directoryname

87
Q

verify permissions

A

ls -l