Sie sind auf Seite 1von 12

Linux commands

1.ping

NAME
ping, ping6 - send ICMP ECHO_REQUEST to network hosts

SYNOPSIS
ping [-aAbBdDfhLnOqrRUvV] [-c count] [-F flowlabel] [-i interval] [-I
interface] [-l preload] [-m mark] [-M pmtudisc_option] [-N node‐
info_option] [-w deadline] [-W timeout] [-p pattern] [-Q tos] [-s pack‐
etsize] [-S sndbuf] [-t ttl] [-T timestamp option] [hop ...] destina‐
tion

DESCRIPTION
ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit
an ICMP ECHO_RESPONSE from a host or gateway. ECHO_REQUEST datagrams
(``pings'') have an IP and ICMP header, followed by a struct timeval
and then an arbitrary number of ``pad'' bytes used to fill out the
packet.

ping6 is IPv6 version of ping, and can also send Node Information
Queries (RFC4620). Intermediate hops may not be allowed, because IPv6
source routing was deprecated (RFC5095).

OPTIONS
-a Audible ping.

-A Adaptive ping. Interpacket interval adapts to round-trip time,


so that effectively not more than one (or more, if preload is
set) unanswered probe is present in the network. Minimal inter‐
val is 200msec for not super-user. On networks with low rtt
this mode is essentially equivalent to flood mode.

-b Allow pinging a broadcast address.

-B Do not allow ping to change source address of probes. The


address is bound to one selected when ping starts.

OUTPUT:-
rgit@rgit60:~$ ping 127.24.25.58
PING 127.24.25.58 (127.24.25.58) 56(84) bytes of data.
64 bytes from 127.24.25.58: icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from 127.24.25.58: icmp_seq=2 ttl=64 time=0.024 ms
64 bytes from 127.24.25.58: icmp_seq=3 ttl=64 time=0.024 ms
64 bytes from 127.24.25.58: icmp_seq=4 ttl=64 time=0.029 ms
64 bytes from 127.24.25.58: icmp_seq=5 ttl=64 time=0.029 ms
64 bytes from 127.24.25.58: icmp_seq=6 ttl=64 time=0.028 ms

2.ifconfig
NAME
ifconfig - configure a network interface

SYNOPSIS
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...

DESCRIPTION
Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time
to
set up interfaces as necessary. After that, it is usually only needed when debugging or when
sys‐
tem tuning is needed.

If no arguments are given, ifconfig displays the status of the currently active interfaces. If a
single interface argument is given, it displays the status of the given interface only; if a sin‐
gle -a argument is given, it displays the status of all interfaces, even those that are down.
Otherwise, it configures an interface.

Address Families
If the first argument after the interface name is recognized as the name of a supported
address
family, that address family is used for decoding and displaying all protocol addresses.
Currently
supported address families include inet (TCP/IP, default), inet6 (IPv6), ax25 (AMPR Packet
Radio),
ddp (Appletalk Phase 2), ipx (Novell IPX) and netrom (AMPR Packet radio).

OPTIONS
-a display all interfaces which are currently available, even if down

-s display a short list (like netstat -i)

-v be more verbose for some error conditions

OUTPUT:-
rgit@rgit60:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 94:de:80:91:40:c2
inet addr:172.24.25.55 Bcast:172.24.255.255 Mask:255.255.0.0
inet6 addr: fe80::96de:80ff:fe91:40c2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:176118 errors:0 dropped:40 overruns:0 frame:0
TX packets:930 errors:0 dropped:0 overruns:0 carrier:1
collisions:0 txqueuelen:1000
RX bytes:16930557 (16.9 MB) TX bytes:162177 (162.1 KB)

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2083 errors:0 dropped:0 overruns:0 frame:0
TX packets:2083 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:172982 (172.9 KB) TX bytes:172982 (172.9 KB)

3.ifup and ifdown


NAME
ifup - bring a network interface up

ifdown - take a network interface down

ifquery - parse interface configuration

SYNOPSIS
ifup [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow CLASS] -a|IFACE...
ifup -h|--help
ifup -V|--version

ifdown [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow CLASS] -a|IFACE...

ifquery [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow CLASS] -


a|IFACE...

ifquery -l|--list [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow


CLASS]
-a|IFACE...

ifquery --state [IFACE...]

DESCRIPTION
The ifup and ifdown commands may be used to configure (or, respectively, deconfigure)
network
interfaces based on interface definitions in the file /etc/network/interfaces. ifquery
command
may be used to parse interfaces configuration.
OPTIONS
A summary of options is included below.

-a, --all
If given to ifup, affect all interfaces marked auto. Interfaces are brought up in the
order in which they are defined in /etc/network/interfaces. Combined with --allow, acts
on
all interfaces of a specified class instead. If given to ifdown, affect all defined inter‐
faces. Interfaces are brought down in the order in which they are currently listed in the
state file. Only interfaces defined in /etc/network/interfaces will be brought down.

--force
Force configuration or deconfiguration of the interface.

-h, --help
Show summary of options.

4.NETSTAT

NAME
netstat - Print network connections, routing tables, interface statistics, masquerade
connections,
and multicast memberships

SYNOPSIS
netstat [address_family_options] [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l] [--all|-a]
[--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--symbolic|-
N]
[--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [--verbose|-v] [--continuous|-c]

netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v]


[--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c]

netstat {--interfaces|-i} [--all|-a] [--extend|-e[--extend|-e]] [--verbose|-v] [--program|-p]


[--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c]

netstat {--groups|-g} [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--


con‐
tinuous|-c]

netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts] [--numeric-


ports]
[--numeric-users] [--continuous|-c]

netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w]


netstat {--version|-V}

netstat {--help|-h}

address_family_options:

[-4] [-6] [--protocol={inet,unix,ipx,ax25,netrom,ddp}[,...]] [--unix|-x] [--inet|--ip] [--ax25]


[--ipx] [--netrom] [--ddp]
DESCRIPTION
Netstat prints information about the Linux networking subsystem. The type of information
printed
is controlled by the first argument, as follows:

(none)
By default, netstat displays a list of open sockets. If you don't specify any address families,
then the active sockets of all configured address families will be printed.

--route , -r
Display the kernel routing tables. See the description in route(8) for details. netstat -r and
route -e produce the same output.

--groups , -g
Display multicast group membership information for IPv4 and IPv6.

--interfaces, -i
Display a table of all network interfaces.

--masquerade , -M
Display a list of masqueraded connections.

--statistics , -s
Display summary statistics for each protocol.

OPTIONS
--verbose , -v
Tell the user what is going on by being verbose. Especially print some useful information
about
unconfigured address families.

--wide , -W
Do not truncate IP addresses by using output as wide as needed. This is optional for now to
not
break existing scripts.

--numeric , -n
Show numerical addresses instead of trying to determine symbolic host, port or user names.
OUTPUT:-
rgit@rgit60:~$ netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 1 0 ip6-localhost:34922 ip6-localhost:ipp CLOSE_WAIT
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node Path
unix 15 [ ] DGRAM 1869 /dev/log
unix 3 [ ] STREAM CONNECTED 15348 @/tmp/dbus-1H6Iq3NXkI
unix 3 [ ] STREAM CONNECTED 15231 @/dbus-vfs-daemon/socket-p7cHYfjP
unix 3 [ ] STREAM CONNECTED 10493
unix 3 [ ] STREAM CONNECTED 16397
unix 3 [ ] STREAM CONNECTED 15535
unix 3 [ ] STREAM CONNECTED 15135
unix 3 [ ] STREAM CONNECTED 19538 @/tmp/dbus-Tiko26D0
unix 3 [ ] STREAM CONNECTED 14557 @/tmp/dbus-1H6Iq3NXkI
unix 3 [ ] STREAM CONNECTED 13538 @/tmp/dbus-1H6Iq3NXkI
unix 3 [ ] STREAM CONNECTED 14426
unix 3 [ ] STREAM CONNECTED 14695
unix 3 [ ] STREAM CONNECTED 14441 @/tmp/dbus-1H6Iq3NXkI
unix 3 [ ] STREAM CONNECTED 10594 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 18702
unix 3 [ ] STREAM CONNECTED 13937 @/tmp/dbus-1H6Iq3NXkI
unix 3 [ ] STREAM CONNECTED 14638
unix 3 [ ] STREAM CONNECTED 13824 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 14025 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 13843 @/tmp/dbus-1H6Iq3NXkI
unix 3 [ ] STREAM CONNECTED 13941

5.arp
NAME
arp - manipulate the system ARP cache

SYNOPSIS
arp [-vn] [-H type] [-i if] [-a] [hostname]

arp [-v] [-i if] -d hostname [pub]

arp [-v] [-H type] [-i if] -s hostname hw_addr [temp]

arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub

arp [-v] [-H type] [-i if] -Ds hostname ifname [netmask nm] pub

arp [-vnD] [-H type] [-i if] -f [filename]

DESCRIPTION
Arp manipulates or displays the kernel's IPv4 network neighbour cache. It can add entries
to the
table, delete one or display the current content.

ARP stands for Address Resolution Protocol, which is used to find the media access control
address
of a network neighbour for a given IPv4 Address.
OPTIONS
-v, --verbose
Tell the user what is going on by being verbose.

-n, --numeric
shows numerical addresses instead of trying to determine symbolic host, port or user
names.

-H type, --hw-type type


When setting or reading the ARP cache, this optional parameter tells arp which class
of
entries it should check for. The default value of this parameter is ether (i.e. hardware
code 0x01 for IEEE 802.3 10Mbps Ethernet). Other values might include network
technologies
such as ARCnet (arcnet) , PROnet (pronet) , AX.25 (ax25) and NET/ROM (netrom).

-a Use alternate BSD style output format (with no fixed columns).

OUTPUT:-
rgit@rgit60:~$ arp
Address HWtype HWaddress Flags Mask Iface
172.24.0.132 ether 3c:d9:2b:f2:72:f3 C eth0

6.rarp
NAME
rarp - manipulate the system RARP table

SYNOPSIS
rarp [-V] [--version] [-h] [--help]
rarp -a
rarp [-v] -d hostname ...
rarp [-v] [-t type] -s hostname hw_addr

NOTE
This program is obsolete. From version 2.3, the Linux kernel no longer contains RARP
support.
For a replacement RARP daemon, see ftp://ftp.dementia.org/pub/net-tools

DESCRIPTION
Rarp manipulates the kernel's RARP table in various ways. The primary options are
clearing an
address mapping entry and manually setting up one. For debugging purposes, the rarp
program also
allows a complete dump of the RARP table.

OPTIONS
-V Display the version of RARP in use.

-v Tell the user what is going on by being verbose.

-t type
When setting or reading the RARP table, this optional parameter tells rarp which class
of
entries it should check for. The default value of this parameter is ether (i.e. hardware
code 0x01 for IEEE 802.3 10Mbps Ethernet . Other values might include network
technologies
such as AX.25 (ax25) and NET/ROM (netrom).

-a

--list Lists the entries in the RARP table.


OUTPUT:-
rgit@rgit60:~$ rarp
Usage: rarp -a list entries in cache.
rarp -d <hostname> delete entry from cache.
rarp [<HW>] -s <hostname> <hwaddr> add entry to cache.
rarp -f add entries from /etc/ethers.
rarp -V display program version.

<HW>=Use '-H <hw>' to specify hardware address type. Default: ether


List of possible hardware types (which support ARP):
ash (Ash) ether (Ethernet) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) rose (AMPR ROSE) arcnet (ARCnet)
dlci (Frame Relay DLCI) fddi (Fiber Distributed Data Interface) hippi (HIPPI)
irda (IrLAP) x25 (generic X.25) eui64 (Generic EUI-64)

rgit@rgit60:~$ rarp -V
net-tools 1.60
rarp 1.03 (2001-04-04)

7.HOSTNAME
NAME
hostname - show or set the system's host name
domainname - show or set the system's NIS/YP domain name
ypdomainname - show or set the system's NIS/YP domain name
nisdomainname - show or set the system's NIS/YP domain name
dnsdomainname - show the system's DNS domain name

SYNOPSIS
hostname [-a|--alias] [-d|--domain] [-f|--fqdn|--long] [-A|--all-fqdns] [-i|--ip-address]
[-I|--all-ip-addresses] [-s|--short] [-y|--yp|--nis]
hostname [-b|--boot] [-F|--file filename] [hostname]
hostname [-h|--help] [-V|--version]

domainname [nisdomain] [-F file]


ypdomainname [nisdomain] [-F file]
nisdomainname [nisdomain] [-F file]

dnsdomainname

DESCRIPTION
Hostname is used to display the system's DNS name, and to display or set its hostname or
NIS
domain name.
GET NAME
When called without any arguments, the program displays the current names:

hostname will print the name of the system as returned by the gethostname(2) function.

domainname will print the NIS domainname of the system. domainname uses the
gethostname(2) func‐
tion, while ypdomainname and nisdomainname use the yp_get_default_domain(3).

dnsdomainname will print the domain part of the FQDN (Fully Qualified Domain Name).
The complete
FQDN of the system is returned with hostname --fqdn (but see the warnings in section
THE FQDN
below).
OPTIONS
-a, --alias
Display the alias name of the host (if used). This option is deprecated and should not
be
used anymore.

-A, --all-fqdns
Displays all FQDNs of the machine. This option enumerates all configured network
addresses
on all configured network interfaces, and translates them to DNS domain names.
Addresses
that cannot be translated (i.e. because they do not have an appropriate reverse IP entry)
are skipped. Note that different addresses may resolve to the same name, therefore the
out‐
put may contain duplicate entries. Do not make any assumptions about the order of the
out‐
put.

-b, --boot
Always set a hostname; this allows the file specified by -F to be non-existant or empty,
in
which case the default hostname localhost will be used if none is yet set.

OUTPUT:-
rgit@rgit60:~$ hostname
rgit60
8.w
NAME
w - Show who is logged on and what they are doing.

SYNOPSIS
w [options] user [...]

DESCRIPTION
w displays information about the users currently on the machine, and their processes. The
header
shows, in this order, the current time, how long the system has been running, how many
users are
currently logged on, and the system load averages for the past 1, 5, and 15 minutes.

The following entries are displayed for each user: login name, the tty name, the remote
host,
login time, idle time, JCPU, PCPU, and the command line of their current process.

The JCPU time is the time used by all processes attached to the tty. It does not include
past
background jobs, but does include currently running background jobs.

The PCPU time is the time used by the current process, named in the "what" field.

COMMAND-LINE OPTIONS
-h, --no-header
Don't print the header.

-u, --no-current
Ignores the username while figuring out the current process and cpu times. To
demonstrate
this, do a "su" and do a "w" and a "w -u".
-s, --short
Use the short format. Don't print the login time, JCPU or PCPU times.
OUTPUT:-
rgit@rgit60:~$ w
10:09:25 up 1:31, 2 users, load average: 0.01, 0.07, 0.03
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
rgit :0 :0 09:07 ?xdm? 1:43 0.16s init --user
rgit pts/0 :0 09:08 0.00s 0.18s 0.00s w
9.route
NAME
route - show / manipulate the IP routing table

SYNOPSIS
route [-CFvnee]

route [-v] [-A family] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M]
[window W]
[irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]

route [-v] [-A family] del [-net|-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If]

route [-V] [--version] [-h] [--help]

DESCRIPTION
Route manipulates the kernel's IP routing tables. Its primary use is to set up static routes to
specific hosts or networks via an interface after it has been configured with the ifconfig(8)
pro‐
gram.

When the add or del options are used, route modifies the routing tables. Without these
options,
route displays the current contents of the routing tables.

OPTIONS
-A family
use the specified address family (eg `inet'; use `route --help' for a full list).

-F operate on the kernel's FIB (Forwarding Information Base) routing table. This is
the
default.

-C operate on the kernel's routing cache.

-v select verbose operation.

OUTPUT:-
rgit@rgit60:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.24.0.0 * 255.255.0.0 U 1 0 0 eth0

10.TELNET

NAME
telnet — user interface to the TELNET protocol

SYNOPSIS
telnet [-468ELadr] [-S tos] [-b address] [-e escapechar] [-l user] [-n tracefile] [host [port]]

DESCRIPTION
The telnet command is used for interactive communication with another host using the
TELNET protocol. It begins in command mode, where it prints a telnet prompt ("telnet> "). If
telnet is invoked with a host argument, it performs an open command implicitly; see the
description below.

OPTIONS:

-4 Force IPv4 address resolution.

-6 Force IPv6 address resolution.

-8 Request 8-bit operation. This causes an attempt to negotiate the TELNET BINARY
option for both input and output. By default telnet is not 8-bit clean.

Das könnte Ihnen auch gefallen