If the interface name is passed as an argument, ifconfig
command print the information about that interface only.
Example:
System -> Preferences -> Network Connections
NOTE!: The system-config-network
also provides all the features listed above.
system-config-network
to configure your network interfaces, All the Network Interface settings are stored in /etc/sysconfig/network-scripts/
directory./etc/sysconfig/network-scripts/ifcfg-ethX
NOTE!: These files are read by system-config-network
, ifup
, ifdown
and other tools that bring the Network Interface up and down.
Example:
/-------------------------------------------------------------------------------\ | Dynamic Configuration | Static Configuration | |-------------------------------------------------------------------------------- | | | DEVICE=ethX | DEVICE=ethX | | HWADDR=00:09:6B:CD:2B:87 | HWADDR=00:09:6B:CD:2B:87 | | BOOTPROTO=dhcp | IPADDR=192.168.0.123 | | ONBOOT=yes | NETMASK=255.255.255.0 | | TYPE=Ethernet | GATEWAY=192.168.0.254 | | | ONBOOT=yes | | | TYPE=Ethernet | \-------------------------------------------------------------------------------/
NOTE!: The Network Interface file is just a collection of bash variables that define the interface’s setting. Remember the syntax of bash variable is VARIABLE=VALUE
, with no spaces on either side of the =.
/-----------------------------------------------------------------------------------------------------------------------\ | Setting | Meaning | |------------------------------------------------------------------------------------------------------------------------ | | | DEVICE | Specify the Network Interface Name or Alias (Example eth0) | | | | HWADDR | Hardwaare(MAC) Address. | | | This setting is optional & can cause problems, | | | when ethernet card is replaced | | | | BOOTPROTO | Where IP Settings should be retrieved from. | | | Set to dhcp to use DHCP. | | | Leave the variable unset or set it to static for manual IP Settings. | | | | IPADDR & | Basic IP Settings. | | NETMASK | Only necessary when not using the DHCP Server. | | | | GATEWAY | Only necessary when not using the DHCP Server. | | | The Gateway can also be set in /etc/sysconfig/network file. | | | If the Gateway is defined in the /etc/sysconfig/network and ifcfg file, | | | The Gateway defined in the most recently activated ifcfg file is used. | | | | ONBOOT | Whether to bring the network interface up automatically when the system boots. | | | Set to yes or no. The default value is no. | | | | USERCTL | Whether to allow non-root users to bring this interface up & down. | | | Set to yes or no. The default value is no. | | | | TYPE | Specify the type of network interface. | | | \-----------------------------------------------------------------------------------------------------------------------/
The Global Network Settings are defined in the /etc/sysconfig/network
ifcfg
file.Examples:
NOTE!: If the Gateway is defined in the /etc/sysconfig/network
and ifcfg
file, The Gateway defined in the most recently activated ifcfg
file is used.
/etc/resolv.conf
www.google.com
into web browser, it initiates a DNS Lookup, in which it ask Local DNS Server what IP Address is assigned to that name.google.com
and will forward my request to one of them./etc/resolv.conf
/etc/resolv.conf
filesearch
The search specifies the Domain Name when incomplete DNS Name is give to the command.
/etc/resolv.conf
file contains the line: search example.com cracker.org
ping server1
server1
into server1.example.com
server1.example.com
is not found then system try server1.cracker.org
nameserver
System -> Administration -> Printing
OR Run the system-config-printer
on the terminallpr
Send job to the printerOptions
-P
: Select the specific printer.-#
: Set the number of copies to print from 1 to 100.Examples:
lpq
Show printer queue status.Options
-P
: Select the specific printer.Example:
lprm
: Removes a job from the print queue.Options
-P
: Select the specific printer.Examples:
lprm
responds with the name of the queue from which the job was removed.NOTE!: A user may only remove his own jobs from the queue.
lpstat
: Prints cups status information.Options
-a
: List Configured Printers.evince
: Views PDF Documentsps2pdf
: Converts PostScript to PDFpdf2ps
: Converts PDF to PostScript. Which makes it easy to print PDF Documents right from the command line.pdftotext
: Converts PDF to Plain Textenscript
, a2ps
: Converts Text to PostScriptmpage
: Prints multiple pages per sheetcups
chkconfig cups on | off
& service cups status | start | stop | restart
Configuration Files
/etc/cups/cupsd.conf
/etc/cups/printers.conf
Configuration Tools
lpr
lpq
lprm
lpstat
lpadmin
lpinfo
system-config-printer
System -> Administration -> Printing
system-config-date
System -> Administration -> Date & Time
Examples:
NOTE!: $0
Specify the program name
$*
Holds all command-line arguments
$#
Holds the number of command-line arguments
Examples:
The read commands takes a line from the STDIN and breaks it down into individual words. (Usaually a word is defined as a character string surrounded by white space such as spaces and tabs).
IFS
variable.NOTE! IFS=’:’ will tells the shell that words are separated by colons instead of white space).
The 1st word is assigned to the 1st variable The 2nd word is assigned to the 2nd variable and so on.
If there are more words than variables, All the remaining words are assigned to the last variable.
Options
-p
: Designates prompt to display.Examples: