Rumburak avatar

RUMBURAK'S HOME PAGE

I'm just a simple man trying to make my way through the universe

about tests tools articles links news contact blog guestbook homepage


testing the first sketch

BASIC
date - print or set the system date and time
uname - print system information
arch - print machine architecture

HARDWARE
dmesg - print or control the kernel ring buffer
lsusb - list USB devices
lspci - list all PCI devices
cardctl - PCMCIA card control utility
pccardctl - PCMCIA card control utility

NET
ifconfig - configure a network interface
ip
iwconfig - configure a wireless network interface
ethtool
mii-tool - view, manipulate media-independent interface status

FILE SYSTEMS
free - Display amount of free and used memory in the system
df - report file system disk space usage
mount
fdisk - Partition table manipulator for Linux
pvscan - scan all disks for physical volumes
vgscan - scan all disks for volume groups and rebuild caches
lvscan - scan (all disks) for logical volumes

FILES
locate - list files in databases that match a pattern
whereis - locate the binary, source, and manual page files for a command
pwd - print name of current/working directory
ls - list directory contents
find - search for files in a directory hierarchy
file - determine file type
du - estimate file space usage

USERS & NET
whoami - print effective userid
groups - print the groups a user is in
hostname - show or set the system’s host name
dnsdomainname - show the system’s DNS domain name
id - print user identity
last, lastb - show listing of last logged in users
lastlog - reports the most recent login of all users or of a given user
w - Show who is logged on and what they are doing.
finger - user information lookup program
ps - report a snapshot of the current processes
top - display Linux tasks
fuser - identify processes using files or sockets
strace - trace system calls and signals
nice - run a program with modified scheduling priority
renice - alter priority of running processes
netstat - Print network connections, routingtables,...
route - show / manipulate the IP routing table
rpcinfo - report RPC information


date - print or set the system date and time

date
Sat Feb 23 13:35:14 CET 2008


date
Sat Mar 1 23:56:16 GMT 2008
date -u print or set Coordinated Universal Time
Sat Mar 1 23:58:25 UTC 2008
date +%:z +hh:mm numeric timezone (e.g., -04:00)
+00:00
date +%Z alphabetic time zone abbreviation (e.g., EDT)
GMT

uname - print system information

uname -a

Linux rumburak 2.6.22 #1 SMP PREEMPT Mon May 01 31:01:08 UTC 2006 i686 GNU/Linux


-a, --all print all information, in the following order,
except omit -p and -i if unknown:
-s, --kernel-name print the kernel name
-n, --nodename print the network node hostname
-r, --kernel-release print the kernel release
-v, --kernel-version print the kernel version
-m, --machine print the machine hardware name
-p, --processor print the processor type or "unknown"man df

-i, --hardware-platform print the hardware platform or "unknown"
-o, --operating-system print the operating system

arch - print machine architecture
( arch is equivalent to uname -m)
# arch
i686



dmesg - print or control the kernel ring buffer

lsusb - list USB devices
lspci - list all PCI devices

cardctl - PCMCIA card control utility
pccardctl - PCMCIA card control utility

new systems may use pccardctl

cardctl status
cardctl info

ifconfig - configure a network interface

ip
bt ~ # ip a
1: lo: mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:18:f3:fe:74:74 brd ff:ff:ff:ff:ff:ff
3: wlan0: mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:15:af:0c:de:2e brd ff:ff:ff:ff:ff:ff

iwconfig - configure a wireless network interface
lo no wireless extensions.

eth0 no wireless extensions.

ethtool

mii-tool - view, manipulate media-independent interface status

mii-tool -v
eth0: no link
product info: ***
basic mode: autonegotiation enabled
basic status: no link
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
free - Display amount of free and used memory in the system

total used free shared buffers cached
Mem: 507164 380752 126412 0 21208 177012
-/+ buffers/cache: 182532 324632
Swap: 875532 0 875532

df - report file system disk space usage
df -h (human readable)
mount - mount a file system
umount - umount a file system
fdisk - Partition table manipulator for Linux

fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 5160 20964825 7 HPFS/NTFS
/dev/sda3 5161 17908 102398310 7 HPFS/NTFS
/dev/sda4 17909 30401 100350022+ 7 HPFS/NTFS
The device is usually one of the following:
/dev/hda
/dev/hdb
/dev/sda
/dev/sdb
(/dev/hd[a-h] for IDE disks, /dev/sd[a-p] for SCSI disks, /dev/ed[a-d]
for ESDI disks, /dev/xd[ab] for XT disks). A device name refers to the
entire disk.

pvscan - scan all disks for physical volumes
pvscan
PV /dev/mapper/pvcrypt VG vgcrypt lvm2 [36.15 GB / 31.49 GB free]
Total: 1 [36.15 GB] / in use: 1 [36.15 GB] / in no VG: 0 [0 ]


vgscan - scan all disks for volume groups and rebuild caches
vgscan
Reading all physical volumes. This may take a while...
Found volume group "vgcrypt" using metadata type lvm2

lvscan - scan (all disks) for logical volumes
lvscan
ACTIVE '/dev/vgcrypt/home' [64.00 MB] inherit
ACTIVE '/dev/vgcrypt/root' [192.00 MB] inherit
ACTIVE '/dev/vgcrypt/var' [752.00 MB] inherit
ACTIVE '/dev/vgcrypt/tmp' [64.00 MB] inherit
ACTIVE '/dev/vgcrypt/usr' [2.00 GB] inherit
ACTIVE '/dev/vgcrypt/swap' [632.00 MB] inherit

locate - list files in databases that match a pattern

whereis - locate the binary, source, and manual page files for a command


whereis perl
perl: /usr/bin/perl /etc/perl /usr/lib/perl /usr/X11R6/bin/perl /usr/bin/X11/perl /usr/share/perl /usr/share/man/man1/perl.1.gz
pwd - print name of current/working directory

pwd
/root

ls - list directory contents

ls
ls -l |more
....
-rw-r--r-- 1 root root 2293 2008-01-08 12:14 cdrom.txt
...
# recursive listing files in directory

ls -RshF >>/root/notes.txt

ls -Rsh --file-type >>/root/cdrom.txt


-R, --recursive list subdirectories recursively
-s, --size with -l, print size of each file, in blocks
-h, --human-readable with -l, print sizes in human readable format
(e.g., 1K 234M 2G)
-F, --classify append indicator (one of */=>@|) to entries
--file-type likewise, except do not append `*'


# directory listing without internet _files

ls -RF | grep / | grep -v _files


find - search for files in a directory hierarchy
find *.txt

file - determine file type

file root
root:directory
file /root
file *.png
55e4b9.png: PNG image data, 359 x 325, 8-bit/color RGB, non-interlaced
heavily-guarded.png: PNG image data, 482 x 130, 8-bit colormap, non-interlaced
santana.png: PNG image data, 800 x 800, 16-bit/color RGBA, non-interlaced


du - estimate file space usage
Summarize disk usage of each FILE, recursively for directories.

whoami - print effective userid

groups - print the groups a user is in
bt ~ # groups
root bin daemon sys adm disk wheel floppy


hostname - show or set the system’s host name
root@avalon:~# hostname
avalon
dnsdomainname - show the system’s DNS domain name
id - print user identity
Print information for USERNAME, or the current user.

root@avalon:~# id
uid=0(root) gid=0(root) groups=0(root)

last, lastb - show listing of last logged in users


last
root pts/0 :0.0 Sat Mar 1 23:55 still logged in
root tty1 Sat Mar 1 23:54 still logged in
reboot system boot 2.6.21.5 Sat Mar 1 23:53 (00:25)
root tty1 Sat Mar 1 18:22 - down (00:05)
reboot system boot 2.6.21.5 Sat Mar 1 18:21 (00:06)
root tty1 Sat Jan 12 22:54 - down (00:04)
reboot system boot 2.6.21.5 Sat Jan 12 22:53 (00:04)
root :0 Sat Jan 12 22:23 - crash (00:30)
reboot system boot 2.6.21.5 Sat Jan 12 22:23 (00:35)
root tty1 Sat Dec 8 13:05 - crash (35+09:17)
reboot system boot 2.6.21.5 Sat Dec 8 13:05 (35+09:53)
root tty1 Sat Dec 8 13:01 - down (00:03)
root tty1 Sat Dec 8 12:57 - 13:01 (00:03)
reboot system boot 2.6.21.5 Sat Dec 8 12:57 (00:07)
lastlog - reports the most recent login of all users or of a given user
lastlog
Username Port From Latest
root :0 Sat Feb 23 13:33:05 +0100 2008
daemon **Never logged in**
...

w - Show who is logged on and what they are doing.

w
13:55:38 up 23 min, 2 users, load average: 0.24, 0.25, 0.19
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root :0 - 13:33 ?xdm? 27.36s 0.42s /usr/bin/gnome-
root pts/0 :0.0 13:33 0.00s 0.09s 0.00s w

finger - user information lookup program
finger
Login Name Tty Idle Login Time Office Office Phone
root root *:0 Feb 23 13:33
root root pts/0 Feb 23 13:33 (:0.0)

quota ??

ps - report a snapshot of the current processes.

ps
PID TTY TIME CMD
5393 pts/0 00:00:00 bash
6572 pts/0 00:00:00 ps

top - display Linux tasks

SYNOPSIS
top -hv | -bcHisS -d delay -n iterations -p pid [, pid ...]

The traditional switches ’-’ and whitespace are optional.

DESCRIPTION
The top program provides a dynamic real-time view of a running system.
It can display system summary information as well as a list of tasks
currently being managed by the Linux kernel.

lsof - list open files

fuser - identify processes using files or sockets

strace - trace system calls and signals
nice - run a program with modified scheduling priority
renice - alter priority of running processes
netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

route - show / manipulate the IP routing table

rpcinfo - report RPC information
rpcinfo -p localhost
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 32769 status
100024 1 tcp 40627 status

a bit funny code , prepared with NVU



|home page| Valid HTML 4.01 Transitional Valid CSS!

Free Web Hosting