Linux Questions Flashcards

(87 cards)

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
searches a local database of files and folders looking for items that match the search criteria.
locate
26
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'
find
27
locates binary source and/or man pages for a command
whereis
28
add a new user command?
adduser or useradd
29
a new user will typically own everything ______ and ______ the new users home directory.
including and beneath
30
Change ownership of the file named myfile to student use:
chown student myfile
31
changes the group ownership
chgrp
32
change the ownership and group ownership of many files at the same time, (only be used by the root user)
chown
33
ability to run commands as the root user without knowing the root password.
sudo
34
sudo users and which commands they can use are kept here.
/etc/sudoers
35
command that lets you edit the sudoers file
visudo
36
Allows us to extend the command to multiple lines- escapes out the enter key
\ (before"enter")
37
disk usage command
df (disk free)
38
disk free human friendly
df -h
39
disk free inodes report
df -i
40
du
displays the number of disk blocks used by directories
41
displays the number of disk blocks used by directories
du
42
encoding information using fewer bits
data compression
43
compression utility on Linux - works on a single file
gzip
44
Changes ownership of the file named student to myfile
chown myfile student
45
To compress a group of files you may have to _____
collect them first with ar
46
other compression utilities on Linux
zip, unzip | bzip 2, bunzip2
47
backs up part or all of your files or filesystems
tar
48
tar will compress/uncompress if you use the ___ option
z
49
schedules a (1) job for future execution
at
50
schedules any number of jobs each at repeated times in the future
crontab
51
files that an administrator uses to control which users can use the cron and at commands
at. deny at. allow cron. deny cron. allow
52
A file is stored in _____________ and then executed at the appropriate time by the ___ daemaon.
/var/spool/at/somename | atd
53
``` shows job number assigned to you (using at) #what is in the queue ```
atq
54
removes at job
atrm (then number of job ie 2)
55
In the past ________ was the packet manager of choice.
rpm (Red Hat Package Manager)
56
_____ extends the capabilities of rpm with additional features that simplifies package management
yum (Yellowdog Updater Modified)
57
One of the original text editors for Unix-like operating systems
vi
58
Successor to the vi text editor. Offers the same functionality plus extra features
vim
59
insert text under cursor in vim
i
60
writes the vim/vi files out to disk without quitting
:w
61
writes the vim/vi files out to disk (save), then quit (same as zz)
:wq
62
to append text to line in vim
shift a
63
to start an empty file in vim or vi, type:
vim (or vi)
64
Any keystroke that is a command for modifying script puts you in insert mode. Press _________ to go to ________ mode in vim.
escape, command
65
quit vim/vi without saving (ex command)
q!
66
When you are in command mode in vim, the following commands will move you into insert or append mode.
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
reads first 20 lines of somefilename
head -n 20 somefilename
68
reads first 10 lines of somefilename
head somefilename
69
reads last 20 lines of somefile
tail -n 20 somefilename
70
reads last 10 lines of somefile
tail somefilename
71
use tail to follow a command as it gets updated example
tail -f /var/log/secure
72
to stop a running tail
Ctrl + C
73
to stop any command that is running at the command prompt
Ctrl + C
74
grep
searches and prints out matches
75
searches and prints out matches
grep
76
grep < >
pattern
77
grep < >
file to search
78
grep ignore case
grep -i < file to search >
79
used to send output of one command as input to another
pipe command |
80
used to redirect standard output to new location
> (writes over) >> (appends)
81
searches for lines that begin with a given word
grep -i '^republic' filename
82
finds lines that begin with a certain character
grep '^[Aa]' filename
83
finds lines that do not begin with a certain character
grep '^[^Aa]' filename
84
finds lines with a certain second character (h)
grep '^.[h]' filename
85
find lines with www followed by anything
grep 'www*' filename
86
Changing user permissions to read and write only user
chmod 600 file or directoryname
87
verify permissions
ls -l