deck_3562949 Flashcards

1
Q

Check OS version

A

cat /etc/redhat-releaserpm -q centos-release or

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

vi tips - moving the cursor

V - selects entire lines
v - selects range of text

A

:set number | v - copy:set nonumber | p -paste0 - move cursor to start of line | x - cut+paste:0 - first line$ - move cursor to end of line:$ - last linew - next wordb - preceding word

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

toggle between the last two directories

A

cd -

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

Use dirs, pushd and popd

to manipulate directory stack

A

dirspushdpopd

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

vi tips II

% Find matching () { or } d Delete
^l Redraw screen dd Delete line
^r Refresh screen c Change
z Current line at top y

A

ZZ Exit, saving changes t Up to forward Q Enter ex mode T Back up to End of insert | Go to column : Execute ex command w,W Forward one word :! Shell command b,B Back one word ^g Show filename/size e,E End of word ^f Forward one screen ^h Erase last character ^b Back one screen ^w Erase last word ^d Forward half screen ^? Interrupt ^u Backward half screen ~ Toggle character case G Go to line a Append after / Search forward for i,I Insert before ? Search backward for A Append at end of line n Repeat last search o Open line below N Reverse last search O Open line above ]]fGOTO Next section/function r Replace character [[ Previous section/function R Replace characters

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

vi Options:

autoindent Automatic line indentation
autowrite Write before quit
ignorecase Ignore case in searches
number Display line numbers
showmatch Show matches to ) and } as typed
terse

A

q Quit set Enable option q! Quit, discard changes set no Disable option r Read in file set all Show all options sh Invoke shell vi Vi mode wq Write and quit w Write file w! Overwrite file /Emilee Tellez

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

verify syslog is installed

A

rpm -qa | grep syslog

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

verify rsyslog service is set to start

A

chkconfig rsyslog –listchkconfig rsyslog –level 2345 on

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

ls - no details

A

ls -a ls -A (no implicit “.” or “..”)ls -aF (classify ex. “/”)

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

ls group directories first

A

ls –group-directories-first

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

check running level

A

runlevel

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

change running level

A

init 3 (0 - 6)

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

GRUB abbreviation

A

Grand Unified Bootloader

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

grubby –update-kernel=ALL –args=”…”

A

grubby –update-kernel=ALL –args=”video=hyperv_fb:1024x768”

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

check listening ports with netstat

A

netstat -ant (all TCP ports numeric list)

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

check listening ports with list open files

A

lsof -i :8080 (ex port 8080vi /etc/rsysl)

17
Q

restart network service

A

service network restart

18
Q

Hyper-v install cdrom module

A

insmod /lib/modules/$(uname -r)/kernel/drivers/ata/ata_piix.kolsmod | grep piixrmmod …

19
Q

The file contains gateway?!? and host info

A

/etc/sysconfig/network

20
Q

ifconfig add/delete secondary (subinterface) interface

A

ifconfig eth0:0 10.10.20.218 netmask 255.255.255.0 upifconfig eth0:0 del 10.10.20.218

21
Q

ip address add

A

ip address add 192.168.99.37/24 dev eth0you can add more than one IP (the additional become secondary)

22
Q

add a permanent secondary IP

A

cp the existing ifg-ethxthem edit it, removing the gateway and changing the name:DEVICE=eth0:1BOOTPROTO=staticONBOOT=yesIPADDR=10.1.1.2NETMASK=255.255.255.0

23
Q

List all processes

Display tree

A

ps aux | less-A all processesa all proc on term (+ other users)x —||— (w/o controlling ttys)pstreepgrep firefox get process ID by name

24
Q

kill

A

kill PID (simply kill a PID)kill -KILL (bypass the program & send to OS kernel)kill -l list signalskill -0 -HUP (restart daemon w Hang-Up signal)kill -9 -KILL

25
Q

grep (case insensitive)

A

grep -i