SlideShare a Scribd company logo
Last updated 16/03/2010 21:37
A Guide to Computer Ports
Universal Serial Bus (or USB) Port
Original Universal
Serial Bus Logo
The basic USB
logo
The SuperSpeed USB
Logo
The USB 3.0 Icon The USB 3.0 Icon
A universal serial bus port, introduced around 1997, is the gateway to your computer. It s used to
connect all kinds of external devices, such as external hard drives, printers, mice, scanners and
more. There are normally two half-inch long USB ports on the back of computers built since 1998.
Sometimes there are USB ports built into a hatch on the front of a computer. If you use a USB hub,
you can connect as many as 127 devices to a USB port. It can transfer data to a speed of 12
megabits per second, but those 127 devices have to share that speed. Since USB-compliant
devices can draw power from a USB port only a few power drawing devices can connect at the
same time without the computer system complaining.
In 2003, USB 2.0 connectors were introduced on computers. These transfer data at 480 Mbps.
Older USB devices work with USB 2.0 ports, but at 12 Mbps. USB 2.0 devices also work with older
USB ports, again at the lower speed.
USB 3.0
On September 18, 2007, Pat Gelsinger demonstrated USB 3.0 at
the Intel Developer Forum. The USB 3.0 Promoter Group
announced on November 17, 2008, that version 3.0 of the
specification had been completed and was transitioned to the
USB Implementers Forum (USB-IF), the managing body of USB
specifications. This move effectively opened the spec to hardware
developers for implementation in future products. The first
certified USB 3.0 consumer products were announced January 5,
2010, at the Las Vegas Consumer Electronics Show (CES),
including two motherboards, by ASUS and Gigabyte Technology
Last updated 16/03/2010 21:37
Video DB15 Port - a video port for your monitor
This connector is used to attach a computer display monitor to a
computer s video card. The connector has 15 holes. It sort of looks
like a serial port connector, however that port has pins not holes in it.
Power Connector - for your power plug
This three-pronged plug looks like a recessed power plug. It connects
to the computer s power cable that plugs into a power bar or wall
socket.
Optical Audio (Used by the TOSLINK Cable)
This is an optical (not electrical) cable to connect your compuer to a set
of high-end speakers. The digital format is S/PDIF, which in the PC
world is often sent over a regular electrical cable (usually with an RCA
phono plug).
The geeky advantage of the optical cable (note the red glow) is that it s
totally immune to electromagnetic interference--long speaker wires can
act as an antenna, picking up the stray 60hz hum that pervades the
universe. My powered speaker cables would actually pick up CB radio,
so they d occasionally spit out little snatches of conversation as
truckers would go by. It happened rarely enough that I d begun to
doubt my own sanity before my wife figured out what was going on.
TOSLINK (connects to the Optical Audio Port)
TOSLINK or Optical Cable is a standardized optical fibre connection
system. Its most common use is in consumer audio equipment (via a
digital optical socket), where it carries a digital audio stream between
components such as MiniDisc and CD players and DAT recorders.
Although TOSLINK supports several different media formats and
physical standards, digital audio connections using the rectangular
EIAJ/JEITA RC-5720 (also CP-1201 and JIS C5974-1993 F05) connector
are by far the most common.
Last updated 16/03/2010 21:37
Coaxial Digital (S/PDIF)
S/PDIF is a Data Link Layer protocol and a set of Physical Layer
specifications for carrying digital audio signals between devices
and stereo components over either optical or electrical cable. The
name stands for Sony/Philips Digital Interconnect Format (more
commonly known as Sony Philips Digital InterFace), Sony and Philips
being the primary designers of S/PDIF. S/PDIF is standardized in
IEC 60958 where it is known as IEC 60958 type II. S/PDIF is
essentially a minor modification of the original AES/EBU standard,
for consumer use, providing small differences in the protocol and
requiring less-expensive hardware.
Sound card colour code:
Colour Connector
Lime Green Line-Out, Front Speakers, Headphones
Pink Microphone
Light Blue Stereo Line In
Orange Subwoofer and Center out
Black Rear Surround Speakers for 5.1 and 7.1 systems
Gray Middle Surround Speakers for 7.1 systems
Gold Midi / Game port (Joystick)
Note: The number of jack connectors you ll find on your soundcard will depend on how many
audio channels it has:
Stereo cards with just two audio channels will have only the green (output), blue (input) and
pink (microphone) jacks.
A few sound cards with 8 (7.1) audio channels do not provide the gray (Middle Surround
Speakers) connector. If your computer is equipped with this type of card and you want to use all
the 8 channels you will need to connect your motherboard to a 7.1 home theater system using
the SPDIF digital connector.
Some motherboards with 4 or 6 channels don t have the black (Rear Surround) and orange
(Subwoofer and Center) jacks. These cards will use the blue jack for both line in and rear surround
speakers out, and the pink jack for both mic input and subwoofer/center out. Therefore,
whenever you want to use any of these jacks for a different function, you will have to manually
remove one jack connector and plug in another.
Last updated 16/03/2010 21:37
HDMI Port
HDMI (High-Definition Multimedia Interface) is a compact
audio/video interface for transmitting uncompressed digital data. It
represents a digital alternative to consumer analogue standards,
such as radio frequency (RF) coaxial cable, composite video, S-
Video, SCART, component video, D-Terminal, or VGA. HDMI
connects digital audio/video sources - such as set-top boxes, up
convert DVD players, HD DVD players, Blu-ray Disc players,
personal computers (PCs), video game consoles such as the
PlayStation 3 and Xbox 360, and AV receivers - to compatible
digital audio devices, computer monitors, and digital televisions.[
DVI Port
DVI stands for (D)igital (V)ideo (I)nterface.
DVI is a new form of video interface technology made to maximize the quality of flat panel LCD
monitors and high-end video graphics cards. It is a replacement for the P&D Plug & Display
standard, and a step up from the digital-only DFP format for older flat panels. DVI is becoming
increasingly popular with video card manufacturers, and most cards purchased include both a VGA
and a DVI output port.
More here
Last updated 16/03/2010 21:37
S-VHS
S-VHS (Super VHS) is an improved version of the VHS standard
for consumer video cassette recorders.
It is used to connect to a TV / Monitor.
Ethernet or Network Port - connect to a network and high speed Internet
Above, an Ethernet port with network cable not
plugged in.
Below is an Ethernet port with plug inserted.
For faster Internet connections and for networking, an
Ethernet or network port is used. This looks like an
oversized North American telephone jack.
The port is used to connect network cabling to a
computer. Cable plugged into this port can lead either to a
network hub (a junction box that can wire lots of network
cables together), directly to a cable modem or DSL modem
(both used for high speed Internet) or to an Internet gateway
which shares a fast Internet connection between
computers.
Most newer computers have one of these ports. They can
either be built-in to or appear on the exposed part of an
Ethernet PCI card, which inserts into a slot inside the
computer.
Data moves through them at speeds of either 10 megabits
or 100 megabits or 1 gigabit (1,000 megabits) depending
on what speed the network card in the computer supports.
Little monitor lights on these devices flicker when in use.
The ACT light flickers when data is moving through the
network to or from the port. The 10 or 100 lights relate to
data speed. 10 means data is moving across the
network at 10 Megabits per second. 100 means the
network is moving data at 100 megbits per second.
Last updated 16/03/2010 21:37
SATA
The serial ATA or SATA computer bus, is a storage-interface for
connecting host bus adapters to mass storage devices such as
hard disk drives and optical drives. The SATA host adapter is
integrated into almost all modern consumer laptop computers and
desktop motherboards.
Serial ATA was designed to replace the older ATA (AT
Attachment) standard (also known as EIDE). It is able to use the
same low level commands, but serial ATA host-adapters and
devices communicate via a high-speed serial cable over two pairs
of conductors. In contrast, the parallel ATA (the redesignation for
the legacy ATA specifications) used 16 data conductors each
operating at a much lower speed.
SATA offers several compelling advantages over the older
parallel ATA (PATA) interface: reduced cable-bulk and cost
(reduced from 80 wires to seven), faster and more efficient data
transfer, and hot swapping.
As of 2009, SATA has mostly replaced parallel ATA in all
shipping consumer PCs. PATA remains in industrial and
embedded applications dependent on CompactFlash storage
although the new CFast storage standard will be based on SATA
IEEE 1394 or Firewire Port - fast camcorder connector
This port is used to transfer large amounts of data very quickly. Usually camcorders and other
video equipment use this port to get data onto a computer. Data can move across the port at up to
400 megabits per second. Apple invented this technology and had branded it Firewire. It was also
adopted as an industry standard and is called IEEE 1394 on non-Apple computers. Other
companies call it i.link and Lynx. Creative Labs which incorporated it into their SoundBlaster
Audigy Platinium products call it SB 1394. IEEE 1394 connectors can be used to connect up to 63
external devices to a machine.
TOP: A 6-Pin FireWire 400 connector
Middle: A 4-Pin FireWire 400 connector. This connector is not powered.
Bottom: A 9-Pin FireWire 800 connector
Last updated 16/03/2010 21:37
Modem
Connects a PC s modem to the telephone network. This is an ordinary
phone jack, like you d find in any telephone.
Serial Port - for external modems and old computer mice
A serial port is used to connect external modems or an older
computer mouse to the computer. It comes in two versions a 9-
pin version or a 25-pin model. The 9-pin is found on most newer
computers. Data travels over a serial port at 115 kilobits per
second.
Parallel Port - connector for scanners and printers
A parallel port is used to connect external devices such as
scanners and printers. The 25-pin port is sometimes it is
called a printer port. It s also known by the gruesome named:
IEEE 1284-compliant Centronics port.
The port is sometimes also called more simply a printer
port. There are two variants for this type of interface. The
ports look exactly like the traditional parallel port but are
called ECP (Extend Capabilities Port) and EPP (Enhanced
Parallel Port). These interfaces are ten times faster than the
older printer port and can support two-way data so that
computers can ask for information from a printer as well as
send it.
PS/2 Port - keyboard and mouse interface
A PS/2 port, sometimes called a mouse port, was developed by
IBM. It is used to connect a computer mouse or keyboard. Most
computers come with two PS/2 ports.
Sometimes webcams piggyback on the ports in conjunction with a
parallel port. Sometimes it is not necessary to use a mouse port,
as some keyboards and mice can be used with a USB port.
Last updated 16/03/2010 21:37
AT Keyboard Port
Connect a PC to an older keyboard. If you don t plug in a keyboard here,
you get the famous BIOS boot error:
Keyboard not found. Press F1 to continue.
This giant port is a holdover from the ancient IBM PC AT.
It s apparently physically the same connector found on MIDI synthesizers
and instruments, although it s electrically totally different.
Gameport
Connect a PC to a joystick (or two). This port is now mostly
replaced by USB.
This DB-15 connector has several (extremely primitive) analogue
inputs and a small number of digital inputs and outputs.
Because the MIDI (Musical Instrument Digital Interface) standard
scavenged two pins from this port, the port is almost always
located on the sound card. Apparently people that use MIDI
normally have some sort of big ugly dongle that extracts MIDI
signals from their joystick port.
SCSI
Short for Small Computer System Interface, SCSI pronounced as
Scuzzy is the second most commonly used interface for disk
drives. Unlike competing standards SCSI is capable of
supporting eight devices or sixteen devices with Wide SCSI.
SCSI-1 is the original SCSI standard developed back in 1986 as
ANSI X3.131-1986. SCSI-1 is capable of transferring up to eight
bits a second
SCSI-2 approved in 1990 SCSI-2 added new features such as
Fast and Wide SCSI, support for additional devices,
SCSI-3 was approved in 1996 as ANSI X3.270-1996
SCSI is a standard for parallel interface that transfers information
at rate of eight bits per second and faster which is faster than the
average parallel interface. SCSI-2 and above supports up to
seven peripheral devices , such as a hard drive, CD-ROM, and
scanner can attach to a single SCSI port on a system s bus.
SCSI ports were designed for Apple Macintosh and Unix
computers, but also can be used with PCs.
http://www.cablestogo.com/resources/connector_guide.asp?
RJ45 Cable Wiring: T-568-B Straight-
through & Crossover RJ-45 cabling
RJ-45 conductor data cable contains 4 pairs of wires each consists of a solid colored wire and
a strip of the same color. There are two wiring standards for RJ-45 wiring: T-568A and T-
568B. Although there are 4 pairs of wires, 10BaseT/100BaseT Ethernet uses only 2 pairs:
Orange and Green. The other two colors (blue and brown) may be used for a second
Ethernet line or for phone connections. The two wiring standards are used to create a
cross-over cable (T-568A on one end, and T-568B on the other end), or a straight-
through cable (T-568B or T-568A on both ends).
To create a straight-through cable, you'll have to use
either T-568A or T-568B on both ends of the cable.
The diagram depicted on the left and right shows clip
of the RJ-45 connector down.
To create a cross-over cable, you'll wire T-568A on
one end and T-568B on the other end of the cable.
The straight-through cables are used when connecting
Data Terminating Equipment (DTE) to Data
Communications Equipment (DCE), such as computers
and routers to modems (gateways) or hubs (Ethernet
Switches). The cross-over cables are used when
connecting DTE to DTE, or DCE to DCE equipment;
such as computer to computer, computer to router; or
gateway to hub connections. The DTE equipment
terminates the signal, while DCE equipment do not.
More on straight-through and cross-over connections
The RJ45 data cables we use to connect computers to a Ethernet switch is straight-through
cables. As noted above, the RJ45 cable uses only 2-pairs of wires: Orange (pins 1 & 2) and
Green (pins 3 & 6). Pins 4, 5 (Blue) and 7, 8 (Brown) are NOT used. Straight-through cable,
as its name suggests, connects pin 1 to pin 1, pin 2 to pin 2, pin 3 to pin 3, and pin 6 to pin 6.
Cross-over cables are used to connect TX+ to RX+, and TX- to RX-, which connects pin 1 to
pin 3, pin 2 to pin 6, pin 3 to pin 1 and pin 6 to pin 2. The unused pins are generally
connected straight-through in both straight-through and cross-over cables.
To network two computers without a hub, a cross-over cable is used. Cross-over cable is also
used to connect a router to a computer, or ethernet switch (hub) to another ethernet switch
without an uplink. Most ethernet switches today provide an uplink port, which prevents a use
of cross-over cable to daisy chain another ethernet switch. Straight-through cables are used to
connect a computer to an ethernet switch, or a router to an ethernet switch.
Pin Number Designations
There are pin number designations for each color in T-568B and T-568A.
T-568B T-568A
-------------------------- ------------------------
Pin Color Pin Name Color Pin Name
--- ------------- -------- ------------- --------
1 Orange Stripe Tx+ Green Stripe Rx+
2 Orange Tx- Green Rx-
3 Green Stripe Rx+ Orange Stripe Tx+
4 Blue Not Used Blue Not Used
5 Blue Stripe Not Used Blue Stripe Not Used
6 Green Rx- Orange Tx-
7 Brown Stripe Not Used Brown Stripe Not Used
8 Brown Not Used Brown Not Used
RJ45 Color-Coded Scheme
RJ45 cables have 8 color-coded wires, and the plugs have 8 pins and conductors. Eight wires
are used as 4 pairs, each representing positive and negative polarity. The most commonly
used wiring standard for 100baseT is T-586B stanrard described above. Prior to EIA 568A
and 568B standards, the color-coded scheme was used to wire RJ45 cables. The table below
depicts pin and color schemes used in traditional and standardized setup.
Pin Colored Scheme T-568B (Common) T-568A
1 Blue Orange Stripe Green Stripe
2 Orange Orange Green
3 Black Green Stripe Orange Stripe
4 Red Blue Blue
5 Green Blue Stripe Blue Stripe
6 Yellow Green Orange
7 Brown Brown Stripe Brown Stripe
8 White (or Grey) Brown Brown
RJ-45 Wiring FAQ
1. What are T-568A and T-568B wiring standards, and
how are they different?
T-568A and T-568B are the two wiring standards for RJ-45 connector data cable specified by
TIA/EIA-568-A wiring standards document. The difference between the two is the position
of the orange and green wire pairs. It is preferable to wire to T-568B standards if there is no
pre-existing pattern used within a building.
2. What is RJ stands for?
RJ stands for Registered Jacks. These are used in telephone and data jack wiring registered
with FCC. RJ-11 is a 6-position, 4-conductor jack used in telephone wiring, and RJ-45 is a 8-
position, 8-conductor jack used in 10BaseT and 100BaseT ethernet wiring.
3. What is the Category Rating System?
Electronic Industries Association (EIA) developed the TIA/EIA-568-A standard, which
specifies wiring and performance standards for Unshielded Twisted Pair (UTP) cabling.
Category Rating System specifies the definition of performance categories for 100 ohm UTP
cabling system.
Category 3 specifies the twisted pair cable and connecting hardware that can support
transmission frequency up to 16MHz, and data rates up to 10Mbps. This is primarily used in
telephone wiring.
Category 4 specifies cables and connectors that supports up to 20MHz and data rates up to
16Mbps. With introduction of category 5, this is a rarely used category.
Category 5 specifies cables and connectors that supports up to 100MHz and data rates up to
100Mbps. With 100BaseT Ethernet today, Category 5 is a widely used cabling system that
matches todays high-speed data requirements.
Category TIA/EIA Standard Description
Cat 1 None POTS, ISDN and doorbell wiring
Cat 2 None 4 Mbps token ring networks
Cat 3 TIA/EIA 568-B 10 Mbps Ethernet - frequency up to 16MHz
Cat 4 None 16 Mbps token ring networks - frequency up to 20MHz
Cat 5 None
100 Mbps Ethernet - frequency up to 100 MHz
Not suitable for GigE (1000BaseT)
Cat 5e TIA/EIA 568-B 100 Mbps & GigE Ethernet - frequency up to 100 MHz
Cat 6 TIA/EIA 568-B
2x Performance of Cat 5 & 5e - frequency up to 250
MHz
Cat 6a None Future specification for 10Gbps application
Cat 7
ISO/IEC 11801 Class
F
Designed for transmission at frequencies up to 600
MHz
4. What is UTP Cable?
UTP stands for Unshielded Twisted Pair. It is the cabling system with one or more pairs of
twisted insulated copper wires contained in a single sheath. It is the most widely used cabling
system in telecommunications and data communications environment today.
What is the difference between Cross Cable and Straight Cable
Now days, LAN card has intelligence, so that both cables can work.
They have a feature on lots of switches and hubs etc called "auto-mdix" or
cable you use, it will just auto detect the proper connection type no matter
which cable you use.
The cable can be categorized as Cat 5, Cat 5e, and Cat 6 UTP cable. Cat 5
UTP cable can support 10/100 Mbps Ethernet network, whereas Cat 5e and
Cat 6 UTP cable can support Ethernet network running at 10/100/1000
Mbps. You might hear about Cat 3 UTP cable, it's not popular anymore since
it can only support 10 Mbps Ethernet network.
Straight and crossover cable can be Cat3, Cat 5, Cat 5e or Cat 6 UTP cable,
the only difference is each type will have different wire arrangement in the
cable for serving different purposes.
Ethernet network cables are straight and crossover cable. This Ethernet
network cable is made of 4 pair high performance cable that consists of
twisted pair conductors that used for data transmission. Both end of cable is
called RJ45 connector.
There are two types of network cables commonly used in PC networks -
Straight-through and cross-over.
Straight Cable
Usually use straight cable to connect different type of devices. This type of
cable will be used most of the time and can be used to:
1) Connect a computer to a switch/hub's normal port.
2) Connect a computer to a cable/DSL modem's LAN port.
3) Connect a router's WAN port to a cable/DSL modem's LAN port.
4) Connect a router's LAN port to a switch/hub's uplink port. (Normally used
for expanding network)
5) Connect two switches/hubs with one of the switch/hub using an uplink
port and the other one using normal port.
If you need to check how straight cable looks like, it's easy. Both sides (side
A and side B) of cable have wire arrangement with same color.
Crossover Cable
Sometimes you will use crossover cable, it's usually used to connect same
type of devices. A crossover cable can be used to:
1) Connect two computers directly.
2) Connect a router's LAN port to a switch/hub's normal port. (Normally used
for expanding network)
3) Connect two switches/hubs by using normal port in both switches/hubs.
In you need to check how crossover cable looks like, both side (side A and
side B) of cable have wire arrangement with following different color.
This cable (either straight cable or cross cable) has total 8 wires (or we can
say lines), i.e. four twisted pairs (4x2=8) with different color codes. Right
the cable (but there is a standard).
In straight cable connectivity is like as follows
RJ451 Connected to RJ452
Pin1------------------------------------- Pin1
Pin2------------------------------------- Pin2
Pin3------------------------------------- Pin3
Pin4------------------------------------- Pin4
Pin5------------------------------------- Pin5
Pin6------------------------------------- Pin6
Pin7------------------------------------- Pin7
Pin8------------------------------------- Pin8
In cross cable connectivity is like as follows
RJ451 Connected to RJ452
Pin1------------------------------------- Pin3
Pin2------------------------------------- Pin6
Pin3------------------------------------- Pin1
Pin4------------------------------------- Pin4
Pin5------------------------------------- Pin5
Pin6------------------------------------- Pin2
Pin7------------------------------------- Pin7
Pin8------------------------------------- Pin8
Purpose of this cross cable is RX (receiving terminal) connects to TX
(transmitting) of one pc to another PC and vice versa.
As we use two PCs (same devices), straight cable will connect TX to TX and
RX to RX of two computers, so cross cable is required. If you use HUB or
switch, then straight cable will work because it has internal arrangement like
cross cable. So note that use cross cable to connect two similar devices.
A straight cable will not work to connect two computers together.
Crossover used to connect to PCs directly together, also used for connecting
networking devices together like Switch to Switch etc.
Straight cables connect two DIFFERENT types of devices. Whereas crossover
cables connect two of the SAME type
Now do this (if possible): connect cross cable between switch and PC and see
what happens..!
Hub Switch Router Workstation
Hub Crossover Crossover Straight Straight
Switch Crossover Crossover Straight Straight
Router Straight Straight Crossover Crossover
Workstation Straight Straight Crossover Crossover
-----------------------------------------------------------------------------------------------
Communication between Switches and Workstations
When a workstation connects to a LAN, it transmits data independently of the
other devices connected to the LAN media. The workstation simply transmits data
frames from a NIC to the network medium.
If desired, the workstation can be attached directly to another workstation by
using a crossover cable. Crossover cables connect the following devices:
Workstation to workstation
Switch to switch
Switch to hub
Hub to hub
Router to router
Router to PC
Straight-through cables connect the following devices:
Switch to router
Switch to workstation or server
Hub to workstation or server
Many modern switches now automatically adjust the port pinout to support the
particular cable attached, whether it is a crossover or straight-through cable.
Switches, which are Layer 2 devices, use intelligence to learn the MAC addresses of
the devices that are attached to its ports. This data is entered into a switching
table. After the table is complete, the switch can read the destination MAC
address of an incoming data frame on a port and immediately forward it. Until a
device transmits, the switch does not know its MAC address.
Switches provide significant scalability on a network. Switches are normally
connected to each other by way of trunk links.
-----------------------------------------------------------------------------------------
IP	address	classes	
Class
1st
Octet
Decimal
Range
1st
Octet
High
Order Bits
Network/Host ID
(N=Network,
H=Host)
Default Subnet
Mask
Number of
Networks
Hosts per
Network (Usable
Addresses)
A 1 126* 0 N.H.H.H 255.0.0.0 126 (27
2)
16,777,214 (224
2)
B 128 191 10 N.N.H.H 255.255.0.0
16,382 (214
2)
65,534 (216
2)
C 192 223 110 N.N.N.H 255.255.255.0
2,097,150
(221
2)
254 (28
2)
D 224 239 1110 Reserved for Multicasting
E 240 254 1111 Experimental; used for research
Note: Class A addresses 127.0.0.0 to 127.255.255.255 cannot be used and is reserved for
loopback and diagnostic functions.
Private	IP	Addresses	
Class Private Networks Subnet Mask Address Range
A 10.0.0.0 255.0.0.0 10.0.0.0 - 10.255.255.255
B 172.16.0.0 - 172.31.0.0 255.240.0.0 172.16.0.0 - 172.31.255.255
C 192.168.0.0 255.255.0.0 192.168.0.0 - 192.168.255.255
Objective 3.1: Install, configure, and differentiate between common network
devices
Network switches
Computer networking devices are units that mediate data in a computer network and are also
called network equipment. Units which are the last receiver or generate data are called hosts
or data terminal equipment.
Hub	
Hubs connect computers together in a star topology network. Due to their design, they
increase the chances for collisions. Hubs operate in the physical layer of the OSI model and
have no intelligence. Hubs flood incoming packets to all ports all the time. For this reason, if
a network is connected using hubs, the chances of a collision increases linearly with the
number of computers (assuming equal bandwidth use). Hubs pose a security risk since all
packets are flooded to all ports all the time. If a user has packet sniffing software, they can
extract data from the network and potentially decode it and use it. Hubs make it easy to "spy"
on users on the same LAN as you.
Repeater	
A wireless repeater.
A repeater is an electronic device that receives a signal and retransmits it at a higher level
and/or higher power, or onto the other side of an obstruction, so that the signal can cover
longer distances without degradation. Because repeaters work with the actual physical signal,
and do not attempt to interpret the data being transmitted, they operate on the physical layer,
the first layer of the OSI model. Repeaters are majorly employed in long distance
transmission to reduce the effect of attenuation. It is important to note that repeaters do not
amplify the original signal but simply regenerate it.
Modem	
Modem (from modulator-demodulator) is a device that turns the digital 1s and 0s of a
personal computer into sounds that can be transmitted over the telephone lines of Plain Old
Telephone Systems (POTS), and once received on the other side, converts those sounds back
into a form used by a USB, Ethernet, serial, or network connection. Modems are generally
classified by the amount of data they can send in a given time, normally measured in bits per
second, or "bps".
NIC	(Network	Interface	Card)	
A network interface card is a computer hardware component designed to allow computers to
communicate over a computer network. It is both an OSI layer 1 (physical layer) and layer 2
(data link layer) device, as it provides physical access to a networking medium and provides a
low-level addressing system through the use of MAC addresses. It allows users to connect to
each other either by using cables or wirelessly. Most motherboards today come equipped with
a network interface card in the form of a controller, with the hardware built into the board
itself, eliminating the need for a standalone card.
Media	converters	
Media converters are simple networking devices that make it possible to connect two
dissimilar media types such as twisted pair with fiber optic cabling. They were introduced to
the industry nearly two decades ago, and are important in interconnecting fiber optic cabling-
based systems with existing copper-based, structured cabling systems. Media converters
support many different data communication protocols including Ethernet, T1/E1, T3/E3, as
well as multiple cabling types such as coaxial, twisted pair, multimode and single-mode fiber
optics. When expanding the reach of a Local Area Network to span multiple locations, media
converters are useful in connecting multiple LANs to form one large "campus area network"
that spans over a limited geographic area. As local networks are primarily copper-based,
media converters can extend the reach of the LAN over single-mode fiber up to 130
kilometers with 1550 nm optics.
Basic	switch	
Switches are often confused with bridges because they also operate at the data link layer of
the OSI model. Similar to a hub, switches provide a central connection between two or more
computers on a network, but with some intelligence. They provide traffic control for packets;
rather than forwarding data to all the connected ports, a switch forwards data only to the port
on which the destination system is connected. They use a database of MAC addresses to
determine where computers are located and very efficiently send packets only where they
need to go. The database is created dynamically as computers communicate on the network.
The switch simply watches the incoming packets and memorizes the MAC address and port a
packet arrives on. If a packet arrives with a destination computer that the switch does not
have an address for in its MAC address table, it will flood the packet out all connected ports.
A switch creates separate collision domains for each physical connection. A switch will only
create separate broadcast domains if separate VLANs (Virtual Local Area Networks) are
assigned to different ports on the switch. Otherwise, a broadcast received on one port will be
flooded out all ports except the one it came in on.
Bridge	
Bridges can be identified by the fact that they operate at the data link layer of the OSI model.
Bridges have intelligence and can "bridge" two of their ports together at very high speed.
They use a database of MAC addresses to determine where computers are located and very
efficiently send frames only where they need to go. The database is created dynamically as
computers communicate on the network. A bridge simply watches the incoming frame and
memorizes the MAC address and port a frame arrives on. It uses this information to locate a
computer if a packet comes in that must be forwarded to it. If a frame arrives at the bridge
and the bridge does not know where to send it, the bridge will flood the frame just like a hub
does. Bridging is often inaccurately called switching.
Wireless	access	point	
A wireless access point (WAP or AP) is a device that allows wireless communication devices
to connect to a wireless network using Wi-Fi, Bluetooth or related standards. The WAP
usually connects to a wired network, and can relay data between the wireless devices (such as
computers or printers) and wired devices on the network.
A typical corporate use involves attaching several WAPs to a wired network and then
providing wireless access to the office Local Area Network. Within the range of the WAPs,
the wireless end user has a full network connection with the benefit of mobility. In this
instance, the WAP functions as a gateway for clients to access the wired network.
A Hot Spot is a common public application of WAPs, where wireless clients can connect to
the Internet without regard for the particular networks to which they have attached for the
moment. The concept has become common in large cities, where a combination of
coffeehouses, libraries, as well as privately owned open access points, allow clients to stay
more or less continuously connected to the Internet, while moving around. A collection of
connected Hot Spots can be referred to as a lily-pad network.
Home networks generally have only one WAP to connect all the computers in a home. Most
are wireless routers, meaning converged devices that include a WAP, router, and often an
Ethernet switch in the same device. Many also converge a broadband modem. In places
where most homes have their own WAP within range of the neighbors' WAP, it's possible for
technically savvy people to turn off their encryption and set up a wireless community
network, creating an intra-city communication network without the need of wired networks.
Basic	router
Routers operate at the network layer of the OSI model and efficiently route information
between Local Area Networks. Since routers operate in the third layer, the network layer,
they must understand layer 3 addressing... such as TCP/IP. A router will divide a broadcast
domain by not forwarding broadcasts on one connected network to another connected
network. Routers operate in two different planes: the control plane, in which the router learns
the outgoing interface that is most appropriate for forwarding specific packets to specific
destinations, and the forwarding plane, which is responsible for the actual process of sending
a packet received on a logical interface to an outbound logical interface.
Basic	firewall	
A firewall is a part of a computer system or network that is designed to block unauthorized
access while permitting outward communication. It is also a device or set of devices
configured to permit, deny, encrypt, decrypt, or proxy all computer traffic between different
security domains based upon a set of rules and other criteria.
Firewalls can be implemented in both hardware and software, or a combination of both.
Firewalls are frequently used to prevent unauthorized Internet users from accessing private
networks connected to the Internet. All messages entering or leaving the Local Area Network
pass through the firewall, which examines each message and blocks those that do not meet
the specified security criteria. Without proper configuration, a firewall can often become
worthless. Standard security practices dictate a "default-deny" firewall ruleset, in which the
only network connections which are allowed are the ones that have been explicitly allowed.
Basic	DHCP	(Dynamic	Host	Configuration	Protocol)	server	
When a DHCP-configured client (be it a computer or any other network-aware device)
connects to a network, the DHCP client sends a broadcast query requesting necessary
information from a DHCP server. The DHCP server manages a pool of IP addresses and
information about client configuration parameters such as the default gateway, the domain
name, the DNS (Domain Name System) servers, other servers such as time servers, and so
forth. Upon receipt of a valid request the server will assign the computer an IP address, a
lease (the length of time for which the allocation is valid), and other IP configuration
parameters, such as the subnet mask and the default gateway. The query is typically initiated
immediately after booting and must be completed before the client can initiate IP-based
communication with other hosts.
Basic	Network	Commands	
Table of Contents
13.1 ping
13.2 traceroute
13.3 DNS Tools
13.4 finger
13.5 telnet
13.6 The Secure shell
13.7 email
13.8 Browsers
13.9 FTP Clients
13.10 Talking to Other People
A network consists of several computers connected together. The network can be as simple as
a few computers connected in your home or office, or as complicated as a large university
network or even the entire Internet. When your computer is part of a network, you have
access to those systems either directly or through services like mail and the web.
There are a variety of networking programs that you can use. Some are handy for performing
diagnostics to see if everything is working properly. Others (like mail readers and web
browsers) are useful for getting your work done and staying in contact with other people.
1	ping	
ping(8) sends an ICMP ECHO_REQUEST packet to the specified host. If the host responds,
machine is alive. If there is no response, you know something is wrong. Here is an example
conversation between two Linux users:
User A: Loki's down again.
User B: Are you sure?
User A: Yeah, I tried pinging it, but there's no response.
It's instances like these that make ping a very useful day-to-day command. It provides a very
quick way to see if a machine is up and connected to the network. The basic syntax is:
% ping www.slackware.com
There are, of course, several options that can be specified. Check the ping(1) man page for
more information.
2	traceroute	
Slackware's traceroute(8) command is a very useful network diagnostic tool. traceroute
displays each host that a packet travels through as it tries to reach its destination. You can see
om the Slackware web site you are with this command:
% traceroute www.slackware.com
Each host will be displayed, along with the response times at each host. Here is an example
output:
% traceroute www.slackware.com
traceroute to www.slackware.com (204.216.27.13), 30 hops max, 40 byte
packets
1 zuul.tdn (192.168.1.1) 0.409 ms 1.032 ms 0.303 ms
2 207.171.227.254 (207.171.227.254) 18.218 ms 32.873 ms 32.433 ms
3 border-sf-2-0-4.sirius.com (205.134.230.254) 15.662 ms 15.731 ms 16.142
ms
4 pb-nap.crl.net (198.32.128.20) 20.741 ms 23.672 ms 21.378 ms
5 E0-CRL-SFO-03-E0X0.US.CRL.NET (165.113.55.3) 22.293 ms 21.532 ms 21.29
ms
6 T1-CDROM-00-EX.US.CRL.NET (165.113.118.2) 24.544 ms 42.955 ms 58.443
ms
7 www.slackware.com (204.216.27.13) 38.115 ms 53.033 ms 48.328 ms
DNS	Tools	
Domain Name Service (DNS for short) is that magical protocol that allows your computer to
turn meaningless domain names like www.slackware.com into meaningful IP address like
64.57.102.34. Computers can't route packets to www.slackware.com, but they can route
packets to that domain name's IP address. This gives us a convenient way to remember
machines. Without DNS we'd have to keep a mental database of just what IP address belongs
to what computer, and that's assuming the IP address doesn't change. Clearly using names for
computers is better, but how do we map names to IP addresses?
13.3.1	host	
host(1) can do this for us. host is used to map names to IP addresses. It is a very quick and
simple utility without a lot of functions.
% host www.slackware.com
www.slackware.com is an alias for slackware.com.
slackware.com has address 64.57.102.34
But let's say for some reason we want to map an IP address to a domain name; what then?
13.3.2	nslookup	
nslookup is a tried and true program that has weathered the ages. nslookup has been
deprecated and may be removed from future releases. There is not even a man page for this
program.
% nslookup 64.57.102.34
Note: nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead. Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Server: 192.168.1.254
Address: 192.168.1.254#53
Non-authoritative answer:
www.slackware.com canonical name = slackware.com.
Name: slackware.com
Address: 64.57.102.34
13.3.3	dig	
The meanest dog in the pound, the domain information groper, dig(1) for short, is the go-to
program for finding DNS information. dig can grab just about anything from a DNS server
including reverse lookups, A, CNAME, MX, SP, and TXT records. dig has many command
line options and if you're not familiar with it you should read through it's extensive man page.
% dig @192.168.1.254 www.slackware.com mx
; <<>> DiG 9.2.2 <<>> @192.168.1.254 www.slackware.com mx
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26362
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;www.slackware.com. IN MX
;; ANSWER SECTION:
www.slackware.com. 76634 IN CNAME slackware.com.
slackware.com. 86400 IN MX 1 mail.slackware.com.
;; AUTHORITY SECTION:
slackware.com. 86400 IN NS ns1.cwo.com.
slackware.com. 86400 IN NS ns2.cwo.com.
;; ADDITIONAL SECTION:
ns1.cwo.com. 163033 IN A 64.57.100.2
ns2.cwo.com. 163033 IN A 64.57.100.3
;; Query time: 149 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Sat Nov 6 16:59:31 2004
;; MSG SIZE rcvd: 159
This should give you an idea how dig works.
the type of lookup I am performing. The above query tells me that e-mail to
www.slackware.com will instead be sent to mail.slackware.com for delivery.
4	finger	
finger(1) will retrieve information about the specified user. You give finger a username or
an email address and it will try to contact the necessary server and retrieve the username,
office, telephone number, and other pieces of information. Here is an example:
% finger johnc@idsoftware.com
finger
finger server.
The one included with Slackware returns the following information by default:
Username
Room number
Home phone number
Work phone number
Login status
Email status
Contents of the .plan file in the user's home directory
Contents of the .project file in the user's home directory
The first four items can be set with the chfn command. It stores those values in the
/etc/passwd file. To change the information in your .plan or .project file, just edit them
with your favorite text editor. They must reside in your home directory and must be called
.plan and .project.
Many users finger their own account from a remote machine to quickly see if they have new
email. Or, you can see a user's plan or current project.
5	telnet	
Someone once stated that telnet(1) was the coolest thing he had ever seen on computers.
The ability to remotely log in and do stuff on another computer is what separates Unix and
Unix-like operating systems from other operating systems.
telnet allows you to log in to a computer, just as if you were sitting at the terminal. Once
your username and password are verified, you are given a shell prompt. From here, you can
do anything requiring a text console. Compose email, read newsgroups, move files around,
and so on. If you are running X and you telnet to another machine, you can run X programs
on the remote computer and display them on yours.
To login to a remote machine, use this syntax:
% telnet <hostname>
If the host responds, you will receive a login prompt. Give it your username and password.
That's it. You are now at a shell. To quit your telnet session, use either the exit command or
the logout command.
telnet does not encrypt the information it sends. Everything is sent in plain text, even
passwords. It is not advisable to use telnet over the Internet. Instead, consider the
Secure Shell. It encrypts all traffic and is available for free.
13.5.1	The	other	use	of	telnet	
Now that we have convinced you not to use the telnet protocol anymore to log into a remote
machine, we'll show you a couple of useful ways to use telnet.
You can also use the telnet command to connect to a host on a certain port.
% telnet <hostname> [port]
This can be quite handy when you quickly need to test a certain service, and you need full
control over the commands, and you need to see what exactly is going on. You can
interactively test or use an SMTP server, a POP3 server, an HTTP server, etc. this way.
In the next figure you'll see how you can telnet to a HTTP server on port 80, and get some
basic information from it.
Figure 13-1. Telnetting to a webserver
% telnet store.slackware.com 80
Trying 69.50.233.153...
Connected to store.slackware.com.
Escape character is '^]'.
HEAD / HTTP/1.0
HTTP/1.1 200 OK
Date: Mon, 25 Apr 2005 20:47:01 GMT
Server: Apache/1.3.33 (Unix) mod_ssl/2.8.22 OpenSSL/0.9.7d
Last-Modified: Fri, 18 Apr 2003 10:58:54 GMT
ETag: "193424-c0-3e9fda6e"
Accept-Ranges: bytes
Content-Length: 192
Connection: close
Content-Type: text/html
Connection closed by foreign host.
%
You can do the same for other plain-text protocols, as long as you know what port to connect
to, and what the commands are.
6	The	Secure	shell	
Today, secure shell basks in the adoration that telnet once enjoyed. ssh(1) allows one to
make a connection to a remote machine and execute programs as if one were physically
present; however, ssh encrypts all the data travelling between the two computers so even if
others intercept the conversation, they are unable to understand it. A typical secure shell
connection follows.
% ssh carrier.lizella.net -l alan
The authenticity of host 'carrier.lizella.net (192.168.1.253)' can't be
established.
RSA key fingerprint is 0b:e2:5d:43:4c:39:4f:8c:b9:85:db:b2:fa:25:e9:9d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'carrier.lizella.net' (RSA) to the list of
known hosts.
Password: password
Last login: Sat Nov 6 16:32:19 2004 from 192.168.1.102
Linux 2.4.26-smp.
alan@carrier:~$ ls -l MANIFEST
-rw-r--r-- 1 alan users 23545276 2004-10-28 20:04 MANIFEST
alan@carrier:~$ exit
logout
Connection to carrier.lizella.net closed.
There you see me making an ssh connection to carrier.lizella.net, and checking the
permissions on the MANIFEST file.
7	email	
Electronic mail is one of the most popular things one can do on the Internet. In 1998, it was
reported that more electronic mail was sent than regular mail. It is indeed common and
useful.
Under Slackware, we provide a standard mail server, and several mail clients. All of the
clients discussed below are text-based. A lot of Windows users may be against this, but you
will find that a text based client is very convenient, especially when checking mail remotely.
Fear not, there are many graphical e-mail clients such as KDE's Kmail. If you wish to use one
of those check its help menu.
13.7.1	pine	
pine(1) is not elm. Or so the saying goes. The University of Washington created their
program for Internet news and email out of a need for an easy mail reader for their students.
pine is one of the most popular email clients in use today and is available for nearly every
flavor of Unix and even Windows.
Figure 13-2. The Pine main menu
You will see a menu of commands and a row of command keys at the bottom. pine is indeed
a complex program, so we will not discuss every feature about it here.
To see what's in your inbox, type i. Your messages are listed with their date, author, and
subject. Highlight the message you want and press enter to view it. Pressing r will start a
reply to the message. Once you have written the response, type Ctrl+X to send it. You can
press i to get back to the message listing.
If you want to delete a message, press d. It will mark the highlighted message for deletion.
pine deletes the mail when you exit the program. pine also lets you store your mail in
folders. You can get a listing of folders by pressing l. At the message listing, press s to save
it to another folder. It will ask for the folder name to write the message to.
pine offers many, many features; you should definitely have a look at the man page for more
information. It will contain the latest information about the program.
13.7.2	elm	
elm(1) is another popular text-based email client. Though not quite as user friendly as pine,
it's definitely been around a lot longer.
Figure 13-3. Elm main screen
By default, you are placed in your inbox. The messages are listed with the message number,
date, sender, and subject. Use the arrow keys to highlight the message you want. Press Enter
to read the message.
To compose a new message, type m at the main screen. The d key will flag a message for
deletion. And the r key will reply to the current message you are reading. All of these keys
are displayed at the bottom of the screen with a prompt.
The man page discusses elm in more detail, so you will probably want to consult that before
using elm.
13.7.3	mutt	
mutt's original interface was based on elm
with added features found in other popular mailclients, resulting in a hybrid mutt.
Some of mutt's features include:
color support
message threading
MIME and PGP/MIME support
pop3 and imap support
support for multiple mailbox formats (mbox, MMDF, MH, maildir)
highly customizable
Figure 13-4. Mutt main screen
if you're looking for a mail client that will let you be in total control over everything, then
you will like mutt. all the default settings can be customized, keybindings can be changed. if
you like to add a macro, you can.
you probably want to take a look at the muttrc manpage, which will tell you how to
configure everything. or take a look at the included example muttrc file.
13.7.4	nail	
nail(1) is a command line driven mail client. It is very primitive and offers pretty much
nothing in the way of user interfaces. However, mailx is handy for times when you need to
quickly mail something, scripting a bulk mailer, testing your MTA installation or something
similar. Note that Slackware creates symbolic links to nail at /usr/bin/mail and
/usr/bin/mailx. Any of these three commands executes the same program. In fact, you will
most likely see nail referred to as mail.
The basic command line is:
% mailx <subject> <to-addr>
mailx reads the message body from standard input. So you can cat a file into this command
to mail it, or you can just type text and hit Ctrl+D when finished with the message.
Here is an example of mailing a program source file to another person.
% cat randomfunc.c | mail -s "Here's that function" asdf@example.net
8	Browsers	
Or looking at websites using a web browser. This is probably by far the most popular use of
the Internet for the average user.
options below.
13.8.1	lynx	
lynx(1) is a text-based web browser. It is a very quick way of looking up something on the
Internet. Sometimes graphics just get in the way if you know exactly what you're after.
To start lynx, just type lynx at the prompt:
% lynx
Figure 13-5. Lynx default start page
You may want to specify a site for lynx to open to:
% lynx http://www.slackware.com
lynx prints the command keys and what they do at the bottom of the screen. The up and
down arrow keys move around the document, Enter selects the highlighted link, and the
left arrow goes back to the previous page. Typing d will download the currently selected
file. The g command brings up the Go prompt, where you can give lynx a URL to open.
There are many other commands in lynx. You can either consult the man page, or type h to
get the help screen for more information.
13.8.2	links	
Just like lynx, links is a textmode web browser, where you do all the navigation using the
keyboard. However, when you press the Esc key, it will activate a very convenient pulldown
menu on the top of the screen. This makes it very easy to use, without having to learn all the
keyboard shortcuts. People who do not use a text browser every day will appreciate this
feature.
links seems to have better support for both frames and tables, when compared to lynx.
Figure 13-6. Links, with the file menu open
13.8.3	wget	
wget(1) is a command line utility that will download files from a specified URL. While not
an actual web-browser, wget is used primarily to grab whole or partial web sites for offline
viewing, or for fast download of single files from HTTP or FTP servers instead. The basic
syntax is:
% wget <url>
You can also pass options. For example, this will download the Slackware web site:
% wget --recursive http://www.slackware.com
wget will create a www.slackware.com directory and store the files in there, just as the site
does.
wget can also download files from FTP sites; just specify an FTP URL instead of an HTTP
one.
% wget ftp://ftp.gnu.org/gnu/wget/wget-1.8.2.tar.gz
--12:18:16-- ftp://ftp.gnu.org/gnu/wget/wget-1.8.2.tar.gz
=> `wget-1.8.2.tar.gz'
Resolving ftp.gnu.org... done.
Connecting to ftp.gnu.org[199.232.41.7]:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /gnu/wget ... done.
==> PORT ... done. ==> RETR wget-1.8.2.tar.gz ... done.
Length: 1,154,648 (unauthoritative)
100%[==================================>] 1,154,648 209.55K/s ETA
00:00
12:18:23 (209.55KB/s) - `wget-1.8.2.tar.gz' saved [1154648]
9	FTP	Clients	
FTP stands for the File Transfer Protocol. It allows you to send and receive files between two
computers. There is the FTP server and the FTP client. We discuss the client in this section.
request and lets you login. You will download files from and upload files to the server. The
client cannot accept FTP connections, it can only connect to servers.
13.9.1	ftp	
To connect to an FTP server, simply run the ftp(1) command and specify the host:
% ftp <hostname> [port]
If the host is running an FTP server, it will ask for a username and password. You can log in
For example, to get Slackware Linux via FTP, you must use anonymous FTP.
Once connected, you will be at the ftp> prompt. There are special commands for FTP, but
they are similar to other standard commands. The following shows some of the basic
commands and what they do:
Table 13-1. ftp commands
Command Purpose
ls List files
cd <dirname> Change directory
bin Set binary transfer mode
ascii Set ASCII transfer mode
get <filename> Download a file
Command Purpose
put <filename> Upload a file
hash Toggle hash mark stats indicator
tick Toggle byte counter indicator
prom Toggle interactive mode for downloads
mget <mask> Download a file or group of files; wildcards are allowed
mput <mask> Upload a file or group of files; wildcards are allowed
quit Log off the FTP server
You can also use some of the following commands which are quite self-explanatory: chmod,
delete, rename, rmdir. For a complete list of all commands and their meaning, just type
help or ? and you'll see a complete listing on screen.
FTP is a fairly simple program to use, but lacks the user interface that many of us are used to
nowadays. The man page discusses some of the command line options for ftp(1).
ftp> ls *.TXT
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
-rw-r--r-- 1 root 100 18606 Apr 6 2002 BOOTING.TXT
-rw-r--r-- 1 root 100 10518 Jun 13 2002 COPYRIGHT.TXT
-rw-r--r-- 1 root 100 602 Apr 6 2002 CRYPTO_NOTICE.TXT
-rw-r--r-- 1 root 100 32431 Sep 29 02:56 FAQ.TXT
-rw-r--r-- 1 root 100 499784 Mar 3 19:29 FILELIST.TXT
-rw-r--r-- 1 root 100 241099 Mar 3 19:12 PACKAGES.TXT
-rw-r--r-- 1 root 100 12339 Jun 19 2002 README81.TXT
-rw-r--r-- 1 root 100 14826 Jun 17 2002 SPEAKUP_DOCS.TXT
-rw-r--r-- 1 root 100 15434 Jun 17 2002 SPEAK_INSTALL.TXT
-rw-r--r-- 1 root 100 2876 Jun 17 2002 UPGRADE.TXT
226 Transfer complete.
ftp> tick
Tick counter printing on (10240 bytes/tick increment).
ftp> get README81.TXT
local: README81.TXT remote: README81.TXT
200 PORT command successful.
150 Opening BINARY mode data connection for README81.TXT (12339 bytes).
Bytes transferred: 12339
226 Transfer complete.
12339 bytes received in 0.208 secs (58 Kbytes/sec)
13.9.2	ncftp	
ncftp(1) (pronounced "Nik-F-T-P") is an alternative to the traditional ftp client that comes
with Slackware. It is still a text-based program, but offers many advantages over ftp,
including:
Tab completion
Bookmarks file
More liberal wildcard uses
Command history
By default, ncftp will try to log in anonymously to the server you specify. You can force
ncftp -u use the same
commands as in ftp, only you'll notice a nicer interface, one that works more like bash.
ncftp /pub/linux/slackware > cd slackware-current/
Please read the file README81.TXT
it was last modified on Wed Jun 19 16:24:21 2002 - 258 days ago
CWD command successful.
ncftp ...ware/slackware-current > ls
BOOTING.TXT FAQ.TXT bootdisks/
CHECKSUMS FILELIST.TXT extra/
CHECKSUMS.asc GPG-KEY isolinux/
CHECKSUMS.md5 PACKAGES.TXT kernels/
CHECKSUMS.md5.asc PRERELEASE_NOTES pasture/
COPYING README81.TXT rootdisks/
COPYRIGHT.TXT SPEEKUP_DOCS.TXT slackware/
CRYPTO_NOTICE.TXT SPEEK_INSTALL.TXT source/
CURRENT.WARNING Slackware-HOWTO
ChangeLog.txt UPGRADE.TXT
ncftp ...ware/slackware-current > get README81.TXT
README81.TXT: 12.29 kB 307.07
kB/s
Networking Basics
In the world of modern technology, the process of networking has become an essential tool
for governments, businesses, and even schools to operate both efficiently and securely.
What	is	Networking?	
Networking is the practice of linking multiple computing devices together in order to share
resources. These resources can be printers, CDs, files, or even electronic communications
such as e-mails and instant messages. These networks can be created using several different
methods, such as cables, telephone lines, satellites, radio waves, and infrared beams. Without
the ability to network, businesses, government agencies, and schools would be unable to
operate as efficiently as they do today. The ability for an office or school to connect dozens
of computers to a single printer is a seemingly simple, yet extremely useful capability.
Perhaps even more valuable is the ability to access the same data files from various
computers throughout a building. This is incredibly useful for companies that may have files
that require access by multiple employees daily. By utilizing networking, those same files
could be made available to several employees on separate computers simultaneously,
improving efficiency.
The	Ins	and	Outs	of	Networking	
When it comes to networking, there are two essential pieces of equipment that enable
numerous devices to be connected: routers and switches
Switches
Switches are used in order to connect many devices on the same network. These devices are
generally within the same building, such as an office building or school and could consist of
various computers, printers, and other gadgets. The switch acts as a controller, allowing the
connected objects to share information with one another. This not only increases productivity
and efficiency, but also saves money.
Routers
In addition to switches, networks generally employ routers as well. These essential tools
connect different networks to each other through the internet in order to allow for data
exchange between networks. Whereas the switch can be considered a controller, a router
should be considered more of a dispatcher, packaging digital information and choosing the
best route for it to travel. Routers can feature several other functions, including firewalls and
virtual private networks (VPNs) that enhance the security of the data being sent over the
internet.
Network	Types	
There are countless types of networks available, especially as networking technologies
continue to advance. Two of the most commonly employed networks are LAN and WAN.
short distances, such as within a building, school, or home. LANs generally employ Ethernet
cables as a means of connecting the various gadgets within the network.
distances than LANs. A WAN is established by using routers to connect various LANs and
are generally not owned by a single person or organization. The internet is one massive WAN
that spans the entire planet.
ncluding wireless local area
networks (WLANs) that are LANs based on wireless network technology and metropolitan
area networks (MANs) that cover larger areas than LANs but smaller areas than WANs.
These MANs generally span a city and are owned and operated by a government or
corporation.
Network	Topology	
Not to be confused with network type, network topology refers to the virtual layout of the
devices within a network and can refer to five distinct categories:
devices on a network.
Found in some offices and schools, ring topologies give each device two neighbors
for communication purposes. All data travels in a ring, and a failure of that ring can bring
down the whole network.
objects on the network. This hub could be a router or a switch.
in order to vastly increase the number of computers able to connect to the network.
on the network has multiple paths it can take instead of one fixed route. The internet is a
perfect example of this topology.
The	Art	of	Computer	Networking	
Computer networking has become a central theme in nearly every aspect of life. From home
use to business use, more and more devices are being produced that can access computer
networks. Because of this fact, it is important to understand just what computer networking
is.
Computer Network Definition
A computer network is a collection of computers and other devices that are able to
communicate with each other and share data. These devices include computers, printers,
tablets, phones, and many other electronics.
Computer Networking Essentials
Both traditional and modern forms of computer networking aim to provide users with the
ability to share data amongst multiple gadgets, whether they be in the same building or across
the globe. Traditional computer networking relied on Ethernet and fiber optic cables to
connect various devices on a network. More modern technology has emerged that allows for
wireless connections between electronics. These technologies include Wi-Fi and Bluetooth
compatible devices. It is very helpful to understand the role that each of these technologies
plays in computer networking.
simultaneously, such as satellites or cellular networks are considered wide area interconnects.
They are generally expensive to build and run more slowly than others due to the large area
and high volume of users.
support a very large amount of data and serve many clients who share common hardware.
include tools such as Bluetooth. These interconnects are highly optimized for low-cost and
also low power usage. Bluetooth is used in many mobile devices, laptop computers, and
speakers in order to enable the transfer of data. Popular information sent over Bluetooth
includes music, phone calls, and contact information. The market for Bluetooth technology is
growing at a rapid pace to include many other items such as remote controlled helicopters
and cars, home security systems, and fitness gear. Because it is rather affordable for the
connectivity it supplies, Bluetooth technology is finding its way into countless niches.
An	operating	System	(OS) is an intermediary between users
and computer hardware. It provides users an environment in which a user can execute
programs conveniently and efficiently.
In technical terms, It is a software which manages hardware. An operating System controls
the allocation of resources and services such as memory, processors, devices and information.
Definition	
An operating system is a program that acts as an interface between the user and the computer
hardware and controls the execution of all kinds of programs.
Following are some of important functions of an operating System.
Memory Management
Processor Management
Device Management
File Management
Security
Control over system performance
Job accounting
Error detecting aids
Coordination between other software and users
Memory	Management	
Memory management refers to management of Primary Memory or Main Memory. Main
memory is a large array of words or bytes where each word or byte has its own address.
Main memory provides a fast storage that can be access directly by the CPU. So for a
program to be executed, it must in the main memory. Operating System does the following
activities for memory management.
Keeps tracks of primary memory i.e. what part of it are in use by whom, what part are
not in use.
In multiprogramming, OS decides which process will get memory when and how
much.
Allocates the memory when the process requests it to do so.
De-allocates the memory when the process no longer needs it or has been terminated.
Processor	Management	
In multiprogramming environment, OS decides which process gets the processor when and
how much time. This function is called process scheduling. Operating System does the
following activities for processor management.
Keeps tracks of processor and status of process. Program responsible for this task is
known as traffic controller.
Allocates the processor(CPU) to a process.
De-allocates processor when processor is no longer required.
Device	Management	
OS manages device communication via their respective drivers. Operating System does the
following activities for device management.
Keeps tracks of all devices. Program responsible for this task is known as the I/O
controller.
Decides which process gets the device when and for how much time.
Allocates the device in the efficient way.
De-allocates devices.
File	Management	
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions. Operating System does the following
activities for file management.
Keeps track of information, location, uses, status etc. The collective facilities are often
known as file system.
Decides who gets the resources.
Allocates the resources.
De-allocates the resources.
Other	Important	Activities	
Following are some of the important activities that Operating System does.
Security -- By means of password and similar other techniques, preventing
unauthorized access to programs and data.
Control over system performance -- Recording delays between request for a service
and response from the system.
Job accounting -- Keeping track of time and resources used by various jobs and
users.
Error detecting aids -- Production of dumps, traces, error messages and other
debugging and error detecting aids.
Coordination between other softwares and users -- Coordination and assignment of
compilers, interpreters, assemblers and other software to the various users of the
computer systems.
What is an operating system?
An operating system is the most important software that runs on a computer. It manages
the computer's memory, processes, and all of its software and hardware. It also allows you
to communicate with the computer without knowing how to speak the computer's language.
Without an operating system, a computer is useless.
Watch the video to learn about operating systems.
The	operating	system's	job	
Your computer's operating system (OS) manages all of the software and hardware on the
computer. Most of the time, there are many different computer programs running at the same
time, and they all need to access your computer's central processing unit (CPU), memory,
and storage. The operating system coordinates all of this to make sure each program gets
what it needs.
Types	of	operating	systems	
Operating systems usually come preloaded on any computer you buy. Most people use the
operating system that comes with their computer, but it's possible to upgrade or even change
operating systems.
The three most common operating systems for personal computers are Microsoft Windows,
Apple Mac OS X, and Linux.
Modern operating systems use a graphical user interface, or GUI (pronounced gooey). A
GUI lets you use your mouse to click icons, buttons, and menus, and everything is clearly
displayed on the screen using a combination of graphics and text.
Each operating system's GUI has a different look and feel, so if you switch to a different
operating system it may seem unfamiliar at first. However, modern operating systems are
designed to be easy to use, and most of the basic principles are the same.
Before GUIs, computers had a command-line interface, which meant users had to type
every single command to the computer and the computer would only display text.
Microsoft Windows
Microsoft created the Windows operating system in the mid-1980s. Over the years, there
have been many different versions of Windows, but the most recent ones are Windows 8
(released in 2012), Windows 7 (2009), and Windows Vista (2007). Windows comes
preloaded on most new PCs, which helps to make it the most popular operating system in
the world.
If you're buying a new computer or are upgrading to a newer version of Windows, you can
choose from several different editions of Windows, such as Home Premium, Professional,
and Ultimate. You may need to do some research to decide which edition is right for you.
Mac OS X
Mac OS is a line of operating systems created by Apple. It comes preloaded on all new
Macintosh computers, or Macs. All of the recent versions are known as OS X (pronounced
O-S Ten), and the specific versions include Yosemite (released in 2014), Mavericks (2013),
Mountain Lion (2012), Lion (2011), and Snow Leopard (2009). Apple also offers a version
called Mac OS X Server, which is designed to be run on servers.
According to StatCounter Global Stats, Mac OS X users account for 9.5% of the operating
systems market as of September 2014 much lower than the percentage of Windows users
(almost 90%). One reason for this is that Apple computers tend to be more expensive.
However, many people prefer the look and feel of Mac OS X.
Linux
Linux (pronounced LINN-ux) is a family of open-source operating systems, which means
they can be modified and distributed by anyone around the world. This is different from
proprietary software like Windows, which can only be modified by the company that owns
it (Microsoft). The advantages of Linux are that it is free, and there are many
different distributions or versions you can choose from. Each distribution has a different
look and feel, and the most popular ones include Ubuntu, Mint, and Fedora.
Linux is named after Linus Torvalds, who created the Linux kernel in 1991. The kernel is
the computer code that is the central part of an operating system.
According to StatCounter Global Stats, Linux users account for less than 2% of the operating
systems market as of September 2014. However, most servers run Linux because it's
relatively easy to customize.
Operating systems for mobile devices
The operating systems we've been talking about were designed to run on desktop or laptop
computers. Mobile devices such as phones, tablet computers, and MP3 players are
different from desktop and laptop computers, so they run operating systems that are designed
specifically for mobile devices. Examples of mobile operating systems include Apple iOS,
Windows Phone, and Google Android. In the screenshot below, you can see Apple iOS
running on an iPad.
Operating systems for mobile devices generally aren't as fully featured as those made for
desktop and laptop computers, and they aren't able to run all of the same software. However,
you can still do a lot of things with them, like watch movies, browse the Web, manage your
calendar, and play games.
Raspberry	Pi	Basics	
Content	is	taken	from	https://www.howtoforge.com/tutorial/howto-install-raspbian-on-
raspberry-pi/	
Raspberry Pi Basics: installing Raspbian and getting it up and running
So, are you a person who got a Raspberry Pi (aka "Pi") and want to start building something
with it but don't know how to go about it? If yes, then this tutorial is for you. Here in this
howto, we go about installing the Raspbian OS and initiating a desktop environment.
Introduction	
Raspberry Pi is a credit card sized micro processor available in different models with
different processing speed starting from 700 MHz. Whether you have a model B or model
B+, or the very old version, the installation process remains the same. People who have
checked out the official Raspberry Pi website, might have seen them recommending the
"NOOBS" or "NOOBS LITE" Operating System (aka "OS") for beginners. But using the Pi
is very easy and from being a beginner, one will turn pro in no time. So, it's better to go with
the more powerful and more efficient OS, the Raspbian. The main reason why Raspbian is
extremely popular is that it has thousands of pre built libraries to perform many tasks and
optimize the OS. This forms a huge advantage while building applications.
1	Downloading	Raspbian	and	Image	writer	
Download the latest version of Raspbian from here. You can download it directly or via the
torrents.
You will be needing an image writer to write the downloaded OS into the SD card (micro SD
card in case of Raspberry Pi B+ model). So download the "win32 disk imager" from here.
2	Writing	the	image	
Insert the SD card into the laptop/pc and run the image writer. Once open, browse and select
the downloaded Raspbian image file. Select the correct device, that is the drive representing
the SD card. If the drive (or device) selected is different from the SD card then the other
selected drive will become corrupted. SO be careful.
After that, click on the "Write" button in the bottom. As an example, see the image below,
where the SD card (or micro SD) drive is represented by the letter "G:"
Once the write is complete, eject the SD card and insert it into the Raspberry Pi and turn it
on. It should start booting up.
3	Setting	up	the	Pi	
Please remember that after booting the Pi, there might be situations when the user credentials
like the "username" and password will be asked. Raspberry Pi comes with a default user
name and password and so always use it whenever it is being asked. The credentials are:
login: pi
password: raspberry
When the Pi has been booted for the first time, a configuration screen called the "Setup
Options" should appear and it will look like the image below.
If you have missed the "Setup Options" screen, its not a problem, you can always get it by
typing the following command in the terminal.
sudo raspi-config
Once you execute this command the "Setup Options" screen will come up as shown in the
image above.
Now that the Setup Options window is up, we will have to set a few things. After completing
each of the steps below, if it asks to reboot the Pi, please do so. After the reboot, if you don't
get the "Setup Options" screen, then follow the command given above to get the
screen/window.
The	first	thing	to	do:	
select the first option in the list of the setup options window, that is select the "Expand
Filesystem" option and hit the enter key. We do this to make use of all the space present on
the SD card as a full partition. All this does is, expand the OS to fit the whole space on the SD
card which can then be used as the storage memory for the Pi.
The	second	thing	to	do:	
select the third option in the list of the setup options window, that is select the "Enable Boot
To Desktop/Scratch" option and hit the enter key. It will take you to another window called
the "choose boot option" window that looks like the image below.
In the "choose boot option window" , select the second option, that is, "Desktop Log in as
user 'pi' at the graphical desktop" and hit the enter button. Once done you will be taken
back to the "Setup Options" page, if not select the "OK" button at the bottom of this window
and you will be taken back to the previous window. We do this because we wan to boot into
the desktop environment which we are familiar with. If we don't do this step then the
Raspberry Pi boots into a terminal each time with no GUI options.
Once, both the steps are done, select the "finish" button at the bottom of the page and it
should reboot automatically. If it doesn't, then use the following command in the terminal to
reboot.
sudo reboot
4	Updating	the	firmware	
After the reboot from the previous step, if everything went right, then you will end up on the
desktop which looks like the image below.
Once you are on the desktop, open a terminal and enter the following command to update the
firmware of the Pi.
sudo rpi-update
Updating the firmware is necessary because certain models of the Pi might not have all the
required dependencies to run smoothly or it may have some bug. The latest firmware might
have the fix to those bugs, thus its very important to update it in the beginning itself.
5	Conclusion	
So, we have covered the steps to get the Pi up and running. This method works on all the
different models of Raspberry Pi ( model A, B, B+ and also RPi 2) as Raspbain was made to
be supported on all models. However, while installing other software or libraries , the
procedure might change a bit while installing depending on the model of the Pi or the version
of Raspbian itself. The concept of Raspberry is to keep trying till you get he result or build
that you want. This might involve a lot of trial and error but spending the time will be worth
it. The actual usage doesn't end here. This is just the beginning. It is up to you to go ahead to
build something amazing out of it.
6	Links	
Raspberry Pi
Raspbia
LINUX	COMMANDS	
Why	Bother?	
Why do you need to learn the command line anyway? Well, let me tell you a story. A few
years ago we had a problem where I used to work. There was a shared drive on one of our file
servers that kept getting full. I won't mention that this legacy operating system did not
support user quotas; that's another story. But the server kept getting full and it stopped people
from working. One of our software engineers spent the better part of a day writing a C++
program that would look through all the user's directories and add up the space they were
using and make a listing of the results. Since I was forced to use the legacy OS while I was
on the job, I installed a Linux-like command line environment for it. When I heard about the
problem, I realized I could do all the work this engineer had done with this single line:
du -s * | sort -nr > $HOME/user_space_report.txt
Graphical user interfaces (GUIs) are helpful for many tasks, but they are not good for all
tasks. I have long felt that most computers today are not powered by electricity. They instead
seem to be powered by the "pumping" motion of the mouse! Computers were supposed to
free us from manual labor, but how many times have you performed some task you felt sure
the computer should be able to do but you ended up doing the work yourself by tediously
working the mouse? Pointing and clicking, pointing and clicking.
I once heard an author say that when you are a child you use a computer by looking at the
pictures. When you grow up, you learn to read and write. Welcome to Computer Literacy
101. Now let's get to work.
Contents	
1. What Is "The Shell"?
2. Navigation
3. Looking Around
4. A Guided Tour
5. Manipulating Files
6. Working With Commands
7. I/O Redirection
8. Expansion
9. Permissions
10. Job Control
What	Is	"The	Shell"?	
Simply put, the shell is a program that takes commands from the keyboard and gives them to
the operating system to perform. In the old days, it was the only user interface available on a
Unix-like system such as Linux. Nowadays, we have graphical user interfaces (GUIs) in
addition to command line interfaces (CLIs) such as the shell.
On most Linux systems a program called bash (which stands for Bourne Again SHell, an
enhanced version of the original Unix shell program, sh, written by Steve Bourne) acts as the
shell program. Besides bash, there are other shell programs that can be installed in a Linux
system. These include: ksh, tcsh and zsh.
What's	A	"Terminal?"	
It's a program called a terminal emulator. This is a program that opens a window and lets you
interact with the shell. There are a bunch of different terminal emulators you can use. Most
Linux distributions supply several, such as: gnome-terminal, konsole, xterm, rxvt, kvt,
nxterm, and eterm.
Starting	A	Terminal	
Your window manager probably has a way to launch a terminal from the menu. Look through
the list of programs to see if anything looks like a terminal emulator. If you are a KDE user,
the terminal program is called "konsole," in Gnome it's called "gnome-terminal." You can
start up as many of these as you want and play with them. While there are a number of
different terminal emulators, they all do the same thing. They give you access to a shell
session. You will probably develop a preference for one, based on the different bells and
whistles each one provides.
Testing	The	Keyboard	
OK, let's try some typing. Bring up a terminal window. You should see a shell prompt that
contains your user name and the name of the machine followed by a dollar sign. Something
like this:
[me@linuxbox me]$
Excellent! Now type some nonsense characters and press the enter key.
[me@linuxbox me]$ kdkjflajfks
If all went well, you should have gotten an error message complaining that it cannot
understand you:
[me@linuxbox me]$ kdkjflajfks
bash: kdkjflajfks: command not found
Wonderful! Now press the up-arrow key. Watch how our previous command "kdkjflajfks"
returns. Yes, we have command history. Press the down-arrow and we get the blank line
again.
Recall the "kdkjflajfks" command using the up-arrow key if needed. Now, try the left and
right-arrow keys. You can position the text cursor anywhere in the command line. This
allows you to easily correct mistakes.
You're	not	logged	in	as	root,	are	you?	
If the last character of your shell prompt is # rather than $, you are operating as the superuser.
This means that you have administrative privileges. This can be potentially dangerous, since
you are able to delete or overwrite any file on the system. Unless you absolutely need
administrative privileges, do not operate as the superuser.
Using	The	Mouse	
Even though the shell is a command line interface, the mouse is still handy.
Besides using the mouse to scroll the contents of the terminal window, you can copy text
with the mouse. Drag your mouse over some text (for example, "kdkjflajfks" right here on the
browser window) while holding down the left button. The text should highlight. Release the
left button and move your mouse pointer to the terminal window and press the middle mouse
button (alternately, you can press both the left and right buttons at the same time if you are
working on a touch pad). The text you highlighted in the browser window should be copied
into the command line.
A	few	words	about	focus...	
When you installed your Linux system and its window manager (most likely Gnome or
KDE), it was configured to behave in some ways like that legacy operating system.
In particular, it probably has its focus policy set to "click to focus." This means that in order
for a window to gain focus (become active) you have to click in the window. This is contrary
to traditional X Window behavior. You should consider setting the focus policy to "focus
follows mouse". You may find it strange at first that windows don't raise to the front when
they get focus (you have to click on the window to do that), but you will enjoy being able to
work on more than one window at once without having the active window obscuring the the
other. Try it and give it a fair trial; I think you will like it. You can find this setting in the
configuration tools for your window manager.
Navigation	
In this lesson, I will introduce your first three commands: pwd (print working directory), cd
(change directory), and ls (list files and directories).
If you have not worked with a command line interface before, you will need to pay close
attention to this lesson, since the concepts will take some getting used to.
File	System	Organization	
Like that legacy operating system, the files on a Linux system are arranged in what is called a
hierarchical directory structure. This means that they are organized in a tree-like pattern of
directories (called folders in other systems), which may contain files and other directories.
The first directory in the file system is called the root directory. The root directory contains
files and subdirectories, which contain more files and subdirectories and so on and so on.
Most graphical environments today include a file manager program to view and manipulate
the contents of the file system. Often you will see the file system represented like this:
One important difference between the legacy operating system and Unix-like operating
systems such as Linux is that Linux does not employ the concept of drive letters. While drive
letters split the file system into a series of different trees (one for each drive), Linux always
has a single tree. Different storage devices may contain different branches of the tree, but
there is always a single tree.
pwd	
Since a command line interface cannot provide graphic pictures of the file system structure, it
must have a different way of representing it. Think of the file system tree as a maze, and you
are standing in it. At any given moment, you are located in a single directory. Inside that
directory, you can see its files and the pathway to its parent directory and the pathways to the
subdirectories of the directory in which you are standing.
The directory you are standing in is called the working directory. To find the name of the
working directory, use the pwd command.
[me@linuxbox me]$ pwd
/home/me
When you first log on to a Linux system, the working directory is set to your home directory.
This is where you put your files. On most systems, your home directory will be called
/home/your_user_name, but it can be anything according to the whims of the system
administrator.
To list the files in the working directory, use the ls command.
[me@linuxbox me]$ ls
Desktop Xrootenv.0 linuxcmd
GNUstep bin nedit.rpm
GUILG00.GZ hitni123.jpg nsmail
I will come back to ls in the next lesson. There are a lot of fun things you can do with it, but
I have to talk about pathnames and directories a bit first.
cd	
To change your working directory (where you are standing in the maze) you use the cd
command. To do this, type cd followed by the pathname of the desired working directory. A
pathname is the route you take along the branches of the tree to get to the directory you want.
Pathnames can be specified in one of two different ways; absolute pathnames or relative
pathnames. Let's look with absolute pathnames first.
An absolute pathname begins with the root directory and follows the tree branch by branch
until the path to the desired directory or file is completed. For example, there is a directory on
your system in which most programs are installed. The pathname of the directory is /usr/bin.
This means from the root directory (represented by the leading slash in the pathname) there is
a directory called "usr" which contains a directory called "bin".
Let's try this out:
[me@linuxbox me]$ cd /usr/bin
[me@linuxbox bin]$ pwd
/usr/bin [me@linuxbox bin]$ ls
[ lwp-request
2to3 lwp-rget
2to3-2.6 lxterm
a2p lz
aalib-config lzcat
aconnect lzma
acpi_fakekey lzmadec
acpi_listen lzmainfo
add-apt-repository m17n-db
addpart magnifier
and many more...
Now we can see that we have changed the current working directory to /usr/bin and that it is
full of files. Notice how your prompt has changed? As a convenience, it is usually set up to
display the name of the working directory.
Where an absolute pathname starts from the root directory and leads to its destination, a
relative pathname starts from the working directory. To do this, it uses a couple of special
notations to represent relative positions in the file system tree. These special notations are "."
(dot) and ".." (dot dot).
The "." notation refers to the working directory itself and the ".." notation refers to the
working directory's parent directory. Here is how it works. Let's change the working directory
to /usr/bin again:
[me@linuxbox me]$ cd /usr/bin
[me@linuxbox bin]$ pwd
/usr/bin
O.K., now let's say that we wanted to change the working directory to the parent of /usr/bin
which is /usr. We could do that two different ways. First, with an absolute pathname:
[me@linuxbox bin]$ cd /usr
[me@linuxbox usr]$ pwd
/usr
Or, with a relative pathname:
[me@linuxbox bin]$ cd ..
[me@linuxbox usr]$ pwd
/usr
Two different methods with identical results. Which one should you use? The one that
requires the least typing!
Likewise, we can change the working directory from /usr to /usr/bin in two different ways.
First using an absolute pathname:
[me@linuxbox usr]$ cd /usr/bin
[me@linuxbox bin]$ pwd
/usr/bin
Or, with a relative pathname:
[me@linuxbox usr]$ cd ./bin
[me@linuxbox bin]$ pwd
/usr/bin
Now, there is something important that I must point out here. In almost all cases, you can
omit the "./". It is implied. Typing:
[me@linuxbox usr]$ cd bin
would do the same thing. In general, if you do not specify a pathname to something, the
working directory will be assumed. There is one important exception to this, but we won't get
to that for a while.
A	Few	Shortcuts	
If you type cd followed by nothing, cd will change the working directory to your home
directory.
A related shortcut is to type cd ~user_name. In this case, cd will change the working
directory to the home directory of the specified user.
Typing cd - changes the working directory to the previous one.
Important	facts	about	file	names	
1. File names that begin with a period character are hidden. This only means that ls will not
list them unless you say ls -a. When your account was created, several hidden files were
placed in your home directory to configure things for your account. Later on we will take a
closer look at some of these files to see how you can customize your environment. In
addition, some applications will place their configuration and settings files in your home
directory as hidden files.
2. File names in Linux, like Unix, are case sensitive. The file names "File1" and "file1" refer to
different files.
3. Linux has no concept of a "file extension" like legacy operating systems. You may name files
any way you like. However, while Linux itself does not care about file extensions, many
application programs do.
4. Though Linux supports long file names which may contain embedded spaces and
punctuation characters, limit the punctuation characters to period, dash, and underscore.
Most importantly, do not embed spaces in file names. If you want to represent spaces
between words in a file name, use underscore characters. You will thank yourself later.
Looking	Around	
Now that you know how to move from working directory to working directory, we're going
to take a tour of your Linux system and, along the way, learn some things about what makes
it tick. But before we begin, I have to teach you some tools that will come in handy during
our adventure. These are:
ls (list files and directories)
less (view text files)
file (classify a file's contents)
ls	
The ls command is used to list the contents of a directory. It is probably the most commonly
used Linux command. It can be used in a number of different ways. Here are some examples:
Examples of the ls command
Command Result
ls List the files in the working directory
ls /bin List the files in the /bin directory (or any other directory you care to
specify)
ls -l List the files in the working directory in long format
ls -l /etc /bin List the files in the /bin directory and the /etc directory in long format
ls -la .. List all files (even ones with names beginning with a period character,
which are normally hidden) in the parent of the working directory in
long format
These examples also point out an important concept about commands. Most commands
operate like this:
command -options arguments
where command is the name of the command, -options is one or more adjustments to the
command's behavior, and arguments is one or more "things" upon which the command
operates.
In the case of ls, we see that ls is the name of the command, and that it can have one or
more options, such as -a and -l, and it can operate on one or more files or directories.
A Closer Look At Long Format
If you use the -l option with ls, you will get a file listing that contains a wealth of
information about the files being listed. Here's an example:
-rw------- 1 bshotts bshotts 576 Apr 17 1998 weather.txt
drwxr-xr-x 6 bshotts bshotts 1024 Oct 9 1999 web_page
-rw-rw-r-- 1 bshotts bshotts 276480 Feb 11 20:41 web_site.tar
-rw------- 1 bshotts bshotts 5743 Dec 16 1998 xmas_file.txt
---------- ------- ------- -------- ------------ -------------
| | | | | |
| | | | | File Name
| | | | |
| | | | +--- Modification Time
| | | |
| | | +------------- Size (in bytes)
| | |
| | +----------------------- Group
| |
| +-------------------------------- Owner
|
+---------------------------------------------- File Permissions
File Name
The name of the file or directory.
Modification Time
The last time the file was modified. If the last modification occurred more than six months in
the past, the date and year are displayed. Otherwise, the time of day is shown.
Size
The size of the file in bytes.
Group
The name of the group that has file permissions in addition to the file's owner.
Owner
The name of the user who owns the file.
File Permissions
A representation of the file's access permissions. The first character is the type of file. A "-"
indicates a regular (ordinary) file. A "d" indicates a directory. The second set of three
characters represent the read, write, and execution rights of the file's owner. The next three
represent the rights of the file's group, and the final three represent the rights granted to
everybody else. I'll discuss this in more detail in a later lesson.
less	
less is a program that lets you view text files. This is very handy since many of the files used
to control and configure Linux are human readable.
What	is	"text"?	
There are many ways to represent information on a computer. All methods involve defining a
relationship between the information and some numbers that will be used to represent it.
Computers, after all, only understand numbers and all data is converted to numeric
representation.
Some of these representation systems are very complex (such as compressed multimedia
files), while others are rather simple. One of the earliest and simplest is called ASCII text.
ASCII (pronounced "As-Key") is short for American Standard Code for Information
Interchange. This is a simple encoding scheme that was first used on Teletype machines to
map keyboard characters to numbers.
Text is a simple one-to-one mapping of characters to numbers. It is very compact. Fifty
characters of text translates to fifty bytes of data. Throughout a Linux system, many files are
stored in text format and there are many Linux tools that work with text files. Even the legacy
operating systems recognize the importance of this format. The well-known NOTEPAD.EXE
program is an editor for plain ASCII text files.
The less program is invoked by simply typing:
less text_file
This will display the file.
Controlling less
Once started, less will display the text file one page at a time. You may use the Page Up and
Page Down keys to move through the text file. To exit less, type "q". Here are some
commands that less will accept:
Keyboard commands for the less program
Command Action
Page Up or b Scroll back one page
Page Down or
space
Scroll forward one page
G Go to the end of the text file
1G Go to the beginning of the text file
/characters Search forward in the text file for an occurrence of the specified
characters
n Repeat the previous search
h Display a complete list less commands and options
q Quit
file	
As you wander around your Linux system, it is helpful to determine what kind of data a file
contains before you try to view it. This is where the file command comes in. file will
examine a file and tell you what kind of file it is.
To use the file program, just type:
file name_of_file
The file program can recognize most types of files, such as:
Various kinds of files
File Type Description Viewable as text?
ASCII text The name says it all yes
Bourne-Again shell
script text
A bash script yes
ELF 32-bit LSB core
file
A core dump file (a program will create
this when it crashes)
no
ELF 32-bit LSB
executable
An executable binary program no
ELF 32-bit LSB
shared object
A shared library no
GNU tar archive A tape archive file. A common way of
storing groups of files.
no, use tar tvf to view
listing.
gzip compressed data An archive compressed with gzip no
HTML document text A web page yes
JPEG image data A compressed JPEG image no
PostScript document A PostScript file yes
text
RPM A Red Hat Package Manager archive no, use rpm -q to
examine contents.
Zip archive data An archive compressed with zip no
While it may seem that most files cannot be viewed as text, you will be surprised how many
can. This is especially true of the important configuration files. You will also notice during
our adventure that many features of the operating system are controlled by shell scripts. In
Linux, there are no secrets!
A	Guided	Tour	
It's time to take our tour. The table below lists some interesting places to explore. This is by
no means a complete list, but it should prove to be an interesting adventure. For each of the
directories listed below, do the following:
cd into each directory.
Use ls to list the contents of the directory.
If you see an interesting file, use the file command to determine its contents.
For text files, use less to view them.
Interesting directories and their contents
Directory Description
/ The root directory where the file system begins. In most cases the root
directory only contains subdirectories.
/boot This is where the Linux kernel and boot loader files are kept. The kernel is a
file called vmlinuz.
/etc The /etc directory contains the configuration files for the system. All of
the files in /etc should be text files. Points of interest:
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course
Ecw course

More Related Content

What's hot

Input output ports and connectors
Input output ports and connectorsInput output ports and connectors
Input output ports and connectors
bhardwaj1992
 
Parts of a Computer: Cables
Parts of a Computer: CablesParts of a Computer: Cables
Parts of a Computer: Cables
Luz Divina Alguno
 
Computer cables and connectors
Computer cables and connectorsComputer cables and connectors
Computer cables and connectors
scottmartin3917
 
Expansion card or Add on card Power point Presentation.
Expansion card or Add on card Power point Presentation.Expansion card or Add on card Power point Presentation.
Expansion card or Add on card Power point Presentation.
Arun Kc
 
Ports and connectors
Ports and connectorsPorts and connectors
Ports and connectors
chrispaul8676
 
Expansion cards
Expansion cardsExpansion cards
Expansion cards
Veronica Alejandro
 
Expansion cards and slots
Expansion cards and slotsExpansion cards and slots
Expansion cards and slots
Jibin Varghese
 
Pc interface
Pc interfacePc interface
Pc interface
Ashraf Aboshosha
 
Day1 - Cables & Connectors
Day1 - Cables & ConnectorsDay1 - Cables & Connectors
Day1 - Cables & Connectors
Lucy Eisemann
 
Peripherals
PeripheralsPeripherals
Peripherals
Tory Klementsen
 
Usb In A Nutshell
Usb In A NutshellUsb In A Nutshell
Usb In A Nutshell
allankliu
 
Usb universal serial bus
Usb   universal serial busUsb   universal serial bus
Usb universal serial bus
Dr. Anita Bhandari
 
2 the visible pc
2 the visible pc2 the visible pc
2 the visible pc
hafizhanif86
 
Informatics practices project by sagar mandloi
Informatics practices project by sagar mandloiInformatics practices project by sagar mandloi
Informatics practices project by sagar mandloi
sagar mandloi
 
ICT INTRO AND CPU PORTS DETAIL
ICT INTRO AND CPU PORTS DETAILICT INTRO AND CPU PORTS DETAIL
ICT INTRO AND CPU PORTS DETAIL
Rajat Kumar
 
Peripherals lidia y lucia 4ºa
Peripherals lidia y lucia 4ºaPeripherals lidia y lucia 4ºa
Peripherals lidia y lucia 4ºalucia333
 
Universal serial bus
Universal serial busUniversal serial bus
Universal serial bus
Muhammad Muzaffar Khan
 

What's hot (20)

Input output ports and connectors
Input output ports and connectorsInput output ports and connectors
Input output ports and connectors
 
Parts of a Computer: Cables
Parts of a Computer: CablesParts of a Computer: Cables
Parts of a Computer: Cables
 
Computer cables and connectors
Computer cables and connectorsComputer cables and connectors
Computer cables and connectors
 
Expansion card or Add on card Power point Presentation.
Expansion card or Add on card Power point Presentation.Expansion card or Add on card Power point Presentation.
Expansion card or Add on card Power point Presentation.
 
Computer Parts
Computer PartsComputer Parts
Computer Parts
 
Ports and connectors
Ports and connectorsPorts and connectors
Ports and connectors
 
Expansion cards
Expansion cardsExpansion cards
Expansion cards
 
Expansion cards and slots
Expansion cards and slotsExpansion cards and slots
Expansion cards and slots
 
Pc interface
Pc interfacePc interface
Pc interface
 
Day1 - Cables & Connectors
Day1 - Cables & ConnectorsDay1 - Cables & Connectors
Day1 - Cables & Connectors
 
1.9 adapter card
1.9 adapter card1.9 adapter card
1.9 adapter card
 
Peripherals
PeripheralsPeripherals
Peripherals
 
Usb In A Nutshell
Usb In A NutshellUsb In A Nutshell
Usb In A Nutshell
 
Usb universal serial bus
Usb   universal serial busUsb   universal serial bus
Usb universal serial bus
 
2 the visible pc
2 the visible pc2 the visible pc
2 the visible pc
 
Informatics practices project by sagar mandloi
Informatics practices project by sagar mandloiInformatics practices project by sagar mandloi
Informatics practices project by sagar mandloi
 
ICT INTRO AND CPU PORTS DETAIL
ICT INTRO AND CPU PORTS DETAILICT INTRO AND CPU PORTS DETAIL
ICT INTRO AND CPU PORTS DETAIL
 
SIP info
SIP infoSIP info
SIP info
 
Peripherals lidia y lucia 4ºa
Peripherals lidia y lucia 4ºaPeripherals lidia y lucia 4ºa
Peripherals lidia y lucia 4ºa
 
Universal serial bus
Universal serial busUniversal serial bus
Universal serial bus
 

Viewers also liked

La responsabilidad
La responsabilidadLa responsabilidad
La responsabilidad
Lizeth Zumaya
 
Universidad del tolima
Universidad del tolimaUniversidad del tolima
Universidad del tolimaheidymontoya
 
EXPERIENCE LETTER-ALFARAA
EXPERIENCE LETTER-ALFARAAEXPERIENCE LETTER-ALFARAA
EXPERIENCE LETTER-ALFARAAFarhan khan
 
Introducing Process Insight Rev 8
Introducing Process Insight Rev 8Introducing Process Insight Rev 8
Introducing Process Insight Rev 8Andrew Ruddick
 
Concreet 2 2015
Concreet 2 2015Concreet 2 2015
Concreet 2 2015
Global Green Connections
 
(4) 19 mei16 compliance en systeemgericht toezicht
(4) 19 mei16 compliance en systeemgericht toezicht(4) 19 mei16 compliance en systeemgericht toezicht
(4) 19 mei16 compliance en systeemgericht toezicht
Geert Henk Wijnants
 
1. Grupputveckling, Svenska Budo- och Kampsportsförbundet
1. Grupputveckling, Svenska Budo- och Kampsportsförbundet1. Grupputveckling, Svenska Budo- och Kampsportsförbundet
1. Grupputveckling, Svenska Budo- och Kampsportsförbundet
budokampsport
 
Concreet 2015
Concreet 2015 Concreet 2015
Concreet 2015
Global Green Connections
 
Concept pgs 29 openbare commentaarronde
Concept pgs 29 openbare commentaarrondeConcept pgs 29 openbare commentaarronde
Concept pgs 29 openbare commentaarronde
Geert Henk Wijnants
 
canal rural
canal ruralcanal rural
canal rural
Meio & Mensagem
 
Properties of Regular Expressions
Properties of Regular ExpressionsProperties of Regular Expressions
Properties of Regular Expressions
Shiraz316
 
Instalaciones sanitarias
Instalaciones sanitariasInstalaciones sanitarias
Instalaciones sanitarias
arabela GUEVARA VASQUEZ
 

Viewers also liked (19)

La responsabilidad
La responsabilidadLa responsabilidad
La responsabilidad
 
Universidad del tolima
Universidad del tolimaUniversidad del tolima
Universidad del tolima
 
AdvancedBook2010
AdvancedBook2010AdvancedBook2010
AdvancedBook2010
 
EXPERIENCE LETTER-ALFARAA
EXPERIENCE LETTER-ALFARAAEXPERIENCE LETTER-ALFARAA
EXPERIENCE LETTER-ALFARAA
 
Tom elysse venice
Tom elysse veniceTom elysse venice
Tom elysse venice
 
Liven up 下田!@Tokyo
Liven up 下田!@TokyoLiven up 下田!@Tokyo
Liven up 下田!@Tokyo
 
Organigrama
OrganigramaOrganigrama
Organigrama
 
Introducing Process Insight Rev 8
Introducing Process Insight Rev 8Introducing Process Insight Rev 8
Introducing Process Insight Rev 8
 
Ir 2014
Ir 2014Ir 2014
Ir 2014
 
Concreet 2 2015
Concreet 2 2015Concreet 2 2015
Concreet 2 2015
 
Home 1
Home 1Home 1
Home 1
 
(4) 19 mei16 compliance en systeemgericht toezicht
(4) 19 mei16 compliance en systeemgericht toezicht(4) 19 mei16 compliance en systeemgericht toezicht
(4) 19 mei16 compliance en systeemgericht toezicht
 
1. Grupputveckling, Svenska Budo- och Kampsportsförbundet
1. Grupputveckling, Svenska Budo- och Kampsportsförbundet1. Grupputveckling, Svenska Budo- och Kampsportsförbundet
1. Grupputveckling, Svenska Budo- och Kampsportsförbundet
 
Concreet 2015
Concreet 2015 Concreet 2015
Concreet 2015
 
Concept pgs 29 openbare commentaarronde
Concept pgs 29 openbare commentaarrondeConcept pgs 29 openbare commentaarronde
Concept pgs 29 openbare commentaarronde
 
canal rural
canal ruralcanal rural
canal rural
 
Properties of Regular Expressions
Properties of Regular ExpressionsProperties of Regular Expressions
Properties of Regular Expressions
 
Instalaciones sanitarias
Instalaciones sanitariasInstalaciones sanitarias
Instalaciones sanitarias
 
Shillington
ShillingtonShillington
Shillington
 

Similar to Ecw course

Thunderbolt pdf
Thunderbolt pdfThunderbolt pdf
Thunderbolt pdf
Praveen Kumar
 
Input output ports and connectors
Input output ports and connectorsInput output ports and connectors
Input output ports and connectors
Ajo Alex
 
Abdulhakim-Mohammad-Al-shariff-Porte-and-connector.pptxAbdulhakim-Mohammad-Al...
Abdulhakim-Mohammad-Al-shariff-Porte-and-connector.pptxAbdulhakim-Mohammad-Al...Abdulhakim-Mohammad-Al-shariff-Porte-and-connector.pptxAbdulhakim-Mohammad-Al...
Abdulhakim-Mohammad-Al-shariff-Porte-and-connector.pptxAbdulhakim-Mohammad-Al...
RegineManuel2
 
Top 10 Computer Cables Everyone Must Know of.pdf
Top 10 Computer Cables Everyone Must Know of.pdfTop 10 Computer Cables Everyone Must Know of.pdf
Top 10 Computer Cables Everyone Must Know of.pdf
Sf Cable, Inc
 
Ports and Connectors
Ports and ConnectorsPorts and Connectors
Ports and Connectors
dipaknandankar
 
Computer ports
Computer portsComputer ports
Computer ports
Goodthingbetter
 
COMPUTER CABLES Seminar presentation 7.pptx
COMPUTER CABLES Seminar presentation 7.pptxCOMPUTER CABLES Seminar presentation 7.pptx
COMPUTER CABLES Seminar presentation 7.pptx
ssusere6f5a11
 
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptxComputer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
JoshuaAnnan5
 
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptxComputer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
JoshuaAnnan5
 
Connectivity-Guide-AU-web
Connectivity-Guide-AU-webConnectivity-Guide-AU-web
Connectivity-Guide-AU-webJason Niu
 
02 computer parts and ports
02 computer parts  and ports02 computer parts  and ports
02 computer parts and ports
Melchor Balolong
 
NOTA ELEKTRONIK KABEL.pptx
NOTA ELEKTRONIK KABEL.pptxNOTA ELEKTRONIK KABEL.pptx
NOTA ELEKTRONIK KABEL.pptx
Muhammad Taufik
 
Commnunication ports and memory card chapter 1
Commnunication ports and memory card chapter 1Commnunication ports and memory card chapter 1
Commnunication ports and memory card chapter 1Mukesh Thakur
 
Computer Ports
Computer PortsComputer Ports
Computer Ports
Netwax Lab
 
PPT On Ports | Full Concept | Ports In Depth
PPT On Ports | Full Concept | Ports In DepthPPT On Ports | Full Concept | Ports In Depth
PPT On Ports | Full Concept | Ports In Depth
Umesh Kumar
 
FTCP
FTCPFTCP
Main components of a computerMultimedia devicesOther peripheral .pdf
Main components of a computerMultimedia devicesOther peripheral .pdfMain components of a computerMultimedia devicesOther peripheral .pdf
Main components of a computerMultimedia devicesOther peripheral .pdf
venkt12345
 
DESKTOP PC INTERFACE.pptx
DESKTOP PC INTERFACE.pptxDESKTOP PC INTERFACE.pptx
DESKTOP PC INTERFACE.pptx
johnino3
 

Similar to Ecw course (20)

1.2 i o interface
1.2 i o interface1.2 i o interface
1.2 i o interface
 
Thunderbolt pdf
Thunderbolt pdfThunderbolt pdf
Thunderbolt pdf
 
Input output ports and connectors
Input output ports and connectorsInput output ports and connectors
Input output ports and connectors
 
Abdulhakim-Mohammad-Al-shariff-Porte-and-connector.pptxAbdulhakim-Mohammad-Al...
Abdulhakim-Mohammad-Al-shariff-Porte-and-connector.pptxAbdulhakim-Mohammad-Al...Abdulhakim-Mohammad-Al-shariff-Porte-and-connector.pptxAbdulhakim-Mohammad-Al...
Abdulhakim-Mohammad-Al-shariff-Porte-and-connector.pptxAbdulhakim-Mohammad-Al...
 
Top 10 Computer Cables Everyone Must Know of.pdf
Top 10 Computer Cables Everyone Must Know of.pdfTop 10 Computer Cables Everyone Must Know of.pdf
Top 10 Computer Cables Everyone Must Know of.pdf
 
Ports and Connectors
Ports and ConnectorsPorts and Connectors
Ports and Connectors
 
Computer ports
Computer portsComputer ports
Computer ports
 
COMPUTER CABLES Seminar presentation 7.pptx
COMPUTER CABLES Seminar presentation 7.pptxCOMPUTER CABLES Seminar presentation 7.pptx
COMPUTER CABLES Seminar presentation 7.pptx
 
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptxComputer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
 
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptxComputer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
Computer networking- COMPUTER PORTS, AND MULTI-MEDIA.pptx
 
Connectivity-Guide-AU-web
Connectivity-Guide-AU-webConnectivity-Guide-AU-web
Connectivity-Guide-AU-web
 
02 computer parts and ports
02 computer parts  and ports02 computer parts  and ports
02 computer parts and ports
 
NOTA ELEKTRONIK KABEL.pptx
NOTA ELEKTRONIK KABEL.pptxNOTA ELEKTRONIK KABEL.pptx
NOTA ELEKTRONIK KABEL.pptx
 
Commnunication ports and memory card chapter 1
Commnunication ports and memory card chapter 1Commnunication ports and memory card chapter 1
Commnunication ports and memory card chapter 1
 
Slots Presentation
Slots PresentationSlots Presentation
Slots Presentation
 
Computer Ports
Computer PortsComputer Ports
Computer Ports
 
PPT On Ports | Full Concept | Ports In Depth
PPT On Ports | Full Concept | Ports In DepthPPT On Ports | Full Concept | Ports In Depth
PPT On Ports | Full Concept | Ports In Depth
 
FTCP
FTCPFTCP
FTCP
 
Main components of a computerMultimedia devicesOther peripheral .pdf
Main components of a computerMultimedia devicesOther peripheral .pdfMain components of a computerMultimedia devicesOther peripheral .pdf
Main components of a computerMultimedia devicesOther peripheral .pdf
 
DESKTOP PC INTERFACE.pptx
DESKTOP PC INTERFACE.pptxDESKTOP PC INTERFACE.pptx
DESKTOP PC INTERFACE.pptx
 

Recently uploaded

Drugs used in parkinsonism and other movement disorders.pptx
Drugs used in parkinsonism and other movement disorders.pptxDrugs used in parkinsonism and other movement disorders.pptx
Drugs used in parkinsonism and other movement disorders.pptx
ThalapathyVijay15
 
MATHEMATICS BRIDGE COURSE (TEN DAYS PLANNER) (FOR CLASS XI STUDENTS GOING TO ...
MATHEMATICS BRIDGE COURSE (TEN DAYS PLANNER) (FOR CLASS XI STUDENTS GOING TO ...MATHEMATICS BRIDGE COURSE (TEN DAYS PLANNER) (FOR CLASS XI STUDENTS GOING TO ...
MATHEMATICS BRIDGE COURSE (TEN DAYS PLANNER) (FOR CLASS XI STUDENTS GOING TO ...
PinkySharma900491
 
F5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptxF5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptx
ArjunJain44
 
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
kywwoyk
 
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
eemet
 
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
Amil baba
 
Cyber Sequrity.pptx is life of cyber security
Cyber Sequrity.pptx is life of cyber securityCyber Sequrity.pptx is life of cyber security
Cyber Sequrity.pptx is life of cyber security
perweeng31
 
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
kywwoyk
 
web-tech-lab-manual-final-abhas.pdf. Jer
web-tech-lab-manual-final-abhas.pdf. Jerweb-tech-lab-manual-final-abhas.pdf. Jer
web-tech-lab-manual-final-abhas.pdf. Jer
freshgammer09
 

Recently uploaded (9)

Drugs used in parkinsonism and other movement disorders.pptx
Drugs used in parkinsonism and other movement disorders.pptxDrugs used in parkinsonism and other movement disorders.pptx
Drugs used in parkinsonism and other movement disorders.pptx
 
MATHEMATICS BRIDGE COURSE (TEN DAYS PLANNER) (FOR CLASS XI STUDENTS GOING TO ...
MATHEMATICS BRIDGE COURSE (TEN DAYS PLANNER) (FOR CLASS XI STUDENTS GOING TO ...MATHEMATICS BRIDGE COURSE (TEN DAYS PLANNER) (FOR CLASS XI STUDENTS GOING TO ...
MATHEMATICS BRIDGE COURSE (TEN DAYS PLANNER) (FOR CLASS XI STUDENTS GOING TO ...
 
F5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptxF5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptx
 
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
 
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
 
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
 
Cyber Sequrity.pptx is life of cyber security
Cyber Sequrity.pptx is life of cyber securityCyber Sequrity.pptx is life of cyber security
Cyber Sequrity.pptx is life of cyber security
 
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
 
web-tech-lab-manual-final-abhas.pdf. Jer
web-tech-lab-manual-final-abhas.pdf. Jerweb-tech-lab-manual-final-abhas.pdf. Jer
web-tech-lab-manual-final-abhas.pdf. Jer
 

Ecw course

  • 1. Last updated 16/03/2010 21:37 A Guide to Computer Ports Universal Serial Bus (or USB) Port Original Universal Serial Bus Logo The basic USB logo The SuperSpeed USB Logo The USB 3.0 Icon The USB 3.0 Icon A universal serial bus port, introduced around 1997, is the gateway to your computer. It s used to connect all kinds of external devices, such as external hard drives, printers, mice, scanners and more. There are normally two half-inch long USB ports on the back of computers built since 1998. Sometimes there are USB ports built into a hatch on the front of a computer. If you use a USB hub, you can connect as many as 127 devices to a USB port. It can transfer data to a speed of 12 megabits per second, but those 127 devices have to share that speed. Since USB-compliant devices can draw power from a USB port only a few power drawing devices can connect at the same time without the computer system complaining. In 2003, USB 2.0 connectors were introduced on computers. These transfer data at 480 Mbps. Older USB devices work with USB 2.0 ports, but at 12 Mbps. USB 2.0 devices also work with older USB ports, again at the lower speed. USB 3.0 On September 18, 2007, Pat Gelsinger demonstrated USB 3.0 at the Intel Developer Forum. The USB 3.0 Promoter Group announced on November 17, 2008, that version 3.0 of the specification had been completed and was transitioned to the USB Implementers Forum (USB-IF), the managing body of USB specifications. This move effectively opened the spec to hardware developers for implementation in future products. The first certified USB 3.0 consumer products were announced January 5, 2010, at the Las Vegas Consumer Electronics Show (CES), including two motherboards, by ASUS and Gigabyte Technology
  • 2. Last updated 16/03/2010 21:37 Video DB15 Port - a video port for your monitor This connector is used to attach a computer display monitor to a computer s video card. The connector has 15 holes. It sort of looks like a serial port connector, however that port has pins not holes in it. Power Connector - for your power plug This three-pronged plug looks like a recessed power plug. It connects to the computer s power cable that plugs into a power bar or wall socket. Optical Audio (Used by the TOSLINK Cable) This is an optical (not electrical) cable to connect your compuer to a set of high-end speakers. The digital format is S/PDIF, which in the PC world is often sent over a regular electrical cable (usually with an RCA phono plug). The geeky advantage of the optical cable (note the red glow) is that it s totally immune to electromagnetic interference--long speaker wires can act as an antenna, picking up the stray 60hz hum that pervades the universe. My powered speaker cables would actually pick up CB radio, so they d occasionally spit out little snatches of conversation as truckers would go by. It happened rarely enough that I d begun to doubt my own sanity before my wife figured out what was going on. TOSLINK (connects to the Optical Audio Port) TOSLINK or Optical Cable is a standardized optical fibre connection system. Its most common use is in consumer audio equipment (via a digital optical socket), where it carries a digital audio stream between components such as MiniDisc and CD players and DAT recorders. Although TOSLINK supports several different media formats and physical standards, digital audio connections using the rectangular EIAJ/JEITA RC-5720 (also CP-1201 and JIS C5974-1993 F05) connector are by far the most common.
  • 3. Last updated 16/03/2010 21:37 Coaxial Digital (S/PDIF) S/PDIF is a Data Link Layer protocol and a set of Physical Layer specifications for carrying digital audio signals between devices and stereo components over either optical or electrical cable. The name stands for Sony/Philips Digital Interconnect Format (more commonly known as Sony Philips Digital InterFace), Sony and Philips being the primary designers of S/PDIF. S/PDIF is standardized in IEC 60958 where it is known as IEC 60958 type II. S/PDIF is essentially a minor modification of the original AES/EBU standard, for consumer use, providing small differences in the protocol and requiring less-expensive hardware. Sound card colour code: Colour Connector Lime Green Line-Out, Front Speakers, Headphones Pink Microphone Light Blue Stereo Line In Orange Subwoofer and Center out Black Rear Surround Speakers for 5.1 and 7.1 systems Gray Middle Surround Speakers for 7.1 systems Gold Midi / Game port (Joystick) Note: The number of jack connectors you ll find on your soundcard will depend on how many audio channels it has: Stereo cards with just two audio channels will have only the green (output), blue (input) and pink (microphone) jacks. A few sound cards with 8 (7.1) audio channels do not provide the gray (Middle Surround Speakers) connector. If your computer is equipped with this type of card and you want to use all the 8 channels you will need to connect your motherboard to a 7.1 home theater system using the SPDIF digital connector. Some motherboards with 4 or 6 channels don t have the black (Rear Surround) and orange (Subwoofer and Center) jacks. These cards will use the blue jack for both line in and rear surround speakers out, and the pink jack for both mic input and subwoofer/center out. Therefore, whenever you want to use any of these jacks for a different function, you will have to manually remove one jack connector and plug in another.
  • 4. Last updated 16/03/2010 21:37 HDMI Port HDMI (High-Definition Multimedia Interface) is a compact audio/video interface for transmitting uncompressed digital data. It represents a digital alternative to consumer analogue standards, such as radio frequency (RF) coaxial cable, composite video, S- Video, SCART, component video, D-Terminal, or VGA. HDMI connects digital audio/video sources - such as set-top boxes, up convert DVD players, HD DVD players, Blu-ray Disc players, personal computers (PCs), video game consoles such as the PlayStation 3 and Xbox 360, and AV receivers - to compatible digital audio devices, computer monitors, and digital televisions.[ DVI Port DVI stands for (D)igital (V)ideo (I)nterface. DVI is a new form of video interface technology made to maximize the quality of flat panel LCD monitors and high-end video graphics cards. It is a replacement for the P&D Plug & Display standard, and a step up from the digital-only DFP format for older flat panels. DVI is becoming increasingly popular with video card manufacturers, and most cards purchased include both a VGA and a DVI output port. More here
  • 5. Last updated 16/03/2010 21:37 S-VHS S-VHS (Super VHS) is an improved version of the VHS standard for consumer video cassette recorders. It is used to connect to a TV / Monitor. Ethernet or Network Port - connect to a network and high speed Internet Above, an Ethernet port with network cable not plugged in. Below is an Ethernet port with plug inserted. For faster Internet connections and for networking, an Ethernet or network port is used. This looks like an oversized North American telephone jack. The port is used to connect network cabling to a computer. Cable plugged into this port can lead either to a network hub (a junction box that can wire lots of network cables together), directly to a cable modem or DSL modem (both used for high speed Internet) or to an Internet gateway which shares a fast Internet connection between computers. Most newer computers have one of these ports. They can either be built-in to or appear on the exposed part of an Ethernet PCI card, which inserts into a slot inside the computer. Data moves through them at speeds of either 10 megabits or 100 megabits or 1 gigabit (1,000 megabits) depending on what speed the network card in the computer supports. Little monitor lights on these devices flicker when in use. The ACT light flickers when data is moving through the network to or from the port. The 10 or 100 lights relate to data speed. 10 means data is moving across the network at 10 Megabits per second. 100 means the network is moving data at 100 megbits per second.
  • 6. Last updated 16/03/2010 21:37 SATA The serial ATA or SATA computer bus, is a storage-interface for connecting host bus adapters to mass storage devices such as hard disk drives and optical drives. The SATA host adapter is integrated into almost all modern consumer laptop computers and desktop motherboards. Serial ATA was designed to replace the older ATA (AT Attachment) standard (also known as EIDE). It is able to use the same low level commands, but serial ATA host-adapters and devices communicate via a high-speed serial cable over two pairs of conductors. In contrast, the parallel ATA (the redesignation for the legacy ATA specifications) used 16 data conductors each operating at a much lower speed. SATA offers several compelling advantages over the older parallel ATA (PATA) interface: reduced cable-bulk and cost (reduced from 80 wires to seven), faster and more efficient data transfer, and hot swapping. As of 2009, SATA has mostly replaced parallel ATA in all shipping consumer PCs. PATA remains in industrial and embedded applications dependent on CompactFlash storage although the new CFast storage standard will be based on SATA IEEE 1394 or Firewire Port - fast camcorder connector This port is used to transfer large amounts of data very quickly. Usually camcorders and other video equipment use this port to get data onto a computer. Data can move across the port at up to 400 megabits per second. Apple invented this technology and had branded it Firewire. It was also adopted as an industry standard and is called IEEE 1394 on non-Apple computers. Other companies call it i.link and Lynx. Creative Labs which incorporated it into their SoundBlaster Audigy Platinium products call it SB 1394. IEEE 1394 connectors can be used to connect up to 63 external devices to a machine. TOP: A 6-Pin FireWire 400 connector Middle: A 4-Pin FireWire 400 connector. This connector is not powered. Bottom: A 9-Pin FireWire 800 connector
  • 7. Last updated 16/03/2010 21:37 Modem Connects a PC s modem to the telephone network. This is an ordinary phone jack, like you d find in any telephone. Serial Port - for external modems and old computer mice A serial port is used to connect external modems or an older computer mouse to the computer. It comes in two versions a 9- pin version or a 25-pin model. The 9-pin is found on most newer computers. Data travels over a serial port at 115 kilobits per second. Parallel Port - connector for scanners and printers A parallel port is used to connect external devices such as scanners and printers. The 25-pin port is sometimes it is called a printer port. It s also known by the gruesome named: IEEE 1284-compliant Centronics port. The port is sometimes also called more simply a printer port. There are two variants for this type of interface. The ports look exactly like the traditional parallel port but are called ECP (Extend Capabilities Port) and EPP (Enhanced Parallel Port). These interfaces are ten times faster than the older printer port and can support two-way data so that computers can ask for information from a printer as well as send it. PS/2 Port - keyboard and mouse interface A PS/2 port, sometimes called a mouse port, was developed by IBM. It is used to connect a computer mouse or keyboard. Most computers come with two PS/2 ports. Sometimes webcams piggyback on the ports in conjunction with a parallel port. Sometimes it is not necessary to use a mouse port, as some keyboards and mice can be used with a USB port.
  • 8. Last updated 16/03/2010 21:37 AT Keyboard Port Connect a PC to an older keyboard. If you don t plug in a keyboard here, you get the famous BIOS boot error: Keyboard not found. Press F1 to continue. This giant port is a holdover from the ancient IBM PC AT. It s apparently physically the same connector found on MIDI synthesizers and instruments, although it s electrically totally different. Gameport Connect a PC to a joystick (or two). This port is now mostly replaced by USB. This DB-15 connector has several (extremely primitive) analogue inputs and a small number of digital inputs and outputs. Because the MIDI (Musical Instrument Digital Interface) standard scavenged two pins from this port, the port is almost always located on the sound card. Apparently people that use MIDI normally have some sort of big ugly dongle that extracts MIDI signals from their joystick port. SCSI Short for Small Computer System Interface, SCSI pronounced as Scuzzy is the second most commonly used interface for disk drives. Unlike competing standards SCSI is capable of supporting eight devices or sixteen devices with Wide SCSI. SCSI-1 is the original SCSI standard developed back in 1986 as ANSI X3.131-1986. SCSI-1 is capable of transferring up to eight bits a second SCSI-2 approved in 1990 SCSI-2 added new features such as Fast and Wide SCSI, support for additional devices, SCSI-3 was approved in 1996 as ANSI X3.270-1996 SCSI is a standard for parallel interface that transfers information at rate of eight bits per second and faster which is faster than the average parallel interface. SCSI-2 and above supports up to seven peripheral devices , such as a hard drive, CD-ROM, and scanner can attach to a single SCSI port on a system s bus. SCSI ports were designed for Apple Macintosh and Unix computers, but also can be used with PCs. http://www.cablestogo.com/resources/connector_guide.asp?
  • 9. RJ45 Cable Wiring: T-568-B Straight- through & Crossover RJ-45 cabling RJ-45 conductor data cable contains 4 pairs of wires each consists of a solid colored wire and a strip of the same color. There are two wiring standards for RJ-45 wiring: T-568A and T- 568B. Although there are 4 pairs of wires, 10BaseT/100BaseT Ethernet uses only 2 pairs: Orange and Green. The other two colors (blue and brown) may be used for a second Ethernet line or for phone connections. The two wiring standards are used to create a cross-over cable (T-568A on one end, and T-568B on the other end), or a straight- through cable (T-568B or T-568A on both ends). To create a straight-through cable, you'll have to use either T-568A or T-568B on both ends of the cable. The diagram depicted on the left and right shows clip of the RJ-45 connector down. To create a cross-over cable, you'll wire T-568A on one end and T-568B on the other end of the cable. The straight-through cables are used when connecting Data Terminating Equipment (DTE) to Data Communications Equipment (DCE), such as computers and routers to modems (gateways) or hubs (Ethernet Switches). The cross-over cables are used when connecting DTE to DTE, or DCE to DCE equipment; such as computer to computer, computer to router; or gateway to hub connections. The DTE equipment terminates the signal, while DCE equipment do not. More on straight-through and cross-over connections The RJ45 data cables we use to connect computers to a Ethernet switch is straight-through cables. As noted above, the RJ45 cable uses only 2-pairs of wires: Orange (pins 1 & 2) and Green (pins 3 & 6). Pins 4, 5 (Blue) and 7, 8 (Brown) are NOT used. Straight-through cable, as its name suggests, connects pin 1 to pin 1, pin 2 to pin 2, pin 3 to pin 3, and pin 6 to pin 6. Cross-over cables are used to connect TX+ to RX+, and TX- to RX-, which connects pin 1 to pin 3, pin 2 to pin 6, pin 3 to pin 1 and pin 6 to pin 2. The unused pins are generally connected straight-through in both straight-through and cross-over cables. To network two computers without a hub, a cross-over cable is used. Cross-over cable is also used to connect a router to a computer, or ethernet switch (hub) to another ethernet switch without an uplink. Most ethernet switches today provide an uplink port, which prevents a use of cross-over cable to daisy chain another ethernet switch. Straight-through cables are used to connect a computer to an ethernet switch, or a router to an ethernet switch.
  • 10. Pin Number Designations There are pin number designations for each color in T-568B and T-568A. T-568B T-568A -------------------------- ------------------------ Pin Color Pin Name Color Pin Name --- ------------- -------- ------------- -------- 1 Orange Stripe Tx+ Green Stripe Rx+ 2 Orange Tx- Green Rx- 3 Green Stripe Rx+ Orange Stripe Tx+ 4 Blue Not Used Blue Not Used 5 Blue Stripe Not Used Blue Stripe Not Used 6 Green Rx- Orange Tx- 7 Brown Stripe Not Used Brown Stripe Not Used 8 Brown Not Used Brown Not Used RJ45 Color-Coded Scheme RJ45 cables have 8 color-coded wires, and the plugs have 8 pins and conductors. Eight wires are used as 4 pairs, each representing positive and negative polarity. The most commonly used wiring standard for 100baseT is T-586B stanrard described above. Prior to EIA 568A and 568B standards, the color-coded scheme was used to wire RJ45 cables. The table below depicts pin and color schemes used in traditional and standardized setup. Pin Colored Scheme T-568B (Common) T-568A 1 Blue Orange Stripe Green Stripe 2 Orange Orange Green 3 Black Green Stripe Orange Stripe 4 Red Blue Blue 5 Green Blue Stripe Blue Stripe 6 Yellow Green Orange 7 Brown Brown Stripe Brown Stripe 8 White (or Grey) Brown Brown RJ-45 Wiring FAQ 1. What are T-568A and T-568B wiring standards, and how are they different? T-568A and T-568B are the two wiring standards for RJ-45 connector data cable specified by TIA/EIA-568-A wiring standards document. The difference between the two is the position of the orange and green wire pairs. It is preferable to wire to T-568B standards if there is no pre-existing pattern used within a building.
  • 11. 2. What is RJ stands for? RJ stands for Registered Jacks. These are used in telephone and data jack wiring registered with FCC. RJ-11 is a 6-position, 4-conductor jack used in telephone wiring, and RJ-45 is a 8- position, 8-conductor jack used in 10BaseT and 100BaseT ethernet wiring. 3. What is the Category Rating System? Electronic Industries Association (EIA) developed the TIA/EIA-568-A standard, which specifies wiring and performance standards for Unshielded Twisted Pair (UTP) cabling. Category Rating System specifies the definition of performance categories for 100 ohm UTP cabling system. Category 3 specifies the twisted pair cable and connecting hardware that can support transmission frequency up to 16MHz, and data rates up to 10Mbps. This is primarily used in telephone wiring. Category 4 specifies cables and connectors that supports up to 20MHz and data rates up to 16Mbps. With introduction of category 5, this is a rarely used category. Category 5 specifies cables and connectors that supports up to 100MHz and data rates up to 100Mbps. With 100BaseT Ethernet today, Category 5 is a widely used cabling system that matches todays high-speed data requirements. Category TIA/EIA Standard Description Cat 1 None POTS, ISDN and doorbell wiring Cat 2 None 4 Mbps token ring networks Cat 3 TIA/EIA 568-B 10 Mbps Ethernet - frequency up to 16MHz Cat 4 None 16 Mbps token ring networks - frequency up to 20MHz Cat 5 None 100 Mbps Ethernet - frequency up to 100 MHz Not suitable for GigE (1000BaseT) Cat 5e TIA/EIA 568-B 100 Mbps & GigE Ethernet - frequency up to 100 MHz Cat 6 TIA/EIA 568-B 2x Performance of Cat 5 & 5e - frequency up to 250 MHz Cat 6a None Future specification for 10Gbps application Cat 7 ISO/IEC 11801 Class F Designed for transmission at frequencies up to 600 MHz 4. What is UTP Cable? UTP stands for Unshielded Twisted Pair. It is the cabling system with one or more pairs of twisted insulated copper wires contained in a single sheath. It is the most widely used cabling system in telecommunications and data communications environment today.
  • 12. What is the difference between Cross Cable and Straight Cable Now days, LAN card has intelligence, so that both cables can work. They have a feature on lots of switches and hubs etc called "auto-mdix" or cable you use, it will just auto detect the proper connection type no matter which cable you use. The cable can be categorized as Cat 5, Cat 5e, and Cat 6 UTP cable. Cat 5 UTP cable can support 10/100 Mbps Ethernet network, whereas Cat 5e and Cat 6 UTP cable can support Ethernet network running at 10/100/1000 Mbps. You might hear about Cat 3 UTP cable, it's not popular anymore since it can only support 10 Mbps Ethernet network. Straight and crossover cable can be Cat3, Cat 5, Cat 5e or Cat 6 UTP cable, the only difference is each type will have different wire arrangement in the cable for serving different purposes. Ethernet network cables are straight and crossover cable. This Ethernet network cable is made of 4 pair high performance cable that consists of twisted pair conductors that used for data transmission. Both end of cable is called RJ45 connector. There are two types of network cables commonly used in PC networks - Straight-through and cross-over. Straight Cable Usually use straight cable to connect different type of devices. This type of cable will be used most of the time and can be used to: 1) Connect a computer to a switch/hub's normal port. 2) Connect a computer to a cable/DSL modem's LAN port. 3) Connect a router's WAN port to a cable/DSL modem's LAN port. 4) Connect a router's LAN port to a switch/hub's uplink port. (Normally used
  • 13. for expanding network) 5) Connect two switches/hubs with one of the switch/hub using an uplink port and the other one using normal port. If you need to check how straight cable looks like, it's easy. Both sides (side A and side B) of cable have wire arrangement with same color. Crossover Cable Sometimes you will use crossover cable, it's usually used to connect same type of devices. A crossover cable can be used to: 1) Connect two computers directly. 2) Connect a router's LAN port to a switch/hub's normal port. (Normally used for expanding network) 3) Connect two switches/hubs by using normal port in both switches/hubs. In you need to check how crossover cable looks like, both side (side A and side B) of cable have wire arrangement with following different color. This cable (either straight cable or cross cable) has total 8 wires (or we can say lines), i.e. four twisted pairs (4x2=8) with different color codes. Right the cable (but there is a standard). In straight cable connectivity is like as follows RJ451 Connected to RJ452 Pin1------------------------------------- Pin1 Pin2------------------------------------- Pin2 Pin3------------------------------------- Pin3 Pin4------------------------------------- Pin4
  • 14. Pin5------------------------------------- Pin5 Pin6------------------------------------- Pin6 Pin7------------------------------------- Pin7 Pin8------------------------------------- Pin8 In cross cable connectivity is like as follows RJ451 Connected to RJ452 Pin1------------------------------------- Pin3 Pin2------------------------------------- Pin6 Pin3------------------------------------- Pin1 Pin4------------------------------------- Pin4 Pin5------------------------------------- Pin5 Pin6------------------------------------- Pin2 Pin7------------------------------------- Pin7 Pin8------------------------------------- Pin8 Purpose of this cross cable is RX (receiving terminal) connects to TX (transmitting) of one pc to another PC and vice versa. As we use two PCs (same devices), straight cable will connect TX to TX and RX to RX of two computers, so cross cable is required. If you use HUB or switch, then straight cable will work because it has internal arrangement like cross cable. So note that use cross cable to connect two similar devices. A straight cable will not work to connect two computers together.
  • 15. Crossover used to connect to PCs directly together, also used for connecting networking devices together like Switch to Switch etc. Straight cables connect two DIFFERENT types of devices. Whereas crossover cables connect two of the SAME type Now do this (if possible): connect cross cable between switch and PC and see what happens..!
  • 16. Hub Switch Router Workstation Hub Crossover Crossover Straight Straight Switch Crossover Crossover Straight Straight Router Straight Straight Crossover Crossover Workstation Straight Straight Crossover Crossover
  • 17. ----------------------------------------------------------------------------------------------- Communication between Switches and Workstations When a workstation connects to a LAN, it transmits data independently of the other devices connected to the LAN media. The workstation simply transmits data frames from a NIC to the network medium. If desired, the workstation can be attached directly to another workstation by using a crossover cable. Crossover cables connect the following devices: Workstation to workstation Switch to switch Switch to hub Hub to hub Router to router Router to PC Straight-through cables connect the following devices: Switch to router Switch to workstation or server Hub to workstation or server Many modern switches now automatically adjust the port pinout to support the particular cable attached, whether it is a crossover or straight-through cable. Switches, which are Layer 2 devices, use intelligence to learn the MAC addresses of the devices that are attached to its ports. This data is entered into a switching table. After the table is complete, the switch can read the destination MAC address of an incoming data frame on a port and immediately forward it. Until a device transmits, the switch does not know its MAC address. Switches provide significant scalability on a network. Switches are normally connected to each other by way of trunk links. -----------------------------------------------------------------------------------------
  • 18. IP address classes Class 1st Octet Decimal Range 1st Octet High Order Bits Network/Host ID (N=Network, H=Host) Default Subnet Mask Number of Networks Hosts per Network (Usable Addresses) A 1 126* 0 N.H.H.H 255.0.0.0 126 (27 2) 16,777,214 (224 2) B 128 191 10 N.N.H.H 255.255.0.0 16,382 (214 2) 65,534 (216 2) C 192 223 110 N.N.N.H 255.255.255.0 2,097,150 (221 2) 254 (28 2) D 224 239 1110 Reserved for Multicasting E 240 254 1111 Experimental; used for research Note: Class A addresses 127.0.0.0 to 127.255.255.255 cannot be used and is reserved for loopback and diagnostic functions. Private IP Addresses Class Private Networks Subnet Mask Address Range A 10.0.0.0 255.0.0.0 10.0.0.0 - 10.255.255.255 B 172.16.0.0 - 172.31.0.0 255.240.0.0 172.16.0.0 - 172.31.255.255 C 192.168.0.0 255.255.0.0 192.168.0.0 - 192.168.255.255
  • 19. Objective 3.1: Install, configure, and differentiate between common network devices Network switches Computer networking devices are units that mediate data in a computer network and are also called network equipment. Units which are the last receiver or generate data are called hosts or data terminal equipment. Hub Hubs connect computers together in a star topology network. Due to their design, they increase the chances for collisions. Hubs operate in the physical layer of the OSI model and have no intelligence. Hubs flood incoming packets to all ports all the time. For this reason, if a network is connected using hubs, the chances of a collision increases linearly with the number of computers (assuming equal bandwidth use). Hubs pose a security risk since all packets are flooded to all ports all the time. If a user has packet sniffing software, they can extract data from the network and potentially decode it and use it. Hubs make it easy to "spy" on users on the same LAN as you. Repeater A wireless repeater.
  • 20. A repeater is an electronic device that receives a signal and retransmits it at a higher level and/or higher power, or onto the other side of an obstruction, so that the signal can cover longer distances without degradation. Because repeaters work with the actual physical signal, and do not attempt to interpret the data being transmitted, they operate on the physical layer, the first layer of the OSI model. Repeaters are majorly employed in long distance transmission to reduce the effect of attenuation. It is important to note that repeaters do not amplify the original signal but simply regenerate it. Modem Modem (from modulator-demodulator) is a device that turns the digital 1s and 0s of a personal computer into sounds that can be transmitted over the telephone lines of Plain Old Telephone Systems (POTS), and once received on the other side, converts those sounds back into a form used by a USB, Ethernet, serial, or network connection. Modems are generally classified by the amount of data they can send in a given time, normally measured in bits per second, or "bps". NIC (Network Interface Card) A network interface card is a computer hardware component designed to allow computers to communicate over a computer network. It is both an OSI layer 1 (physical layer) and layer 2 (data link layer) device, as it provides physical access to a networking medium and provides a low-level addressing system through the use of MAC addresses. It allows users to connect to each other either by using cables or wirelessly. Most motherboards today come equipped with a network interface card in the form of a controller, with the hardware built into the board itself, eliminating the need for a standalone card. Media converters Media converters are simple networking devices that make it possible to connect two dissimilar media types such as twisted pair with fiber optic cabling. They were introduced to the industry nearly two decades ago, and are important in interconnecting fiber optic cabling- based systems with existing copper-based, structured cabling systems. Media converters support many different data communication protocols including Ethernet, T1/E1, T3/E3, as well as multiple cabling types such as coaxial, twisted pair, multimode and single-mode fiber optics. When expanding the reach of a Local Area Network to span multiple locations, media converters are useful in connecting multiple LANs to form one large "campus area network" that spans over a limited geographic area. As local networks are primarily copper-based, media converters can extend the reach of the LAN over single-mode fiber up to 130 kilometers with 1550 nm optics.
  • 21. Basic switch Switches are often confused with bridges because they also operate at the data link layer of the OSI model. Similar to a hub, switches provide a central connection between two or more computers on a network, but with some intelligence. They provide traffic control for packets; rather than forwarding data to all the connected ports, a switch forwards data only to the port on which the destination system is connected. They use a database of MAC addresses to determine where computers are located and very efficiently send packets only where they need to go. The database is created dynamically as computers communicate on the network. The switch simply watches the incoming packets and memorizes the MAC address and port a packet arrives on. If a packet arrives with a destination computer that the switch does not have an address for in its MAC address table, it will flood the packet out all connected ports. A switch creates separate collision domains for each physical connection. A switch will only create separate broadcast domains if separate VLANs (Virtual Local Area Networks) are assigned to different ports on the switch. Otherwise, a broadcast received on one port will be flooded out all ports except the one it came in on. Bridge Bridges can be identified by the fact that they operate at the data link layer of the OSI model. Bridges have intelligence and can "bridge" two of their ports together at very high speed. They use a database of MAC addresses to determine where computers are located and very efficiently send frames only where they need to go. The database is created dynamically as computers communicate on the network. A bridge simply watches the incoming frame and memorizes the MAC address and port a frame arrives on. It uses this information to locate a computer if a packet comes in that must be forwarded to it. If a frame arrives at the bridge and the bridge does not know where to send it, the bridge will flood the frame just like a hub does. Bridging is often inaccurately called switching.
  • 22. Wireless access point A wireless access point (WAP or AP) is a device that allows wireless communication devices to connect to a wireless network using Wi-Fi, Bluetooth or related standards. The WAP usually connects to a wired network, and can relay data between the wireless devices (such as computers or printers) and wired devices on the network. A typical corporate use involves attaching several WAPs to a wired network and then providing wireless access to the office Local Area Network. Within the range of the WAPs, the wireless end user has a full network connection with the benefit of mobility. In this instance, the WAP functions as a gateway for clients to access the wired network. A Hot Spot is a common public application of WAPs, where wireless clients can connect to the Internet without regard for the particular networks to which they have attached for the moment. The concept has become common in large cities, where a combination of coffeehouses, libraries, as well as privately owned open access points, allow clients to stay more or less continuously connected to the Internet, while moving around. A collection of connected Hot Spots can be referred to as a lily-pad network. Home networks generally have only one WAP to connect all the computers in a home. Most are wireless routers, meaning converged devices that include a WAP, router, and often an Ethernet switch in the same device. Many also converge a broadband modem. In places where most homes have their own WAP within range of the neighbors' WAP, it's possible for technically savvy people to turn off their encryption and set up a wireless community network, creating an intra-city communication network without the need of wired networks. Basic router
  • 23. Routers operate at the network layer of the OSI model and efficiently route information between Local Area Networks. Since routers operate in the third layer, the network layer, they must understand layer 3 addressing... such as TCP/IP. A router will divide a broadcast domain by not forwarding broadcasts on one connected network to another connected network. Routers operate in two different planes: the control plane, in which the router learns the outgoing interface that is most appropriate for forwarding specific packets to specific destinations, and the forwarding plane, which is responsible for the actual process of sending a packet received on a logical interface to an outbound logical interface. Basic firewall A firewall is a part of a computer system or network that is designed to block unauthorized access while permitting outward communication. It is also a device or set of devices configured to permit, deny, encrypt, decrypt, or proxy all computer traffic between different security domains based upon a set of rules and other criteria. Firewalls can be implemented in both hardware and software, or a combination of both. Firewalls are frequently used to prevent unauthorized Internet users from accessing private networks connected to the Internet. All messages entering or leaving the Local Area Network pass through the firewall, which examines each message and blocks those that do not meet the specified security criteria. Without proper configuration, a firewall can often become worthless. Standard security practices dictate a "default-deny" firewall ruleset, in which the only network connections which are allowed are the ones that have been explicitly allowed. Basic DHCP (Dynamic Host Configuration Protocol) server When a DHCP-configured client (be it a computer or any other network-aware device) connects to a network, the DHCP client sends a broadcast query requesting necessary information from a DHCP server. The DHCP server manages a pool of IP addresses and information about client configuration parameters such as the default gateway, the domain name, the DNS (Domain Name System) servers, other servers such as time servers, and so forth. Upon receipt of a valid request the server will assign the computer an IP address, a lease (the length of time for which the allocation is valid), and other IP configuration parameters, such as the subnet mask and the default gateway. The query is typically initiated immediately after booting and must be completed before the client can initiate IP-based communication with other hosts.
  • 24. Basic Network Commands Table of Contents 13.1 ping 13.2 traceroute 13.3 DNS Tools 13.4 finger 13.5 telnet 13.6 The Secure shell 13.7 email 13.8 Browsers 13.9 FTP Clients 13.10 Talking to Other People A network consists of several computers connected together. The network can be as simple as a few computers connected in your home or office, or as complicated as a large university network or even the entire Internet. When your computer is part of a network, you have access to those systems either directly or through services like mail and the web. There are a variety of networking programs that you can use. Some are handy for performing diagnostics to see if everything is working properly. Others (like mail readers and web browsers) are useful for getting your work done and staying in contact with other people. 1 ping ping(8) sends an ICMP ECHO_REQUEST packet to the specified host. If the host responds, machine is alive. If there is no response, you know something is wrong. Here is an example conversation between two Linux users: User A: Loki's down again. User B: Are you sure? User A: Yeah, I tried pinging it, but there's no response. It's instances like these that make ping a very useful day-to-day command. It provides a very quick way to see if a machine is up and connected to the network. The basic syntax is:
  • 25. % ping www.slackware.com There are, of course, several options that can be specified. Check the ping(1) man page for more information. 2 traceroute Slackware's traceroute(8) command is a very useful network diagnostic tool. traceroute displays each host that a packet travels through as it tries to reach its destination. You can see om the Slackware web site you are with this command: % traceroute www.slackware.com Each host will be displayed, along with the response times at each host. Here is an example output: % traceroute www.slackware.com traceroute to www.slackware.com (204.216.27.13), 30 hops max, 40 byte packets 1 zuul.tdn (192.168.1.1) 0.409 ms 1.032 ms 0.303 ms 2 207.171.227.254 (207.171.227.254) 18.218 ms 32.873 ms 32.433 ms 3 border-sf-2-0-4.sirius.com (205.134.230.254) 15.662 ms 15.731 ms 16.142 ms 4 pb-nap.crl.net (198.32.128.20) 20.741 ms 23.672 ms 21.378 ms 5 E0-CRL-SFO-03-E0X0.US.CRL.NET (165.113.55.3) 22.293 ms 21.532 ms 21.29 ms 6 T1-CDROM-00-EX.US.CRL.NET (165.113.118.2) 24.544 ms 42.955 ms 58.443 ms 7 www.slackware.com (204.216.27.13) 38.115 ms 53.033 ms 48.328 ms DNS Tools Domain Name Service (DNS for short) is that magical protocol that allows your computer to turn meaningless domain names like www.slackware.com into meaningful IP address like 64.57.102.34. Computers can't route packets to www.slackware.com, but they can route packets to that domain name's IP address. This gives us a convenient way to remember machines. Without DNS we'd have to keep a mental database of just what IP address belongs to what computer, and that's assuming the IP address doesn't change. Clearly using names for computers is better, but how do we map names to IP addresses?
  • 26. 13.3.1 host host(1) can do this for us. host is used to map names to IP addresses. It is a very quick and simple utility without a lot of functions. % host www.slackware.com www.slackware.com is an alias for slackware.com. slackware.com has address 64.57.102.34 But let's say for some reason we want to map an IP address to a domain name; what then? 13.3.2 nslookup nslookup is a tried and true program that has weathered the ages. nslookup has been deprecated and may be removed from future releases. There is not even a man page for this program. % nslookup 64.57.102.34 Note: nslookup is deprecated and may be removed from future releases. Consider using the `dig' or `host' programs instead. Run nslookup with the `-sil[ent]' option to prevent this message from appearing. Server: 192.168.1.254 Address: 192.168.1.254#53 Non-authoritative answer: www.slackware.com canonical name = slackware.com. Name: slackware.com Address: 64.57.102.34 13.3.3 dig The meanest dog in the pound, the domain information groper, dig(1) for short, is the go-to program for finding DNS information. dig can grab just about anything from a DNS server including reverse lookups, A, CNAME, MX, SP, and TXT records. dig has many command line options and if you're not familiar with it you should read through it's extensive man page. % dig @192.168.1.254 www.slackware.com mx ; <<>> DiG 9.2.2 <<>> @192.168.1.254 www.slackware.com mx ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26362 ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2 ;; QUESTION SECTION: ;www.slackware.com. IN MX ;; ANSWER SECTION: www.slackware.com. 76634 IN CNAME slackware.com. slackware.com. 86400 IN MX 1 mail.slackware.com. ;; AUTHORITY SECTION: slackware.com. 86400 IN NS ns1.cwo.com. slackware.com. 86400 IN NS ns2.cwo.com.
  • 27. ;; ADDITIONAL SECTION: ns1.cwo.com. 163033 IN A 64.57.100.2 ns2.cwo.com. 163033 IN A 64.57.100.3 ;; Query time: 149 msec ;; SERVER: 192.168.1.254#53(192.168.1.254) ;; WHEN: Sat Nov 6 16:59:31 2004 ;; MSG SIZE rcvd: 159 This should give you an idea how dig works. the type of lookup I am performing. The above query tells me that e-mail to www.slackware.com will instead be sent to mail.slackware.com for delivery. 4 finger finger(1) will retrieve information about the specified user. You give finger a username or an email address and it will try to contact the necessary server and retrieve the username, office, telephone number, and other pieces of information. Here is an example: % finger johnc@idsoftware.com finger finger server. The one included with Slackware returns the following information by default: Username Room number Home phone number Work phone number Login status Email status Contents of the .plan file in the user's home directory Contents of the .project file in the user's home directory The first four items can be set with the chfn command. It stores those values in the /etc/passwd file. To change the information in your .plan or .project file, just edit them with your favorite text editor. They must reside in your home directory and must be called .plan and .project. Many users finger their own account from a remote machine to quickly see if they have new email. Or, you can see a user's plan or current project.
  • 28. 5 telnet Someone once stated that telnet(1) was the coolest thing he had ever seen on computers. The ability to remotely log in and do stuff on another computer is what separates Unix and Unix-like operating systems from other operating systems. telnet allows you to log in to a computer, just as if you were sitting at the terminal. Once your username and password are verified, you are given a shell prompt. From here, you can do anything requiring a text console. Compose email, read newsgroups, move files around, and so on. If you are running X and you telnet to another machine, you can run X programs on the remote computer and display them on yours. To login to a remote machine, use this syntax: % telnet <hostname> If the host responds, you will receive a login prompt. Give it your username and password. That's it. You are now at a shell. To quit your telnet session, use either the exit command or the logout command. telnet does not encrypt the information it sends. Everything is sent in plain text, even passwords. It is not advisable to use telnet over the Internet. Instead, consider the Secure Shell. It encrypts all traffic and is available for free. 13.5.1 The other use of telnet Now that we have convinced you not to use the telnet protocol anymore to log into a remote machine, we'll show you a couple of useful ways to use telnet. You can also use the telnet command to connect to a host on a certain port. % telnet <hostname> [port] This can be quite handy when you quickly need to test a certain service, and you need full control over the commands, and you need to see what exactly is going on. You can interactively test or use an SMTP server, a POP3 server, an HTTP server, etc. this way. In the next figure you'll see how you can telnet to a HTTP server on port 80, and get some basic information from it. Figure 13-1. Telnetting to a webserver % telnet store.slackware.com 80 Trying 69.50.233.153... Connected to store.slackware.com. Escape character is '^]'. HEAD / HTTP/1.0
  • 29. HTTP/1.1 200 OK Date: Mon, 25 Apr 2005 20:47:01 GMT Server: Apache/1.3.33 (Unix) mod_ssl/2.8.22 OpenSSL/0.9.7d Last-Modified: Fri, 18 Apr 2003 10:58:54 GMT ETag: "193424-c0-3e9fda6e" Accept-Ranges: bytes Content-Length: 192 Connection: close Content-Type: text/html Connection closed by foreign host. % You can do the same for other plain-text protocols, as long as you know what port to connect to, and what the commands are. 6 The Secure shell Today, secure shell basks in the adoration that telnet once enjoyed. ssh(1) allows one to make a connection to a remote machine and execute programs as if one were physically present; however, ssh encrypts all the data travelling between the two computers so even if others intercept the conversation, they are unable to understand it. A typical secure shell connection follows. % ssh carrier.lizella.net -l alan The authenticity of host 'carrier.lizella.net (192.168.1.253)' can't be established. RSA key fingerprint is 0b:e2:5d:43:4c:39:4f:8c:b9:85:db:b2:fa:25:e9:9d. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'carrier.lizella.net' (RSA) to the list of known hosts. Password: password Last login: Sat Nov 6 16:32:19 2004 from 192.168.1.102 Linux 2.4.26-smp. alan@carrier:~$ ls -l MANIFEST -rw-r--r-- 1 alan users 23545276 2004-10-28 20:04 MANIFEST alan@carrier:~$ exit logout Connection to carrier.lizella.net closed. There you see me making an ssh connection to carrier.lizella.net, and checking the permissions on the MANIFEST file. 7 email Electronic mail is one of the most popular things one can do on the Internet. In 1998, it was reported that more electronic mail was sent than regular mail. It is indeed common and useful.
  • 30. Under Slackware, we provide a standard mail server, and several mail clients. All of the clients discussed below are text-based. A lot of Windows users may be against this, but you will find that a text based client is very convenient, especially when checking mail remotely. Fear not, there are many graphical e-mail clients such as KDE's Kmail. If you wish to use one of those check its help menu. 13.7.1 pine pine(1) is not elm. Or so the saying goes. The University of Washington created their program for Internet news and email out of a need for an easy mail reader for their students. pine is one of the most popular email clients in use today and is available for nearly every flavor of Unix and even Windows. Figure 13-2. The Pine main menu You will see a menu of commands and a row of command keys at the bottom. pine is indeed a complex program, so we will not discuss every feature about it here. To see what's in your inbox, type i. Your messages are listed with their date, author, and subject. Highlight the message you want and press enter to view it. Pressing r will start a reply to the message. Once you have written the response, type Ctrl+X to send it. You can press i to get back to the message listing. If you want to delete a message, press d. It will mark the highlighted message for deletion. pine deletes the mail when you exit the program. pine also lets you store your mail in folders. You can get a listing of folders by pressing l. At the message listing, press s to save it to another folder. It will ask for the folder name to write the message to.
  • 31. pine offers many, many features; you should definitely have a look at the man page for more information. It will contain the latest information about the program. 13.7.2 elm elm(1) is another popular text-based email client. Though not quite as user friendly as pine, it's definitely been around a lot longer. Figure 13-3. Elm main screen By default, you are placed in your inbox. The messages are listed with the message number, date, sender, and subject. Use the arrow keys to highlight the message you want. Press Enter to read the message. To compose a new message, type m at the main screen. The d key will flag a message for deletion. And the r key will reply to the current message you are reading. All of these keys are displayed at the bottom of the screen with a prompt. The man page discusses elm in more detail, so you will probably want to consult that before using elm. 13.7.3 mutt mutt's original interface was based on elm with added features found in other popular mailclients, resulting in a hybrid mutt.
  • 32. Some of mutt's features include: color support message threading MIME and PGP/MIME support pop3 and imap support support for multiple mailbox formats (mbox, MMDF, MH, maildir) highly customizable Figure 13-4. Mutt main screen if you're looking for a mail client that will let you be in total control over everything, then you will like mutt. all the default settings can be customized, keybindings can be changed. if you like to add a macro, you can. you probably want to take a look at the muttrc manpage, which will tell you how to configure everything. or take a look at the included example muttrc file. 13.7.4 nail nail(1) is a command line driven mail client. It is very primitive and offers pretty much nothing in the way of user interfaces. However, mailx is handy for times when you need to quickly mail something, scripting a bulk mailer, testing your MTA installation or something similar. Note that Slackware creates symbolic links to nail at /usr/bin/mail and /usr/bin/mailx. Any of these three commands executes the same program. In fact, you will most likely see nail referred to as mail.
  • 33. The basic command line is: % mailx <subject> <to-addr> mailx reads the message body from standard input. So you can cat a file into this command to mail it, or you can just type text and hit Ctrl+D when finished with the message. Here is an example of mailing a program source file to another person. % cat randomfunc.c | mail -s "Here's that function" asdf@example.net 8 Browsers Or looking at websites using a web browser. This is probably by far the most popular use of the Internet for the average user. options below. 13.8.1 lynx lynx(1) is a text-based web browser. It is a very quick way of looking up something on the Internet. Sometimes graphics just get in the way if you know exactly what you're after. To start lynx, just type lynx at the prompt: % lynx Figure 13-5. Lynx default start page
  • 34. You may want to specify a site for lynx to open to: % lynx http://www.slackware.com lynx prints the command keys and what they do at the bottom of the screen. The up and down arrow keys move around the document, Enter selects the highlighted link, and the left arrow goes back to the previous page. Typing d will download the currently selected file. The g command brings up the Go prompt, where you can give lynx a URL to open. There are many other commands in lynx. You can either consult the man page, or type h to get the help screen for more information. 13.8.2 links Just like lynx, links is a textmode web browser, where you do all the navigation using the keyboard. However, when you press the Esc key, it will activate a very convenient pulldown menu on the top of the screen. This makes it very easy to use, without having to learn all the keyboard shortcuts. People who do not use a text browser every day will appreciate this feature. links seems to have better support for both frames and tables, when compared to lynx. Figure 13-6. Links, with the file menu open
  • 35. 13.8.3 wget wget(1) is a command line utility that will download files from a specified URL. While not an actual web-browser, wget is used primarily to grab whole or partial web sites for offline viewing, or for fast download of single files from HTTP or FTP servers instead. The basic syntax is: % wget <url> You can also pass options. For example, this will download the Slackware web site: % wget --recursive http://www.slackware.com wget will create a www.slackware.com directory and store the files in there, just as the site does. wget can also download files from FTP sites; just specify an FTP URL instead of an HTTP one. % wget ftp://ftp.gnu.org/gnu/wget/wget-1.8.2.tar.gz --12:18:16-- ftp://ftp.gnu.org/gnu/wget/wget-1.8.2.tar.gz => `wget-1.8.2.tar.gz' Resolving ftp.gnu.org... done. Connecting to ftp.gnu.org[199.232.41.7]:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /gnu/wget ... done. ==> PORT ... done. ==> RETR wget-1.8.2.tar.gz ... done.
  • 36. Length: 1,154,648 (unauthoritative) 100%[==================================>] 1,154,648 209.55K/s ETA 00:00 12:18:23 (209.55KB/s) - `wget-1.8.2.tar.gz' saved [1154648] 9 FTP Clients FTP stands for the File Transfer Protocol. It allows you to send and receive files between two computers. There is the FTP server and the FTP client. We discuss the client in this section. request and lets you login. You will download files from and upload files to the server. The client cannot accept FTP connections, it can only connect to servers. 13.9.1 ftp To connect to an FTP server, simply run the ftp(1) command and specify the host: % ftp <hostname> [port] If the host is running an FTP server, it will ask for a username and password. You can log in For example, to get Slackware Linux via FTP, you must use anonymous FTP. Once connected, you will be at the ftp> prompt. There are special commands for FTP, but they are similar to other standard commands. The following shows some of the basic commands and what they do: Table 13-1. ftp commands Command Purpose ls List files cd <dirname> Change directory bin Set binary transfer mode ascii Set ASCII transfer mode get <filename> Download a file
  • 37. Command Purpose put <filename> Upload a file hash Toggle hash mark stats indicator tick Toggle byte counter indicator prom Toggle interactive mode for downloads mget <mask> Download a file or group of files; wildcards are allowed mput <mask> Upload a file or group of files; wildcards are allowed quit Log off the FTP server You can also use some of the following commands which are quite self-explanatory: chmod, delete, rename, rmdir. For a complete list of all commands and their meaning, just type help or ? and you'll see a complete listing on screen. FTP is a fairly simple program to use, but lacks the user interface that many of us are used to nowadays. The man page discusses some of the command line options for ftp(1). ftp> ls *.TXT 200 PORT command successful. 150 Opening ASCII mode data connection for /bin/ls. -rw-r--r-- 1 root 100 18606 Apr 6 2002 BOOTING.TXT -rw-r--r-- 1 root 100 10518 Jun 13 2002 COPYRIGHT.TXT -rw-r--r-- 1 root 100 602 Apr 6 2002 CRYPTO_NOTICE.TXT -rw-r--r-- 1 root 100 32431 Sep 29 02:56 FAQ.TXT -rw-r--r-- 1 root 100 499784 Mar 3 19:29 FILELIST.TXT -rw-r--r-- 1 root 100 241099 Mar 3 19:12 PACKAGES.TXT -rw-r--r-- 1 root 100 12339 Jun 19 2002 README81.TXT -rw-r--r-- 1 root 100 14826 Jun 17 2002 SPEAKUP_DOCS.TXT -rw-r--r-- 1 root 100 15434 Jun 17 2002 SPEAK_INSTALL.TXT -rw-r--r-- 1 root 100 2876 Jun 17 2002 UPGRADE.TXT 226 Transfer complete. ftp> tick Tick counter printing on (10240 bytes/tick increment). ftp> get README81.TXT local: README81.TXT remote: README81.TXT 200 PORT command successful. 150 Opening BINARY mode data connection for README81.TXT (12339 bytes). Bytes transferred: 12339 226 Transfer complete. 12339 bytes received in 0.208 secs (58 Kbytes/sec) 13.9.2 ncftp ncftp(1) (pronounced "Nik-F-T-P") is an alternative to the traditional ftp client that comes with Slackware. It is still a text-based program, but offers many advantages over ftp, including:
  • 38. Tab completion Bookmarks file More liberal wildcard uses Command history By default, ncftp will try to log in anonymously to the server you specify. You can force ncftp -u use the same commands as in ftp, only you'll notice a nicer interface, one that works more like bash. ncftp /pub/linux/slackware > cd slackware-current/ Please read the file README81.TXT it was last modified on Wed Jun 19 16:24:21 2002 - 258 days ago CWD command successful. ncftp ...ware/slackware-current > ls BOOTING.TXT FAQ.TXT bootdisks/ CHECKSUMS FILELIST.TXT extra/ CHECKSUMS.asc GPG-KEY isolinux/ CHECKSUMS.md5 PACKAGES.TXT kernels/ CHECKSUMS.md5.asc PRERELEASE_NOTES pasture/ COPYING README81.TXT rootdisks/ COPYRIGHT.TXT SPEEKUP_DOCS.TXT slackware/ CRYPTO_NOTICE.TXT SPEEK_INSTALL.TXT source/ CURRENT.WARNING Slackware-HOWTO ChangeLog.txt UPGRADE.TXT ncftp ...ware/slackware-current > get README81.TXT README81.TXT: 12.29 kB 307.07 kB/s
  • 39. Networking Basics In the world of modern technology, the process of networking has become an essential tool for governments, businesses, and even schools to operate both efficiently and securely. What is Networking? Networking is the practice of linking multiple computing devices together in order to share resources. These resources can be printers, CDs, files, or even electronic communications such as e-mails and instant messages. These networks can be created using several different methods, such as cables, telephone lines, satellites, radio waves, and infrared beams. Without the ability to network, businesses, government agencies, and schools would be unable to operate as efficiently as they do today. The ability for an office or school to connect dozens of computers to a single printer is a seemingly simple, yet extremely useful capability. Perhaps even more valuable is the ability to access the same data files from various computers throughout a building. This is incredibly useful for companies that may have files that require access by multiple employees daily. By utilizing networking, those same files could be made available to several employees on separate computers simultaneously, improving efficiency. The Ins and Outs of Networking When it comes to networking, there are two essential pieces of equipment that enable numerous devices to be connected: routers and switches Switches Switches are used in order to connect many devices on the same network. These devices are generally within the same building, such as an office building or school and could consist of various computers, printers, and other gadgets. The switch acts as a controller, allowing the connected objects to share information with one another. This not only increases productivity and efficiency, but also saves money. Routers In addition to switches, networks generally employ routers as well. These essential tools connect different networks to each other through the internet in order to allow for data exchange between networks. Whereas the switch can be considered a controller, a router should be considered more of a dispatcher, packaging digital information and choosing the best route for it to travel. Routers can feature several other functions, including firewalls and virtual private networks (VPNs) that enhance the security of the data being sent over the internet. Network Types There are countless types of networks available, especially as networking technologies continue to advance. Two of the most commonly employed networks are LAN and WAN.
  • 40. short distances, such as within a building, school, or home. LANs generally employ Ethernet cables as a means of connecting the various gadgets within the network. distances than LANs. A WAN is established by using routers to connect various LANs and are generally not owned by a single person or organization. The internet is one massive WAN that spans the entire planet. ncluding wireless local area networks (WLANs) that are LANs based on wireless network technology and metropolitan area networks (MANs) that cover larger areas than LANs but smaller areas than WANs. These MANs generally span a city and are owned and operated by a government or corporation. Network Topology Not to be confused with network type, network topology refers to the virtual layout of the devices within a network and can refer to five distinct categories: devices on a network. Found in some offices and schools, ring topologies give each device two neighbors for communication purposes. All data travels in a ring, and a failure of that ring can bring down the whole network. objects on the network. This hub could be a router or a switch. in order to vastly increase the number of computers able to connect to the network. on the network has multiple paths it can take instead of one fixed route. The internet is a perfect example of this topology. The Art of Computer Networking Computer networking has become a central theme in nearly every aspect of life. From home use to business use, more and more devices are being produced that can access computer networks. Because of this fact, it is important to understand just what computer networking is. Computer Network Definition A computer network is a collection of computers and other devices that are able to communicate with each other and share data. These devices include computers, printers, tablets, phones, and many other electronics. Computer Networking Essentials Both traditional and modern forms of computer networking aim to provide users with the ability to share data amongst multiple gadgets, whether they be in the same building or across the globe. Traditional computer networking relied on Ethernet and fiber optic cables to
  • 41. connect various devices on a network. More modern technology has emerged that allows for wireless connections between electronics. These technologies include Wi-Fi and Bluetooth compatible devices. It is very helpful to understand the role that each of these technologies plays in computer networking. simultaneously, such as satellites or cellular networks are considered wide area interconnects. They are generally expensive to build and run more slowly than others due to the large area and high volume of users. support a very large amount of data and serve many clients who share common hardware. include tools such as Bluetooth. These interconnects are highly optimized for low-cost and also low power usage. Bluetooth is used in many mobile devices, laptop computers, and speakers in order to enable the transfer of data. Popular information sent over Bluetooth includes music, phone calls, and contact information. The market for Bluetooth technology is growing at a rapid pace to include many other items such as remote controlled helicopters and cars, home security systems, and fitness gear. Because it is rather affordable for the connectivity it supplies, Bluetooth technology is finding its way into countless niches.
  • 42. An operating System (OS) is an intermediary between users and computer hardware. It provides users an environment in which a user can execute programs conveniently and efficiently. In technical terms, It is a software which manages hardware. An operating System controls the allocation of resources and services such as memory, processors, devices and information. Definition An operating system is a program that acts as an interface between the user and the computer hardware and controls the execution of all kinds of programs. Following are some of important functions of an operating System. Memory Management Processor Management Device Management File Management Security Control over system performance Job accounting Error detecting aids Coordination between other software and users Memory Management Memory management refers to management of Primary Memory or Main Memory. Main memory is a large array of words or bytes where each word or byte has its own address.
  • 43. Main memory provides a fast storage that can be access directly by the CPU. So for a program to be executed, it must in the main memory. Operating System does the following activities for memory management. Keeps tracks of primary memory i.e. what part of it are in use by whom, what part are not in use. In multiprogramming, OS decides which process will get memory when and how much. Allocates the memory when the process requests it to do so. De-allocates the memory when the process no longer needs it or has been terminated. Processor Management In multiprogramming environment, OS decides which process gets the processor when and how much time. This function is called process scheduling. Operating System does the following activities for processor management. Keeps tracks of processor and status of process. Program responsible for this task is known as traffic controller. Allocates the processor(CPU) to a process. De-allocates processor when processor is no longer required. Device Management OS manages device communication via their respective drivers. Operating System does the following activities for device management. Keeps tracks of all devices. Program responsible for this task is known as the I/O controller. Decides which process gets the device when and for how much time. Allocates the device in the efficient way. De-allocates devices. File Management A file system is normally organized into directories for easy navigation and usage. These directories may contain files and other directions. Operating System does the following activities for file management. Keeps track of information, location, uses, status etc. The collective facilities are often known as file system. Decides who gets the resources. Allocates the resources. De-allocates the resources. Other Important Activities Following are some of the important activities that Operating System does.
  • 44. Security -- By means of password and similar other techniques, preventing unauthorized access to programs and data. Control over system performance -- Recording delays between request for a service and response from the system. Job accounting -- Keeping track of time and resources used by various jobs and users. Error detecting aids -- Production of dumps, traces, error messages and other debugging and error detecting aids. Coordination between other softwares and users -- Coordination and assignment of compilers, interpreters, assemblers and other software to the various users of the computer systems.
  • 45. What is an operating system? An operating system is the most important software that runs on a computer. It manages the computer's memory, processes, and all of its software and hardware. It also allows you to communicate with the computer without knowing how to speak the computer's language. Without an operating system, a computer is useless. Watch the video to learn about operating systems. The operating system's job Your computer's operating system (OS) manages all of the software and hardware on the computer. Most of the time, there are many different computer programs running at the same time, and they all need to access your computer's central processing unit (CPU), memory, and storage. The operating system coordinates all of this to make sure each program gets what it needs. Types of operating systems Operating systems usually come preloaded on any computer you buy. Most people use the operating system that comes with their computer, but it's possible to upgrade or even change operating systems. The three most common operating systems for personal computers are Microsoft Windows, Apple Mac OS X, and Linux. Modern operating systems use a graphical user interface, or GUI (pronounced gooey). A GUI lets you use your mouse to click icons, buttons, and menus, and everything is clearly displayed on the screen using a combination of graphics and text. Each operating system's GUI has a different look and feel, so if you switch to a different operating system it may seem unfamiliar at first. However, modern operating systems are designed to be easy to use, and most of the basic principles are the same.
  • 46. Before GUIs, computers had a command-line interface, which meant users had to type every single command to the computer and the computer would only display text. Microsoft Windows Microsoft created the Windows operating system in the mid-1980s. Over the years, there have been many different versions of Windows, but the most recent ones are Windows 8 (released in 2012), Windows 7 (2009), and Windows Vista (2007). Windows comes preloaded on most new PCs, which helps to make it the most popular operating system in the world. If you're buying a new computer or are upgrading to a newer version of Windows, you can choose from several different editions of Windows, such as Home Premium, Professional, and Ultimate. You may need to do some research to decide which edition is right for you.
  • 47. Mac OS X Mac OS is a line of operating systems created by Apple. It comes preloaded on all new Macintosh computers, or Macs. All of the recent versions are known as OS X (pronounced O-S Ten), and the specific versions include Yosemite (released in 2014), Mavericks (2013), Mountain Lion (2012), Lion (2011), and Snow Leopard (2009). Apple also offers a version called Mac OS X Server, which is designed to be run on servers. According to StatCounter Global Stats, Mac OS X users account for 9.5% of the operating systems market as of September 2014 much lower than the percentage of Windows users (almost 90%). One reason for this is that Apple computers tend to be more expensive. However, many people prefer the look and feel of Mac OS X.
  • 48. Linux Linux (pronounced LINN-ux) is a family of open-source operating systems, which means they can be modified and distributed by anyone around the world. This is different from proprietary software like Windows, which can only be modified by the company that owns it (Microsoft). The advantages of Linux are that it is free, and there are many different distributions or versions you can choose from. Each distribution has a different look and feel, and the most popular ones include Ubuntu, Mint, and Fedora. Linux is named after Linus Torvalds, who created the Linux kernel in 1991. The kernel is the computer code that is the central part of an operating system. According to StatCounter Global Stats, Linux users account for less than 2% of the operating systems market as of September 2014. However, most servers run Linux because it's relatively easy to customize.
  • 49. Operating systems for mobile devices The operating systems we've been talking about were designed to run on desktop or laptop computers. Mobile devices such as phones, tablet computers, and MP3 players are different from desktop and laptop computers, so they run operating systems that are designed specifically for mobile devices. Examples of mobile operating systems include Apple iOS, Windows Phone, and Google Android. In the screenshot below, you can see Apple iOS running on an iPad. Operating systems for mobile devices generally aren't as fully featured as those made for desktop and laptop computers, and they aren't able to run all of the same software. However, you can still do a lot of things with them, like watch movies, browse the Web, manage your calendar, and play games.
  • 50.
  • 51. Raspberry Pi Basics Content is taken from https://www.howtoforge.com/tutorial/howto-install-raspbian-on- raspberry-pi/ Raspberry Pi Basics: installing Raspbian and getting it up and running So, are you a person who got a Raspberry Pi (aka "Pi") and want to start building something with it but don't know how to go about it? If yes, then this tutorial is for you. Here in this howto, we go about installing the Raspbian OS and initiating a desktop environment. Introduction Raspberry Pi is a credit card sized micro processor available in different models with different processing speed starting from 700 MHz. Whether you have a model B or model B+, or the very old version, the installation process remains the same. People who have checked out the official Raspberry Pi website, might have seen them recommending the "NOOBS" or "NOOBS LITE" Operating System (aka "OS") for beginners. But using the Pi is very easy and from being a beginner, one will turn pro in no time. So, it's better to go with the more powerful and more efficient OS, the Raspbian. The main reason why Raspbian is extremely popular is that it has thousands of pre built libraries to perform many tasks and optimize the OS. This forms a huge advantage while building applications. 1 Downloading Raspbian and Image writer Download the latest version of Raspbian from here. You can download it directly or via the torrents. You will be needing an image writer to write the downloaded OS into the SD card (micro SD card in case of Raspberry Pi B+ model). So download the "win32 disk imager" from here. 2 Writing the image Insert the SD card into the laptop/pc and run the image writer. Once open, browse and select the downloaded Raspbian image file. Select the correct device, that is the drive representing the SD card. If the drive (or device) selected is different from the SD card then the other selected drive will become corrupted. SO be careful. After that, click on the "Write" button in the bottom. As an example, see the image below, where the SD card (or micro SD) drive is represented by the letter "G:"
  • 52. Once the write is complete, eject the SD card and insert it into the Raspberry Pi and turn it on. It should start booting up. 3 Setting up the Pi Please remember that after booting the Pi, there might be situations when the user credentials like the "username" and password will be asked. Raspberry Pi comes with a default user name and password and so always use it whenever it is being asked. The credentials are: login: pi password: raspberry When the Pi has been booted for the first time, a configuration screen called the "Setup Options" should appear and it will look like the image below. If you have missed the "Setup Options" screen, its not a problem, you can always get it by typing the following command in the terminal. sudo raspi-config
  • 53. Once you execute this command the "Setup Options" screen will come up as shown in the image above. Now that the Setup Options window is up, we will have to set a few things. After completing each of the steps below, if it asks to reboot the Pi, please do so. After the reboot, if you don't get the "Setup Options" screen, then follow the command given above to get the screen/window. The first thing to do: select the first option in the list of the setup options window, that is select the "Expand Filesystem" option and hit the enter key. We do this to make use of all the space present on the SD card as a full partition. All this does is, expand the OS to fit the whole space on the SD card which can then be used as the storage memory for the Pi. The second thing to do: select the third option in the list of the setup options window, that is select the "Enable Boot To Desktop/Scratch" option and hit the enter key. It will take you to another window called the "choose boot option" window that looks like the image below. In the "choose boot option window" , select the second option, that is, "Desktop Log in as user 'pi' at the graphical desktop" and hit the enter button. Once done you will be taken back to the "Setup Options" page, if not select the "OK" button at the bottom of this window and you will be taken back to the previous window. We do this because we wan to boot into the desktop environment which we are familiar with. If we don't do this step then the Raspberry Pi boots into a terminal each time with no GUI options.
  • 54. Once, both the steps are done, select the "finish" button at the bottom of the page and it should reboot automatically. If it doesn't, then use the following command in the terminal to reboot. sudo reboot 4 Updating the firmware After the reboot from the previous step, if everything went right, then you will end up on the desktop which looks like the image below. Once you are on the desktop, open a terminal and enter the following command to update the firmware of the Pi. sudo rpi-update Updating the firmware is necessary because certain models of the Pi might not have all the required dependencies to run smoothly or it may have some bug. The latest firmware might have the fix to those bugs, thus its very important to update it in the beginning itself. 5 Conclusion So, we have covered the steps to get the Pi up and running. This method works on all the different models of Raspberry Pi ( model A, B, B+ and also RPi 2) as Raspbain was made to be supported on all models. However, while installing other software or libraries , the procedure might change a bit while installing depending on the model of the Pi or the version of Raspbian itself. The concept of Raspberry is to keep trying till you get he result or build that you want. This might involve a lot of trial and error but spending the time will be worth it. The actual usage doesn't end here. This is just the beginning. It is up to you to go ahead to build something amazing out of it.
  • 56. LINUX COMMANDS Why Bother? Why do you need to learn the command line anyway? Well, let me tell you a story. A few years ago we had a problem where I used to work. There was a shared drive on one of our file servers that kept getting full. I won't mention that this legacy operating system did not support user quotas; that's another story. But the server kept getting full and it stopped people from working. One of our software engineers spent the better part of a day writing a C++ program that would look through all the user's directories and add up the space they were using and make a listing of the results. Since I was forced to use the legacy OS while I was on the job, I installed a Linux-like command line environment for it. When I heard about the problem, I realized I could do all the work this engineer had done with this single line: du -s * | sort -nr > $HOME/user_space_report.txt Graphical user interfaces (GUIs) are helpful for many tasks, but they are not good for all tasks. I have long felt that most computers today are not powered by electricity. They instead seem to be powered by the "pumping" motion of the mouse! Computers were supposed to free us from manual labor, but how many times have you performed some task you felt sure the computer should be able to do but you ended up doing the work yourself by tediously working the mouse? Pointing and clicking, pointing and clicking. I once heard an author say that when you are a child you use a computer by looking at the pictures. When you grow up, you learn to read and write. Welcome to Computer Literacy 101. Now let's get to work. Contents 1. What Is "The Shell"? 2. Navigation 3. Looking Around 4. A Guided Tour 5. Manipulating Files 6. Working With Commands 7. I/O Redirection 8. Expansion 9. Permissions 10. Job Control
  • 57. What Is "The Shell"? Simply put, the shell is a program that takes commands from the keyboard and gives them to the operating system to perform. In the old days, it was the only user interface available on a Unix-like system such as Linux. Nowadays, we have graphical user interfaces (GUIs) in addition to command line interfaces (CLIs) such as the shell. On most Linux systems a program called bash (which stands for Bourne Again SHell, an enhanced version of the original Unix shell program, sh, written by Steve Bourne) acts as the shell program. Besides bash, there are other shell programs that can be installed in a Linux system. These include: ksh, tcsh and zsh. What's A "Terminal?" It's a program called a terminal emulator. This is a program that opens a window and lets you interact with the shell. There are a bunch of different terminal emulators you can use. Most Linux distributions supply several, such as: gnome-terminal, konsole, xterm, rxvt, kvt, nxterm, and eterm. Starting A Terminal Your window manager probably has a way to launch a terminal from the menu. Look through the list of programs to see if anything looks like a terminal emulator. If you are a KDE user, the terminal program is called "konsole," in Gnome it's called "gnome-terminal." You can start up as many of these as you want and play with them. While there are a number of different terminal emulators, they all do the same thing. They give you access to a shell session. You will probably develop a preference for one, based on the different bells and whistles each one provides. Testing The Keyboard OK, let's try some typing. Bring up a terminal window. You should see a shell prompt that contains your user name and the name of the machine followed by a dollar sign. Something like this: [me@linuxbox me]$ Excellent! Now type some nonsense characters and press the enter key. [me@linuxbox me]$ kdkjflajfks If all went well, you should have gotten an error message complaining that it cannot understand you: [me@linuxbox me]$ kdkjflajfks bash: kdkjflajfks: command not found
  • 58. Wonderful! Now press the up-arrow key. Watch how our previous command "kdkjflajfks" returns. Yes, we have command history. Press the down-arrow and we get the blank line again. Recall the "kdkjflajfks" command using the up-arrow key if needed. Now, try the left and right-arrow keys. You can position the text cursor anywhere in the command line. This allows you to easily correct mistakes. You're not logged in as root, are you? If the last character of your shell prompt is # rather than $, you are operating as the superuser. This means that you have administrative privileges. This can be potentially dangerous, since you are able to delete or overwrite any file on the system. Unless you absolutely need administrative privileges, do not operate as the superuser. Using The Mouse Even though the shell is a command line interface, the mouse is still handy. Besides using the mouse to scroll the contents of the terminal window, you can copy text with the mouse. Drag your mouse over some text (for example, "kdkjflajfks" right here on the browser window) while holding down the left button. The text should highlight. Release the left button and move your mouse pointer to the terminal window and press the middle mouse button (alternately, you can press both the left and right buttons at the same time if you are working on a touch pad). The text you highlighted in the browser window should be copied into the command line. A few words about focus... When you installed your Linux system and its window manager (most likely Gnome or KDE), it was configured to behave in some ways like that legacy operating system. In particular, it probably has its focus policy set to "click to focus." This means that in order for a window to gain focus (become active) you have to click in the window. This is contrary to traditional X Window behavior. You should consider setting the focus policy to "focus follows mouse". You may find it strange at first that windows don't raise to the front when they get focus (you have to click on the window to do that), but you will enjoy being able to work on more than one window at once without having the active window obscuring the the other. Try it and give it a fair trial; I think you will like it. You can find this setting in the configuration tools for your window manager. Navigation In this lesson, I will introduce your first three commands: pwd (print working directory), cd (change directory), and ls (list files and directories).
  • 59. If you have not worked with a command line interface before, you will need to pay close attention to this lesson, since the concepts will take some getting used to. File System Organization Like that legacy operating system, the files on a Linux system are arranged in what is called a hierarchical directory structure. This means that they are organized in a tree-like pattern of directories (called folders in other systems), which may contain files and other directories. The first directory in the file system is called the root directory. The root directory contains files and subdirectories, which contain more files and subdirectories and so on and so on. Most graphical environments today include a file manager program to view and manipulate the contents of the file system. Often you will see the file system represented like this: One important difference between the legacy operating system and Unix-like operating systems such as Linux is that Linux does not employ the concept of drive letters. While drive letters split the file system into a series of different trees (one for each drive), Linux always has a single tree. Different storage devices may contain different branches of the tree, but there is always a single tree. pwd Since a command line interface cannot provide graphic pictures of the file system structure, it must have a different way of representing it. Think of the file system tree as a maze, and you are standing in it. At any given moment, you are located in a single directory. Inside that directory, you can see its files and the pathway to its parent directory and the pathways to the subdirectories of the directory in which you are standing. The directory you are standing in is called the working directory. To find the name of the working directory, use the pwd command. [me@linuxbox me]$ pwd /home/me
  • 60. When you first log on to a Linux system, the working directory is set to your home directory. This is where you put your files. On most systems, your home directory will be called /home/your_user_name, but it can be anything according to the whims of the system administrator. To list the files in the working directory, use the ls command. [me@linuxbox me]$ ls Desktop Xrootenv.0 linuxcmd GNUstep bin nedit.rpm GUILG00.GZ hitni123.jpg nsmail I will come back to ls in the next lesson. There are a lot of fun things you can do with it, but I have to talk about pathnames and directories a bit first. cd To change your working directory (where you are standing in the maze) you use the cd command. To do this, type cd followed by the pathname of the desired working directory. A pathname is the route you take along the branches of the tree to get to the directory you want. Pathnames can be specified in one of two different ways; absolute pathnames or relative pathnames. Let's look with absolute pathnames first. An absolute pathname begins with the root directory and follows the tree branch by branch until the path to the desired directory or file is completed. For example, there is a directory on your system in which most programs are installed. The pathname of the directory is /usr/bin. This means from the root directory (represented by the leading slash in the pathname) there is a directory called "usr" which contains a directory called "bin". Let's try this out: [me@linuxbox me]$ cd /usr/bin [me@linuxbox bin]$ pwd /usr/bin [me@linuxbox bin]$ ls [ lwp-request 2to3 lwp-rget 2to3-2.6 lxterm a2p lz aalib-config lzcat aconnect lzma acpi_fakekey lzmadec acpi_listen lzmainfo add-apt-repository m17n-db addpart magnifier and many more...
  • 61. Now we can see that we have changed the current working directory to /usr/bin and that it is full of files. Notice how your prompt has changed? As a convenience, it is usually set up to display the name of the working directory. Where an absolute pathname starts from the root directory and leads to its destination, a relative pathname starts from the working directory. To do this, it uses a couple of special notations to represent relative positions in the file system tree. These special notations are "." (dot) and ".." (dot dot). The "." notation refers to the working directory itself and the ".." notation refers to the working directory's parent directory. Here is how it works. Let's change the working directory to /usr/bin again: [me@linuxbox me]$ cd /usr/bin [me@linuxbox bin]$ pwd /usr/bin O.K., now let's say that we wanted to change the working directory to the parent of /usr/bin which is /usr. We could do that two different ways. First, with an absolute pathname: [me@linuxbox bin]$ cd /usr [me@linuxbox usr]$ pwd /usr Or, with a relative pathname: [me@linuxbox bin]$ cd .. [me@linuxbox usr]$ pwd /usr Two different methods with identical results. Which one should you use? The one that requires the least typing! Likewise, we can change the working directory from /usr to /usr/bin in two different ways. First using an absolute pathname: [me@linuxbox usr]$ cd /usr/bin [me@linuxbox bin]$ pwd /usr/bin Or, with a relative pathname: [me@linuxbox usr]$ cd ./bin [me@linuxbox bin]$ pwd /usr/bin Now, there is something important that I must point out here. In almost all cases, you can omit the "./". It is implied. Typing: [me@linuxbox usr]$ cd bin
  • 62. would do the same thing. In general, if you do not specify a pathname to something, the working directory will be assumed. There is one important exception to this, but we won't get to that for a while. A Few Shortcuts If you type cd followed by nothing, cd will change the working directory to your home directory. A related shortcut is to type cd ~user_name. In this case, cd will change the working directory to the home directory of the specified user. Typing cd - changes the working directory to the previous one. Important facts about file names 1. File names that begin with a period character are hidden. This only means that ls will not list them unless you say ls -a. When your account was created, several hidden files were placed in your home directory to configure things for your account. Later on we will take a closer look at some of these files to see how you can customize your environment. In addition, some applications will place their configuration and settings files in your home directory as hidden files. 2. File names in Linux, like Unix, are case sensitive. The file names "File1" and "file1" refer to different files. 3. Linux has no concept of a "file extension" like legacy operating systems. You may name files any way you like. However, while Linux itself does not care about file extensions, many application programs do. 4. Though Linux supports long file names which may contain embedded spaces and punctuation characters, limit the punctuation characters to period, dash, and underscore. Most importantly, do not embed spaces in file names. If you want to represent spaces between words in a file name, use underscore characters. You will thank yourself later. Looking Around Now that you know how to move from working directory to working directory, we're going to take a tour of your Linux system and, along the way, learn some things about what makes it tick. But before we begin, I have to teach you some tools that will come in handy during our adventure. These are:
  • 63. ls (list files and directories) less (view text files) file (classify a file's contents) ls The ls command is used to list the contents of a directory. It is probably the most commonly used Linux command. It can be used in a number of different ways. Here are some examples: Examples of the ls command Command Result ls List the files in the working directory ls /bin List the files in the /bin directory (or any other directory you care to specify) ls -l List the files in the working directory in long format ls -l /etc /bin List the files in the /bin directory and the /etc directory in long format ls -la .. List all files (even ones with names beginning with a period character, which are normally hidden) in the parent of the working directory in long format These examples also point out an important concept about commands. Most commands operate like this: command -options arguments where command is the name of the command, -options is one or more adjustments to the command's behavior, and arguments is one or more "things" upon which the command operates. In the case of ls, we see that ls is the name of the command, and that it can have one or more options, such as -a and -l, and it can operate on one or more files or directories. A Closer Look At Long Format If you use the -l option with ls, you will get a file listing that contains a wealth of information about the files being listed. Here's an example:
  • 64. -rw------- 1 bshotts bshotts 576 Apr 17 1998 weather.txt drwxr-xr-x 6 bshotts bshotts 1024 Oct 9 1999 web_page -rw-rw-r-- 1 bshotts bshotts 276480 Feb 11 20:41 web_site.tar -rw------- 1 bshotts bshotts 5743 Dec 16 1998 xmas_file.txt ---------- ------- ------- -------- ------------ ------------- | | | | | | | | | | | File Name | | | | | | | | | +--- Modification Time | | | | | | | +------------- Size (in bytes) | | | | | +----------------------- Group | | | +-------------------------------- Owner | +---------------------------------------------- File Permissions File Name The name of the file or directory. Modification Time The last time the file was modified. If the last modification occurred more than six months in the past, the date and year are displayed. Otherwise, the time of day is shown. Size The size of the file in bytes. Group The name of the group that has file permissions in addition to the file's owner. Owner The name of the user who owns the file. File Permissions A representation of the file's access permissions. The first character is the type of file. A "-" indicates a regular (ordinary) file. A "d" indicates a directory. The second set of three characters represent the read, write, and execution rights of the file's owner. The next three represent the rights of the file's group, and the final three represent the rights granted to everybody else. I'll discuss this in more detail in a later lesson. less less is a program that lets you view text files. This is very handy since many of the files used to control and configure Linux are human readable.
  • 65. What is "text"? There are many ways to represent information on a computer. All methods involve defining a relationship between the information and some numbers that will be used to represent it. Computers, after all, only understand numbers and all data is converted to numeric representation. Some of these representation systems are very complex (such as compressed multimedia files), while others are rather simple. One of the earliest and simplest is called ASCII text. ASCII (pronounced "As-Key") is short for American Standard Code for Information Interchange. This is a simple encoding scheme that was first used on Teletype machines to map keyboard characters to numbers. Text is a simple one-to-one mapping of characters to numbers. It is very compact. Fifty characters of text translates to fifty bytes of data. Throughout a Linux system, many files are stored in text format and there are many Linux tools that work with text files. Even the legacy operating systems recognize the importance of this format. The well-known NOTEPAD.EXE program is an editor for plain ASCII text files. The less program is invoked by simply typing: less text_file This will display the file. Controlling less Once started, less will display the text file one page at a time. You may use the Page Up and Page Down keys to move through the text file. To exit less, type "q". Here are some commands that less will accept: Keyboard commands for the less program Command Action Page Up or b Scroll back one page Page Down or space Scroll forward one page G Go to the end of the text file 1G Go to the beginning of the text file /characters Search forward in the text file for an occurrence of the specified characters
  • 66. n Repeat the previous search h Display a complete list less commands and options q Quit file As you wander around your Linux system, it is helpful to determine what kind of data a file contains before you try to view it. This is where the file command comes in. file will examine a file and tell you what kind of file it is. To use the file program, just type: file name_of_file The file program can recognize most types of files, such as: Various kinds of files File Type Description Viewable as text? ASCII text The name says it all yes Bourne-Again shell script text A bash script yes ELF 32-bit LSB core file A core dump file (a program will create this when it crashes) no ELF 32-bit LSB executable An executable binary program no ELF 32-bit LSB shared object A shared library no GNU tar archive A tape archive file. A common way of storing groups of files. no, use tar tvf to view listing. gzip compressed data An archive compressed with gzip no HTML document text A web page yes JPEG image data A compressed JPEG image no PostScript document A PostScript file yes
  • 67. text RPM A Red Hat Package Manager archive no, use rpm -q to examine contents. Zip archive data An archive compressed with zip no While it may seem that most files cannot be viewed as text, you will be surprised how many can. This is especially true of the important configuration files. You will also notice during our adventure that many features of the operating system are controlled by shell scripts. In Linux, there are no secrets! A Guided Tour It's time to take our tour. The table below lists some interesting places to explore. This is by no means a complete list, but it should prove to be an interesting adventure. For each of the directories listed below, do the following: cd into each directory. Use ls to list the contents of the directory. If you see an interesting file, use the file command to determine its contents. For text files, use less to view them. Interesting directories and their contents Directory Description / The root directory where the file system begins. In most cases the root directory only contains subdirectories. /boot This is where the Linux kernel and boot loader files are kept. The kernel is a file called vmlinuz. /etc The /etc directory contains the configuration files for the system. All of the files in /etc should be text files. Points of interest: