Sei sulla pagina 1di 13

FAQ:

Para saan ito?


Para sa OSYS
Anong oras po?
10am
Anong room?
L303
Pwede po bang ma late?
#Pwede, pwede ka na din mag breakfast.
Hinde.
Which of the following are valid CPU types for Intel-based platforms?
(choose two)

✔ 32 bit
✔ 64 bit

64 bit platforms can access more memory than 32 bit platforms.

✔ True

Which of the following commands will display CPU information?


(choose three)

✔ arch
✔ lscpu
✔ cat /proc/cpuinfo

A CPU flag...

✔ ...defines the features that the CPU supports.

Which command displays information from SMBIOS?

✔ dmidecode
Choose all of the following statements that are true in regard to virtual RAM:
(choose three)

✔ Virtual RAM is used when available physical RAM is low.


✔ Virtual RAM is also called swap space
✔ Virtual RAM is stored on a hard drive

Which of the following are valid partitioning types?


(choose two)

✔ MBR
✔ GPT

The fdisk command is a tool used for working with the MBR partitioned disks.

✔ True

Which of the following is the valid device file name for the first IDE hard drive on the system?

✔ /dev/hda

Which of the following are valid video cable connector types?


(choose two)

✔ VGA
✔ DVI

The echo command:

✔ Is used to output text to the console

A file begins with #!/bin/csh. This means:

✔ Running the script will invoke /bin/csh to interpret the rest of the file

Most of nano’s commands take the form of:


✔ Control and another character

What does this shell script do? FOO=/tmp/foo if [ ! –d $FOO ]; then mkdir $FOO fi

✔ Creates /tmp/foo if it does not exist

Given the following part of a script: if [ -f $1 ]; then echo “I am here” fi What is the meaning of
$1?

✔ It is the first argument passed to the script

What is the correct way to assign the word "Hello" to a variable?

✔ A=”Hello”

What is the correct way to save the current directory to a variable?

✔ A=`pwd`

How would you finish your script with an exit code of 42?

✔ exit 42

The if command looks for what exit code to consider a condition to be true?

✔0

Given the following script: while [ ! –f /tmp/foo ]; do echo –n “.” process_data > /tmp/foo done
Which of the following are true?

(choose two)
✔ If a file called /tmp/foo exists, process_data won’t be run
✔ process_data will be called at most once

Chapter 9:
sh - use to file a script shell command
ex. sh test.sh

nano - use to edit with characters like a notepa


ex. nano test.sh

# - use to make a comment


ex. # this is a comment and it will not execute a command in this line

= - use for assigning a variable with value and needs no spaces between
ex. human=”cancer” for assigning / no spaces between the “=”
ex. if [ $human = “cancer” ] for comparing /must have spaces between every characters
read - like a scanner in a nutshell
ex. read test
echo $test
# see the next line for the sample output
$1 = to call a variable the number “1” can be changed up to 255
ex. $human # it will print the word “cancer” if called and also can be used in boolean

$1 - like command read and used when executing script shell, unlike read it is required when
executing a script.
ex. echo “$1”
username# sh test.sh reeeee
output:
reeeee

-f - file name
ex. touch test.sh
if test -f tesh.sh; then #This is true such that tesh.sh exist
-d directory location
ex. if test -d /home; then #This is true such that tesh.sh exist

-gt - means great than and used in numeric comparison


ex. if test 1 < 1 ; then

-lt - means less than and used in numeric comparison

-eq - means less than and used in numeric comparison

-ne - means not equal and used in numeric comparison

!= - mean not equal and used in String comparison

if - please if you don’t what this is, magshift ka na.

then - use after using if/elif command


ex. if test 1 -eq 1
then
echo “success
fi
# if test 1 -eq 1 ; then // is an alternative and a simplier single code line

fi - to end the if looping condition, done in for and while looping and esac in case looping

example for another loopings


case "$1" in
hello|hi)
echo "hello yourself"
;;
goodbye)
echo "nice to have met you"
echo "I hope to see you again"
;;
*)
# *) means default like in case method in programming languages
echo "I didn't understand that"
esac

SERVERS="servera serverb serverc"


for S in $SERVERS; do
echo "Doing something to $S"
done
# this will print 3x

for S in *; do
echo "Doing something to $S"
done
# “*” is a glob so it will print all your filename/folders at $S

i=0
while [ $i -lt 3 ]; do
echo $i
i=$(( $i + 1))
⁠exit 
done

#it supposed to print 3x but there’s the exit command; it will only print only 1

exit - disregards the remaining ling codes and stops the execution of the shell.
Chapter 10:

CPU
A Central Processing Unit (CPU or processor) is one of the most important hardware
components of a computer. It performs the decision making as well as the calculations that
need to be performed to properly run an operating system. The processor is essentially a
computer chip.

On an x86 system, the system processes data 32 bits at a time;

On a x86_64 the system processes data 64 bits at a time. A x86_64 system is also capable of
also processing data 32 bits at a time in a backward compatible mode. One of the main
advantages to a 64 bit system is that the system is able to work with more memory.

You can see the family your CPU belongs to, using the these three commands:
arch
lscpu
cat /proc/cpuinfo

arch (cmd):

lscpu (cmd)
cat /proc/cpuinfo (cmd and more detailed)

Motherboard and Buses


The motherboard, or system board, is the main hardware board in the computer through which
the CPU, Random Access Memory (RAM) and other components are all connected together.
Some devices are attached directly to the motherboard, while other devices are connected via a
bus to the motherboard.

dmidecode
The system board of many computers contains what is known as Basic Input and Output
System (BIOS). System Management BIOS (SMBIOS) is the standard that defines the data
structures and how to communicate information about computer hardware. The dmidecode
command is able to read and display the information from SMBIOS.
dmidecode (cmd)
lsusb
To display the devices connected to the system via USB, execute the lsusb command:
The verbose option, -v, for the lsusb command shows a great amount of detail about each
device:

lsusb (cmd)
Disk devices (AKA, hard drives)
An old term used to describe an internal hard disk is "fixed disk", as the disk is fixed (not
removable). This term gave rise to several command names: the fdisk, cfdisk and sfdisk
commands, which are tools for working with the MBR partitioned disks.
The GPT disks use a newer type of partitioning, which allows the user to divide the disk into
more partitions than what MBR supports. GPT also allows having partitions which can be larger
than two terabytes (MBR does not). The tools for managing GPT disks are named similar to the
fdisk counterparts: gdisk, cgdisk, and sgdisk.
There is also a family of tools that attempts to support both MBR and GPT type disks. This set
of tools includes the parted command and the graphical gparted tool.

Peripheral Devices

The motherboard has buses that allow for multiple devices to connect to the system, including
the Peripheral Component Interconnect (PCI) and Universal Serial Bus (USB). The motherboard
also has connectors for monitors, keyboards and mice.
In order to view all of the devices connected by the PCI bus, execute the lspci command.
lscpi

Video Display Devices


There are two types of video cables commonly used: the analog 15 pin Video Graphics Array
(VGA) cable and the 29 pin Digital Visual Interface (DVI).

Random Access Memory


The motherboard normally has slots where Random Access Memory (RAM) can be connected
to the system. 32 bit architecture systems can use up to 4 gigabytes (GB) of RAM, while 64 bit
architectures are capable of addressing and using far more RAM.

To view the amount of RAM in your system, including the virtual RAM, execute the free
command. The free command has a -m option to force the output to be rounded to the nearest
megabyte and a -g option to force the output to be rounded to the nearest gigabyte:
chapter 10 keyterms

/dev/
Hardware devices are made available through special files under the /dev directory.

/dev/sd*
Partitions are given unique numbers for each device. For example, if a USB hard drive had two
partitions, they could be associated with the /dev/sda1 and /dev/sda2 device files.

Examples:
/dev/hda /dev/hdb
a = first installed hardware hard drive
b= second installed hardware hard drive

/dev/sda1
1 = partition

driver
Drivers are software programs that allow the operating system to communicate with the device.

optical disks
Optical disks, often referred to as CD-ROMs, DVDs, or Blue-Ray are removable storage media.

partition
Hard drives are divided into partitions. A partition is a logical division of a hard drive, designed to
take a large amount of available storage space and break it up into smaller "chunks".
power supplies
Power supplies are the devices that convert alternating current (120v, 240v) into direct current,
which the computer uses at various voltages (3.3v, 5v, 12v, etc.).

swap
a virtual ram utilized by a hard disk drive but it is much slower than an actual RAM (Random
Access Memory)

Potrebbero piacerti anche