Вы находитесь на странице: 1из 14

http://www.computerhope.com/unix/overview.

htm
About finger Lists information about the user. Syntax finger [-b] [-f] [-h] [-i] [-l] [-m] [-p] [-q] [-s] [-w] [username] -b -f -h -i Suppress printing the user's home directory and shell in a long format printout. Suppress printing the header that is normally printed in a non-long format printout. Suppress printing of the .project file in a long format printout. Force "idle" output format, hich is similar to short format except that only the login name, terminal, login time, and idle time are printed. Force long output format. !atch arguments only on user name "not first or last name#. Suppress printing of the .plan file in a long format printout. Force $uic% output format, hich is similar to short format except that only the login name, terminal, and login time are printed. Force short output format. Suppress printing the full name in a short format printout.

-l -m -p -$ -s &xamples

finger -b -p ch - 'ould display the follo ing information about the user ch. Login name( admin )n real life( *omputer +ope ,n since Feb -- ./(/0(-1 on pts20 from domain.computerhope.com .3 seconds )dle 4ime

About ping Sends )*!5 &*+,67&89&S4 pac%ets to net or% hosts. Syntax ping -s :-d; :-l; :-L; :-n; :-r; :-7; :-<; : -i interface6address ; :-) inter<al; :-t ttl; host :pac%etsi=e; :count; -d -l Set the S,6>&?9@ soc%et option. Loose source route. 9se this option in the )5 header to send the pac%et to the gi<en host and bac% again. 9sually specified ith the -7 option. 4urn off loopbac% of multicast pac%ets. Aormally, if there are members in the host group on the out- going interface, a copy of the multicast pac%ets ill be deli<ered to the local machine. Sho net or% addresses as numbers. ping normally displays addresses as host names. ?ypass the normal routing tables and send directly to a host on an attached net or%. )f the host is not on a directly-attached net or%, an error is returned. 4his option can be used to ping a local host through an interface that has been dropped by the router daemon. 7ecord route. Sets the )5 record route option, hich ill store the route of the pac%et inside the )5 header. 4he contents of the record route ill only be printed if the -< option is gi<en, and only be set on return pac%ets if the target host preser<es the record route option across echos, or the -l option is gi<en. Berbose output. List any )*!5 pac%ets, other than &*+,67&S5,AS&, that are recei<ed.

-L

-n -r

-7

-<

-i interface6address Specify the outgoing interface address to use for multicast pac%ets. 4he default interface address for multicast pac%ets is determined from the "unicast# routing tables. -) inter<al -t ttl Specify the inter<al bet een successi<e transmissions. 4he default is one second. Specify the )5 time to li<e for unicast and multicast pac%ets. 4he default time to li<e for unicast pac%ets is set ith ndd "using the icmp6def6ttl <ariable#. 4he default time to li<e for multicast is one hop. 4he net or% host.

host

pac%etsi=e count &xamples

Specified si=e of pac%etsi=e. >efault is 1C. Amount of times to send the ping re$uest.

ping computerhope.com - 'ould ping the host computerhope.com to see if it is ali<e. ping computerhope.com -c 1 - 'ould ping the host computerhope.com once and return to the command line as sho n belo . 5)A@ computerhope.com ".DC...3.-ED./# E1"3C# bytes of data. 1C bytes from .computerhope.com ".DC...3.-ED./#( icmp6se$F- ttlF1/ timeFD..10 ms

About netstat Sho s net or% status. Syntax netstat [-a] [-n] [-v] netstat [-g | -m | -p | -s | -f address_family ] [-n] [-P protocol] netstat [ -i ] [ -I interface ] [ interval ] netstat -r [-a] [-n] [-v ] netstat -M [-n] [-s ] netstat - [ -I interface ] -a Sho the state of all soc%ets and all routing table entriesG normally, soc%ets used by ser<er processes are not sho n and only interface, host, net or%, and default routes are sho n. Sho net or% addresses as numbers. netstat normally displays addresses as symbols. 4his option may be used ith any of the display formats. Berbose. Sho additional information for the soc%ets and the routing table. Sho the multicast group memberships for all interfaces. Sho the S47&A!S statistics. Sho the address resolution "A75# tables. Sho per-protocol statistics. 'hen used ith the -! option, sho multicast routing statistics instead. Sho the state of the interfaces that are used for 4*52)5 traffic. Sho the routing tables. Sho the multicast routing tables. 'hen used ith the -s option, sho multicast routing statistics instead. Sho the state of all interfaces that are under >ynamic +ost *onfiguration 5rotocol ">+*5# control. Sho the status of >+*5 configured interfaces.

-n

-< -g -m -p -s -i -r -! -d ->

-f address6family

imit statistics or address control bloc% reports to those of the specified address6family, hich can be one of( inet For the AF6)A&4 address family unix For the AF69nix address family

-5 protocol - ) interface

Limit display of statistics or state of all soc%ets to those applicable to protocol. Sho the state of a particular interface. interface can be any <alid interface such as ieD or leD.

&xamples netstat >isplays generic net statistics of the host you are currently connected to. netstat -an Sho s all connections to the ser<er including the source and destination ips and ports if you ha<e proper permissions. netstat -rn >isplays routing table for all ips bound to the ser<er. netstat -an |grep :80 |wc -l >isplay the amount of acti<e connections on port 3D. 7emo<ing the pipe and c command ould display each connection. netstat -natp >isplay acti<e )nternet connections. See document *+DD-D0H for an example of output.

About route Sho 2 manipulate the )5 routing table. Syntax route :-*F<nee; route :-<; :-A family; add :-netI-host; target :netmas% Am; :g @ ; :metric A; :mss !; : indo '; :irtt ); :reject; :mod; :dyn; :reinstate; ::de<; )f; route :-<; :-A family; del :-netI-host; target :g @ ; :netmas% Am; :metric A; ::de<; )f; route :-B; :--<ersion; :-h; :--help; -A family -F -* -< -n use the specified address family "eg Jinet'G use Jroute --help' for a full list#. operate on the %ernel's F)? "For arding )nformation ?ase# routing table. 4his is the default. operate on the %ernel's routing cache. select <erbose operation. sho numerical addresses instead of trying to determine symbolic host names. 4his is useful if you are trying to determine hy the route to your nameser<er has <anished. use netstat-format for displaying the routing table. -ee ill generate a <ery long line ith all parameters from the routing table. delete a route. add a ne route. the destination net or% or host. Kou can pro<ide )5 addresses in dotted decimal or host2net or% names. the target is a net or%. the target is a host. hen adding a net or% route, the netmas% to be used. route pac%ets <ia a gate ay. A,4&( 4he specified gate ay must be reachable first. 4his usually means that you ha<e to set up a static route to the gate ay beforehand. )f you specify the address of one

-e del add target -net -host netmas% A! g @'

of your local interfaces, it ill be used to decide about the interface to hich the pac%ets should be routed to. 4his is a ?S>ism compatibility hac%. metric ! mss ! set the metric field in the routing table "used by routing daemons# to !. set the 4*5 !aximum Segment Si=e "!SS# for connections o<er this route to ! bytes. 4he default is the de<ice !49 minus headers, or a lo er !49 hen path mtu disco<ery occurred. 4his setting can be used to force smaller 4*5 pac%ets on the other end hen path mtu disco<ery does not or% "usually because of misconfigured fire alls that bloc% )*!5 Fragmentation Aeeded# set the 4*5 indo si=e for connections o<er this route to ' bytes. 4his is typically only used on AL..E net or%s and ith dri<ers unable to handle bac% to bac% frames. set the initial round trip time "irtt# for 4*5 connections o<er this route to ) milliseconds "---.DDD#. 4his is typically only used on AL..E net or%s. )f omitted the 7F* --.. default of /DDms is used. install a bloc%ing route, hich ill force a route loo%up to fail. 4his is for example used to mas% out net or%s before using the default route. 4his is A,4 for fire alling. install a dynamic or modified route. 4hese flags are for diagnostic purposes, and are generally only set by routing daemons. force the route to be associated ith the specified de<ice, as the %ernel ill other ise try to determine the de<ice on its o n "by chec%ing already existing routes and de<ice specifications, and here the route is added to#. )n most normal net or%s you on't need this. )f de< )f is the last option on the command line, the ord de< may be omitted, as it's the default. ,ther ise the order of the route modifiers "metric - netmas% - g - de<# doesn't matter. &xamples route -n Sho s routing table for all )5s bound to the ser<er. route add -net 19 .!".#".0 netmas$ !!. !!. !!.0 dev eth0

indo '

irtt )

reject

mod, dyn, reinstate de< )f

adds a route to the net or% -H..E1.01.x <ia "ethD". 4he *lass * netmas% modifier is not really necessary here because -H..M is a *lass * )5 address. 4he ord "de<" can be omitted here. route add -net %.0.0.0 netmas$ %0.0.0.0 dev eth0

4his is an obscure one documented so people %no ho to do it. 4his sets all of the class > "multicast# )5 routes to go <ia "ethD". 4his is the correct normal configuration line ith a multicasting %ernel.

5rint the route pac%ets ta%e to net or% host. Syntax traceroute [-d] [-!] [-I] [-n] [-v] [-"] [-f first_ttl] [-g gateway [-g gateway] | -r] [-i iface] [-m ma"_ttl] [-p port] [-q nqueries] [-s src_addr] [-t tos] [-w waittime ] host [pac#etlen] -d -F -) -n Set the S,6>&?9@ soc%et option. Set the "don't fragment" bit. 9se )*!5 &*+, instead of 9>5 datagrams. 5rint hop addresses numerically rather than symbolically and numerically. 4his sa<es a nameser<er address-to-name loo%up for each gate ay found on the path. Berbose output. For each hop, the si=e and the destination of the response pac%ets is displayed. Also )*!5 pac%ets recei<ed other than 4)!&6&L*&&>&> and 9A7&A*+A?L& are listed as ell. 5re<ent traceroute from calculating chec%sums. Aote that chec%sums are usually re$uired for the last hop hen using )*!5 &*+, probes. See the -) option. Set the starting ttl <alue to first6ttl, to o<erride the default <alue -. traceroute s%ips processing for those intermediate gate ays hich are less than first6ttl hops a ay. Specify a loose source route gate ay. 4he user can specify more than one gate ay by using -g for each gate ay. 4he maximum that can be set is 3. ?ypass the normal routing tables and send directly to a host on an attached net or%. )f the host is not on a directly-attached net or%, an error is returned. 4his option can be used to send probes to a local host through an interface that has been dropped by the router daemon. Specify a net or% interface to obtain the source )5 address for outgoing probe pac%ets. 4his is normally only useful on a multihomed host. 4he -s option is also another ay to do this. Aote that this option does not pro<ide a ay to specify the interface on hich the probe pac%ets are sent. Set the maximum ttl used in outgoing probe pac%ets. 4he default is /D hops, hich is the same default used for 4*5 connections. Set the base 9>5 port number used in probes. 4he default is //C/C.

-<

-x

-f first6ttl

-g gate ay

-r

-i iface

-m max6ttl -p port

traceroute hopes that nothing is listening on 9>5 ports "baseN "nhops- -#Mn$ueries# to "baseN"nhopsMn$ueries#--#at the destination host, so that an )*!5 5,7469A7&A*+A?L& message ill be returned to terminate the route tracing. )f something is listening on a port in the default range, this option can be used to select an unused port range.nhops is defined as the number of hops bet een the source and the destination. -$ n$ueries -s src6addr Set the desired number of probe $ueries. 4he default is /. 9se the follo ing address, hich usually is gi<en as an )5 address, not a hostname, as the source address in outgoing probe pac%ets. ,n multi-homed hosts, those ith more than one )5 address, this option can be used to force the source address to be something other than the )5 address traceroute pic%s by default. )f the )5 address is not one of this machine's interface addresses, an error is returned and nothing is sent. 'hen used together ith the -i option, the gi<en )5 address should be configured on the specified interface. ,ther ise, an error ill be returned. Set the tos"type-of-ser<ice# in probe pac%ets to the specified <alue. 4he default is =ero. 4he <alue must be an integer in the range from D to .EE. @ate ays along the path may route the probe pac%et differently depending upon the tos <alue set in the probe pac%et. aittime Set the time, in seconds, to ait for a response to a probe. 4he default is fi<e "E# seconds. 4he net or% host.

-t tos

host

&xamples traceroute computerhope.com - ould display results similar to the follo ing( traceroute to computerhope.com "-11.0D.-D../#, /D hops max, CD byte pac%ets - -H3.1D....- "-H3.1D....-# ../D/ ms -.C.C ms ../C1 ms . %run%/.xmission.com "-H3.1D....1# D.0C. ms M -.E.- ms Aote( in this example because e are local to the address e are tracerouting the amount of hops is <ery minimal. +o e<er, hen you traceroute computerhope.com you may hop more than e do. 4his command is <ery useful for distinguishing net or% 2 router issues. )f the domain does not or% or is not a<ailable you can traceroute an )5.

About ifconfig 4he "ifconfig" command allo s the operating system to setup net or% interfaces and allo the user to <ie information about the configured net or% interfaces. Syntax ifconfig [-$] [-m] interface [create] [address_family] [address[%prefi"length] [dest_address]] [parameters] ifconfig interface destroy ifconfig -a [-$] [-d] [-m] [-u] [address_family] ifconfig -l [-d] [-u] [address_family] ifconfig [-$] [-d] [-m] [-u] [-&] address For the >A75A-)nternet family, the address is either a host name present in the host name data base, or a >A75A )nternet address expressed in the )nternet standard JJdot notation''. )t is also possible to use the *)>7 notation "also %no n as the slash notation# to include the netmas%. 4hat is, one can specify an address li%e -H..-13.D.-2-1. addres6family Specify the address family hich affects interpretation of the remaining parameters. Since an interface can recei<e transmissions in differing protocols ith different naming schemes, specifying the address family is recommended. 4he address or protocol families currently supported are JJinet'', JJinet1'', Specify the address of the correspondent on the other end of a point to point lin%. 4his parameter is a string of the form JJname unit'', for example, JJenD''. Another name for the alias parameter. )ntroduced for compatibility ith ?S>2,S. &stablish an additional net or% address for this interface. 4his is sometimes useful hen changing net or% numbers, and one ishes to accept pac%ets addressed to the old interface. )f the address is on the same subnet as the first net or% address for this interface, a netmas% of Dxffffffff has to be specified. 7emo<e the net or% address specified. 4his ould be used if you incorrectly specified an alias, or it as no longer needed. )f you ha<e incorrectly set an AS address ha<ing the side effect of specifying the host portion, remo<ing all AS addresses ill allo you to respecify the host portion.

dest6address interface add alias

-alias

anycast

")net1 only.# Specify that the address configured is an anycast address. ?ased on the current specification, only routers may configure anycast addresses. Anycast address ill not be used as source address of any of outgoing )5<1 pac%ets. &nable the use of the Address 7esolution 5rotocol in mapping bet een net or% le<el addresses and lin% le<el addresses "default#. 4his is currently implemented for mapping bet een >A75A )nternet addresses and )&&& 3D. C3-bit !A* addresses "&thernet, F>>), and 4o%en 7ing addresses#. >isable the use of the Address 7esolution 5rotocol ")net only.# Specify the address to use to represent broadcasts to the net or%. 4he default broadcast address is the address ith a host part of all -'s. &nable dri<er dependent debugging codeG usually, this turns on extra console error logging. >isable dri<er dependent debugging code. Another name for the -alias parameter. !ar% an interface JJdo n''. 'hen an interface is mar%ed JJdo n'', the system ill not attempt to transmit messages through that interface. )f possible, the interface ill be reset to disable reception as ell. 4his action does not automatically disable routes using the interface. Another name for the lladdr parameter. Set the lin%-le<el address on an interface. 4his can be used to e.g. set a ne !A* address on an ethernet interface, though the mechanism used is not ethernet-specific. 4he address addr is specified as a series of colon-separated hex digits. )f the interface is already up hen this option is used, it ill be briefly brought do n and then brought bac%up again in order to ensure that the recei<e filter in the underlying ethernet hard are is properly reprogrammed. )f the dri<er supports the media selection system, set the media type of the interface to type. Some interfaces support the mutually exclusi<e use of one of se<eral different physical media connectors. For example, a -D!b2s &thernet interface might support the use of either A9) or t isted pair connectors. Setting the media type to JJ-DbaseE2A9)'' ould change the currently acti<e connector to the A9) port. Setting it to JJ-Dbase42945'' ould acti<ate t isted pair. 7efer to the interfaces' dri<er specific documentation or man page for a complete list of the a<ailable types.

arp

-arp broadcast

debug -debug delete do n

ether lladdr addr

media type

-mediaopt opts

)f the dri<er supports the media selection system, set the specified media options on the interface. 4he opts argument is a comma delimited list of options to apply to the interface. 7efer to the interfaces' dri<er specific man page for a complete list of a<ailable options. ")5 tunnel de<ices only.# *onfigure the physical source and destination address for )5 tunnel interfaces. 4he arguments src&addr and dest&addr are interpreted as the outer source2destination for the encapsulating )5<C2)5<1 header. 9nconfigure the physical source and destination address for )5 tunnel interfaces pre<iously configured ith tunnel. *reate the specified net or% pseudo-de<ice. )f the interface is gi<en ithout a unit number, try to create a ne de<ice ith an arbitrary unit number. )f creation of an arbitrary de<ice is successful, the ne de<ice name is printed to standard output. >estroy the specified net or% pseudo-de<ice. Another name for the create parameter. )ncluded for Solaris compatibility. Another name for the destroy parameter. )ncluded for Solaris compatibility. Set the routing metric of the interface to n, default D. 4he routing metric is used by the routing protocol. +igher metrics ha<e the effect of ma%ing a route less fa<orableG metrics are counted as addition hops to the destination net or% or host. Set the maximum transmission unit of the interface to n, default is interface specific. 4he !49 is used to limit the si=e of pac%ets that are transmitted on an interface. Aot all interfaces support setting the !49, and some interfaces ha<e range restrictions. ")net only.# Specify ho much of the address to reser<e for subdi<iding net or%s into subnet or%s. 4he mas% includes the net or% part of the local address and the subnet part, hich is ta%en from the host field of the address. 4he mas% can be specified as a single hexadecimal number ith a leading JDx', ith a dot-notation )nternet address, or ith a pseudo-net or% name listed in the net or% table. 4he mas% contains -'s for the bit positions in the /.bit address hich are to be used for the net or% and subnet parts, and D's for the host part. 4he mas% should contain at least the standard net or% portion, and the subnet field should be contiguous ith the net or% portion. 4he netmas% can also be specified in *)>7 notation after the address. See the address option abo<e for more information.

tunnel src_addr dest_addr

deletetunnel create

destroy plumb unplumb metric n

mtu n

netmas% mas#

prefixlen len

")net1 only.# Specify that len bits are reser<ed for subdi<iding net or%s into sub-net or%s. 4he len must be integer, and for syntactical reason it must be bet een D to -.3. )t is almost al ays 1C under the current )5<1 assignment rule. )f the parameter is omitted, 1C is used. Another name for the -alias parameter. )ntroduced for compatibility ith ?S>2,S. &nable special processing of the lin% le<el of the interface. 4hese three options are interface specific in actual effect, ho - e<er, they are in general used to select special modes of operation. An example of this is to enable SL)5 compression, or to select the connector type for some &thernet cards. 7efer to the man page for the specific dri<er for more information. >isable special processing at the lin% le<el ith the specified interface. !ar% an interface JJup''. 4his may be used to enable an interface after an JJifconfig down''. )t happens automatically hen setting the first address on an interface. )f the interface as reset hen pre<iously mar%ed do n, the hard are ill be re-initiali=ed.

remo<e lin%:D-.;

-lin%:D-.; up

&xamples ifconfig eth0 Bie the net or% settings on the first &thernet adapter installed in the computer. ifconfig -a >isplay info on all net or% interfaces on ser<er, acti<e or inacti<e. ifconfig eth0 down )f ethD exists ould ta%e it do n causing it cannot send or recei<e any information. ifconfig eth0 up )f ethD exists and in the do n state ould return it bac% to the up state allo ing to to send and recei<e information. ifconfig eth0 19 .1"8.1.10 netmas$ !!. !!. !!.0 broadcast 19 .1"8.1. !! Assign ethD ith the abo<e <alues for )5, netmas% and broadcast address.

Вам также может понравиться