Busybox命令详解

Busybox命令详解
Busybox命令详解

NAME

BusyBox - The Swiss Army Knife of Embedded Linux

SYNTAX

busybox [arguments...] # or

[arguments...] # if symlinked

DESCRIPTION

BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU coreutils, util-linux, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts.

BusyBox has been written with size-optimization and limited resources in mind. It is also extremely modular so you can easily include or exclude commands (or features) at compile time. This makes it easy to customize your embedded systems. To create a working system, just add /dev, /etc, and a Linux kernel. BusyBox provides a fairly complete POSIX environment for any small or embedded system.

BusyBox is extremely configurable. This allows you to include only the components you need, thereby reducing binary size. Run 'make config' or 'make menuconfig' to select the functionality that you wish to enable. Then run 'make' to compile BusyBox using your configuration.

After the compile has finished, you should use 'make install' to install BusyBox. This will install the 'bin/busybox' binary, in the target directory specified by CONFIG_PREFIX. CONFIG_PREFIX can be set when configuring BusyBox, or you can specify an alternative location at install time (i.e., with a command line like 'make CONFIG_PREFIX=/tmp/foo install'). If you enabled any applet installation scheme (either as symlinks or hardlinks), these will also be installed in the location pointed to by CONFIG_PREFIX.

USAGE

BusyBox is a multi-call binary. A multi-call binary is an executable program that performs the same job as more than one utility program. That means there is just a single BusyBox binary, but that single binary acts like a large number of utilities. This allows BusyBox to be smaller since all the built-in utility programs (we call them applets) can share code for many common operations. Y ou can also invoke BusyBox by issuing a command as an argument on the command line. For example, entering

/bin/busybox ls

will also cause BusyBox to behave as 'ls'.

Of course, adding '/bin/busybox' into every command would be painful. So most people will invoke BusyBox using links to the BusyBox binary.

For example, entering

ln -s /bin/busybox ls

./ls

will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled into BusyBox). Generally speaking, you should never need to make all these links yourself, as the BusyBox build system will do this for you when you run the 'make install' command.

If you invoke BusyBox with no arguments, it will provide you with a list of the applets that have been compiled into your BusyBox binary.

COMMON OPTIONS

Most BusyBox applets support the --help argument to provide a terse runtime description of their behavior. If the CONFIG_FEA TURE_VERBOSE_USAGE option has been enabled, more detailed usage information will also be available.

COMMANDS

Currently available applets include:

[, [[, acpid, addgroup, adduser, adjtimex, ar, arp, arping, ash,

awk, basename, beep, blkid, brctl, bunzip2, bzcat, bzip2, cal, cat,

catv, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot,

chrt, chvt, cksum, clear, cmp, comm, cp, cpio, crond, crontab,

cryptpw, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod,

devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname,

dos2unix, dpkg, du, dumpkmap, dumpleases, echo, ed, egrep, eject,

env, envdir, envuidgid, expand, expr, fakeidentd, false, fbset,

fbsplash, fdflush, fdformat, fdisk, fgrep, find, findfs, flash_lock,

flash_unlock, fold, free, freeramdisk, fsck, fsck.minix, fsync,

ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, hd,

hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id,

ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, inotifyd,

insmod, install, ionice, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink,

iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd,

last, length, less, linux32, linux64, linuxrc, ln, loadfont,

loadkmap, logger, login, logname, logread, losetup, lpd, lpq, lpr,

ls, lsattr, lsmod, lzmacat, lzop, lzopcat, makemime, man, md5sum,

mdev, mesg, microcom, mkdir, mkdosfs, mkfifo, mkfs.minix, mkfs.vfat,

mknod, mkpasswd, mkswap, mktemp, modprobe, more, mount, mountpoint,

mt, mv, nameif, nc, netstat, nice, nmeter, nohup, nslookup, od,

openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress,

pivot_root, pkill, popmaildir, printenv, printf, ps, pscan, pwd,

raidautorun, rdate, rdev, readlink, readprofile, realpath,

reformime, renice, reset, resize, rm, rmdir, rmmod, route, rpm,

rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script,

scriptreplay, sed, sendmail, seq, setarch, setconsole, setfont,

setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum,

sha512sum, showkey, slattach, sleep, softlimit, sort, split,

start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv,

svlogd, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac,

tail, tar, taskset, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd,

time, timeout, top, touch, tr, traceroute, true, tty, ttysize,

udhcpc, udhcpd, udpsvd, umount, uname, uncompress, unexpand, uniq,

unix2dos, unlzma, unlzop, unzip, uptime, usleep, uudecode, uuencode,

vconfig, vi, vlock, volname, watch, watchdog, wc, wget, which, who,

whoami, xargs, yes, zcat, zcip

COMMAND DESCRIPTIONS

acpid

acpid [-d] [-c CONFDIR] [-l LOGFILE] [-e PROC_EVENT_FILE] [EVDEV_EVENT_FILE...] Listen to ACPI events and spawn specific helpers on event arrival

Options:

-d Do not daemonize and log to stderr

-c DIR Config directory [/etc/acpi]

-e FILE /proc event file [/proc/acpi/event]

-l FILE Log file [/var/log/acpid]

Accept and ignore compatibility options -g -m -s -S -v

addgroup

addgroup [-g GID] [user_name] group_name

Add a group or add a user to a group

Options:

-g GID Group id

-S Create a system group

adduser

adduser [OPTIONS] user_name

Add a user

Options:

-h DIR Home directory

-g GECOS GECOS field

-s SHELL Login shell

-G GRP Add user to existing group

-S Create a system user

-D Do not assign a password

-H Do not create home directory

-u UID User id

adjtimex

adjtimex [-q] [-o offset] [-f frequency] [-p timeconstant] [-t tick]

Read and optionally set system timebase parameters. See adjtimex(2).

Options:

-q Quiet

-o offset Time offset, microseconds

-f frequency Frequency adjust, integer kernel units (65536 is 1ppm)

(positive values make clock run faster)

-t tick Microseconds per tick, usually 10000

-p timeconstant

ar

ar [-o] [-v] [-p] [-t] [-x] ARCHIVE FILES

Extract or list FILES from an ar archive

Options:

-o Preserve original dates

-p Extract to stdout

-t List

-x Extract

-v V erbose

arp

arp

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

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

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

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

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

Manipulate ARP cache

Options:

-a Display (all) hosts

-s Set new ARP entry

-d Delete a specified entry

-v V erbose

-n Don't resolve names

-i IF Network interface

-D Read from given device

-A, -p AF Protocol family

-H HWTYPE Hardware address type

arping

arping [-fqbDUA] [-c count] [-w timeout] [-I dev] [-s sender] target

Send ARP requests/replies

Options:

-f Quit on first ARP reply

-q Quiet

-b Keep broadcasting, don't go unicast

-D Duplicated address detection mode

-U Unsolicited ARP mode, update your neighbors

-A ARP answer mode, update your neighbors

-c N Stop after sending N ARP requests

-w timeout Time to wait for ARP reply, in seconds

-I dev Interface to use (default eth0)

-s sender Sender IP address

target Target IP address

awk

awk [OPTIONS] [A WK_PROGRAM] [FILE]...

Options:

-v V AR=V AL Set variable

-F SEP Use SEP as field separator

-f FILE Read program from file

basename

basename FILE [SUFFIX]

Strip directory path and .SUFFIX from FILE

beep

beep -f freq -l length -d delay -r repetitions -n

Options:

-f Frequency in Hz

-l Length in ms

-d Delay in ms

-r Repetitions

-n Start new tone

blkid

blkid

Print UUIDs of all filesystems

brctl

brctl COMMAND [BRIDGE [INTERFACE]]

Manage ethernet bridges

Commands:

show Show a list of bridges

addbr BRIDGE Create BRIDGE

delbr BRIDGE Delete BRIDGE

addif BRIDGE IFACE Add IFACE to BRIDGE

delif BRIDGE IFACE Delete IFACE from BRIDGE

setageing BRIDGE TIME Set ageing time

setfd BRIDGE TIME Set bridge forward delay

sethello BRIDGE TIME Set hello time

setmaxage BRIDGE TIME Set max message age

setpathcost BRIDGE COST Set path cost

setportprio BRIDGE PRIO Set port priority

setbridgeprio BRIDGE PRIO Set bridge priority

stp BRIDGE [1|0] STP on/off

bunzip2

bunzip2 [OPTIONS] [FILE]

Uncompress FILE (or standard input if FILE is '-' or omitted)

Options:

-c Write to standard output

-f Force

bzcat

bzcat FILE

Uncompress to stdout

bzip2

bzip2 [OPTIONS] [FILE]...

Compress FILE(s) with bzip2 algorithm. When FILE is '-' or unspecified, reads standard input. Implies -c.

Options:

-c Write to standard output

-d Decompress

-f Force

-1..-9 Compression level

cal

cal [-jy] [[month] year]

Display a calendar

Options:

-j Use julian dates

-y Display the entire year

cat

cat [-u] [FILE]...

Concatenate FILE(s) and print them to stdout

Options:

-u Use unbuffered i/o (ignored)

catv

catv [-etv] [FILE]...

Display nonprinting characters as ^x or M-x

Options:

-e End each line with $

-t Show tabs as ^I

-v Don't use ^x or M-x escapes

chat

chat EXPECT [SEND [EXPECT [SEND...]]]

Useful for interacting with a modem connected to stdin/stdout. A script consists of one or more "expect-send" pairs of strings, each pair is a pair of arguments. Example: chat '' A TZ OK A TD123456 CONNECT '' ogin: pppuser word: ppppass '~'

chattr

chattr [-R] [-+=AacDdijsStTu] [-v version] files...

Change file attributes on an ext2 fs

Modifiers:

- Remove attributes

+ Add attributes

= Set attributes

Attributes:

A Don't track atime

a Append mode only

c Enable compress

D Write dir contents synchronously

d Do not backup with dump

i Cannot be modified (immutable)

j Write all data to journal first

s Zero disk storage when deleted

S Write file contents synchronously

t Disable tail-merging of partial blocks with other files

u Allow file to be undeleted

Options:

-R Recursively list subdirectories

-v Set the file's version/generation number

chgrp

chgrp [-RhLHPcvf]... GROUP FILE...

Change the group membership of each FILE to GROUP

Options:

-R Recurse

-h Affect symlinks instead of symlink targets

-L Traverse all symlinks to directories

-H Traverse symlinks on command line only

-P Do not traverse symlinks (default)

-c List changed files

-v V erbose

-f Hide errors

chmod

chmod [-Rcvf] MODE[,MODE]... FILE...

Each MODE is one or more of the letters ugoa, one of the symbols +-= and one or more of the letters rwxst

Options:

-R Recurse

-c List changed files

-v List all files

-f Hide errors

chown

chown [-RhLHPcvf]... OWNER[<.|:>[GROUP]] FILE...

Change the owner and/or group of each FILE to OWNER and/or GROUP

Options:

-R Recurse

-h Affect symlinks instead of symlink targets

-L Traverse all symlinks to directories

-H Traverse symlinks on command line only

-P Do not traverse symlinks (default)

-c List changed files

-v List all files

-f Hide errors

chpasswd

chpasswd [--md5|--encrypted]

Read user:password from stdin and update /etc/passwd

Options:

-e,--encrypted Supplied passwords are in encrypted form

-m,--md5 Use MD5 encryption instead of DES

chpst

chpst [-vP012] [-u USER[:GRP]] [-U

USER[:GRP]] [-e DIR]

[-/ DIR] [-n NICE] [-m BYTES] [-d

BYTES] [-o N]

[-p N] [-f BYTES] [-c BYTES] PROG

ARGS

Change the process state and run PROG

Options:

-u USER[:GRP] Set uid and gid

-U USER[:GRP] Set $UID and $GID in environment

-e DIR Set environment variables as specified by files

in DIR: file=1st_line_of_file

-/ DIR Chroot to DIR

-n NICE Add NICE to nice value

-m BYTES Same as -d BYTES -s BYTES -l BYTES

-d BYTES Limit data segment

-o N Limit number of open files per process

-p N Limit number of processes per uid

-f BYTES Limit output file sizes

-c BYTES Limit core file size

-v V erbose

-P Create new process group

-0 Close standard input

-1 Close standard output

-2 Close standard error

chroot

chroot NEWROOT [PROG [ARGS]]

Run PROG with root directory set to NEWROOT

chrt

chrt [OPTIONS] [PRIO] [PID | PROG [ARGS]]

Manipulate real-time attributes of a process

Options:

-p Operate on pid

-r Set scheduling policy to SCHED_RR

-f Set scheduling policy to SCHED_FIFO

-o Set scheduling policy to SCHED_OTHER

-m Show min and max priorities

chvt

chvt N

Change the foreground virtual terminal to /dev/ttyN

cksum

cksum FILES...

Calculate the CRC32 checksums of FILES

clear

clear

Clear screen

cmp

cmp [-l] [-s] FILE1 [FILE2 [SKIP1 [SKIP2]]]

Compares FILE1 vs stdin if FILE2 is not specified

Options:

-l Write the byte numbers (decimal) and values (octal)

for all differing bytes

-s Quiet

comm

comm [-123] FILE1 FILE2

Compare FILE1 to FILE2, or to stdin if - is specified

Options:

-1 Suppress lines unique to FILE1

-2 Suppress lines unique to FILE2

-3 Suppress lines common to both files

cp

cp [OPTIONS] SOURCE DEST

Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY

Options:

-a Same as -dpR

-d,-P Preserve links

-H,-L Dereference all symlinks (default)

-p Preserve file attributes if possible

-f Force overwrite

-i Prompt before overwrite

-R,-r Recurse

-l,-s Create (sym)links

cpio

cpio -[tiopdmvu] [-F FILE] [-H newc]

Extract or list files from a cpio archive, or create a cpio archive Main operation mode: -t List

-i Extract

-o Create

-p Passthrough

Options:

-d Make leading directories

-m Preserve mtime

-v V erbose

-u Overwrite

-F Input file

-H Define format

crond

crond -fbS -l N -d N -L LOGFILE -c DIR

-f Foreground

-b Background (default)

-S Log to syslog (default)

-l Set log level. 0 is the most verbose, default 8

-d Set log level, log to stderr

-L Log to file

-c Working dir

crontab

crontab [-c DIR] [-u USER] [-ler]|[FILE]

-c Crontab directory

-u User

-l List crontab

-e Edit crontab

-r Delete crontab

FILE Replace crontab by FILE ('-': stdin)

cryptpw

cryptpw [OPTIONS] [PASSWORD] [SALT]

Crypt the PASSWORD using crypt(3)

Options:

-P,--password-fd=NUM Read password from fd NUM

-m,--method=TYPE Encryption method TYPE

-S,--salt=SALT

cut

cut [OPTIONS] [FILE]...

Print selected fields from each input FILE to standard output Options:

-b LIST Output only bytes from LIST

-c LIST Output only characters from LIST

-d CHAR Use CHAR instead of tab as the field delimiter

-s Output only the lines containing delimiter

-f N Print only these fields

-n Ignored

date

date [OPTIONS] [+FMT] [TIME]

Display time (using +FMT), or set time

Options:

[-s] TIME Set time to TIME

-u Work in UTC (don't convert to local time)

-R Output RFC-822 compliant date string

-I[SPEC] Output ISO-8601 compliant date string

SPEC='date' (default) for date only,

'hours', 'minutes', or 'seconds' for date and

time to the indicated precision

-r FILE Display last modification time of FILE

-d TIME Display TIME, not 'now'

-D FMT Use FMT for -d TIME conversion

Recognized TIME formats:

hh:mm[:ss]

[YYYY.]MM.DD-hh:mm[:ss]

YYYY-MM-DD hh:mm[:ss]

[[[[[YY]YY]MM]DD]hh]mm[.ss]

dc

dc expression...

Tiny RPN calculator. Operations: +, add, -, sub, *, mul, /, div, %, mod, **, exp, and, or, not, eor, p - print top of the stack (without altering the stack), f - print entire stack, o - pop the value and set output radix (value must be 10 or 16). Examples: 'dc 2 2 add' -> 4, 'dc 8 8 * 2 2 + /' -> 16.

dd

dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [bs=N]

[count=N] [skip=N]

[seek=N]

[conv=notrunc|noerror|sync|fsync] Copy a file with converting and formatting

Options:

if=FILE Read from FILE instead of stdin

of=FILE Write to FILE instead of stdout

bs=N Read and write N bytes at a time

ibs=N Read N bytes at a time

obs=N Write N bytes at a time

count=N Copy only N input blocks

skip=N Skip N input blocks

seek=N Skip N output blocks

conv=notrunc Don't truncate output file

conv=noerror Continue after read errors

conv=sync Pad blocks with zeros

conv=fsync Physically write data out before finishing

Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024), MD (x1000000), M

(x1048576), GD (x1000000000) or G (x1073741824)

deallocvt

deallocvt [N]

Deallocate unused virtual terminal /dev/ttyN

delgroup

delgroup [USER] GROUP

Delete group GROUP from the system or user USER from group GROUP

deluser

deluser USER

Delete USER from the system

devmem

devmem ADDRESS [WIDTH [V ALUE]]

Read/write from physical address

ADDRESS Address to act upon

WIDTH Width (8/16/...)

V ALUE Data to be written

df

df [-Pkmhai] [-B SIZE] [FILESYSTEM...]

Print filesystem usage statistics

Options:

-P POSIX output format

-k 1024-byte blocks (default)

-m 1M-byte blocks

-h Human readable (e.g. 1K 243M 2G)

-a Show all filesystems

-i Inodes

-B SIZE Blocksize

dhcprelay

dhcprelay CLIENT_IFACE[,CLIENT_IFACE2...] SERVER_IFACE [SERVER_IP]

Relay DHCP requests between clients and server

diff

diff [-abdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2

Compare files line by line and output the differences between them. This implementation supports unified diffs only.

Options:

-a Treat all files as text

-b Ignore changes in the amount of whitespace

-d Try hard to find a smaller set of changes

-i Ignore case differences

-L Use LABEL instead of the filename in the unified header

-N Treat absent files as empty

-q Output only whether files differ

-r Recursively compare subdirectories

-S Start with FILE when comparing directories

-T Make tabs line up by prefixing a tab when necessary

-s Report when two files are the same

-t Expand tabs to spaces in output

-U Output LINES lines of context

-w Ignore all whitespace

dirname

dirname FILENAME

Strip non-directory suffix from FILENAME

dmesg

dmesg [-c] [-n LEVEL] [-s SIZE]

Print or control the kernel ring buffer

Options:

-c Clear ring buffer after printing

-n LEVEL Set console logging level

-s SIZE Buffer size

dnsd

dnsd [-c config] [-t seconds] [-p port] [-i iface-ip] [-d]

Small static DNS server daemon

Options:

-c Config filename

-t TTL in seconds

-p Listening port

-i Listening ip (default all)

-d Daemonize

dos2unix

dos2unix [OPTION] [FILE]

Convert FILE in-place from DOS to Unix format. When no file is given, use stdin/stdout. Options:

-u dos2unix

-d unix2dos

dpkg

dpkg [-ilCPru] [-F option] package_name

Install, remove and manage Debian packages

Options:

-i Install the package

-l List of installed packages

-C Configure an unpackaged package

-F depends Ignore dependency problems

-P Purge all files of a package

-r Remove all but the configuration files for a package

-u Unpack a package, but don't configure it

du

du [-aHLdclsxhmk] [FILE]...

Summarize disk space used for each FILE and/or directory. Disk space is printed in units of 1024

bytes.

Options:

-a Show file sizes too

-H Follow symlinks on command line

-L Follow all symlinks

-d N Limit output to directories (and files with -a) of depth < N

-c Show grand total

-l Count sizes many times if hard linked

-s Display only a total for each argument

-x Skip directories on different filesystems

-h Sizes in human readable format (e.g., 1K 243M 2G )

-m Sizes in megabytes

-k Sizes in kilobytes (default)

dumpkmap

dumpkmap > keymap

Print a binary keyboard translation table to standard output

dumpleases

dumpleases [-r|-a] [-f LEASEFILE]

Display DHCP leases granted by udhcpd

Options:

-f,--file=FILE Leases file to load

-r,--remaining Interpret lease times as time remaining

-a,--absolute Interpret lease times as expire time

echo

echo [-neE] [ARG...]

Print the specified ARGs to stdout

Options:

-n Suppress trailing newline

-e Interpret backslash-escaped characters (i.e., \t=tab)

-E Disable interpretation of backslash-escaped characters

ed

ed

eject

eject [-t] [-T] [DEVICE]

Eject specified DEVICE (or default /dev/cdrom)

Options:

-s SCSI device

-t Close tray

-T Open/close tray (toggle)

env

env [-iu] [-] [name=value]... [PROG [ARGS]]

Print the current environment or run PROG after setting up the specified environment Options:

-, -i Start with an empty environment

-u Remove variable from the environment

envdir

envdir dir prog args

Set various environment variables as specified by files in the directory dir and run PROG envuidgid

envuidgid account prog args

Set $UID to account's uid and $GID to account's gid and run PROG

expand

expand [-i] [-t NUM] [FILE|-]

Convert tabs to spaces, writing to standard output

Options:

-i,--initial Do not convert tabs after non blanks

-t,--tabs=N Tabstops every N chars

expr

expr EXPRESSION

Print the value of EXPRESSION to standard output

EXPRESSION may be:

ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2

ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0

ARG1 < ARG2 1 if ARG1 is less than ARG2, else 0. Similarly:

ARG1 <= ARG2

ARG1 = ARG2

ARG1 != ARG2

ARG1 >= ARG2

ARG1 > ARG2

ARG1 + ARG2 Sum of ARG1 and ARG2. Similarly:

ARG1 - ARG2

ARG1 * ARG2

ARG1 / ARG2

ARG1 % ARG2

STRING : REGEXP Anchored pattern match of REGEXP in STRING

match STRING REGEXP Same as STRING : REGEXP

substr STRING POS LENGTH Substring of STRING, POS counted from 1

index STRING CHARS Index in STRING where any CHARS is found, or 0

length STRING Length of STRING

quote TOKEN Interpret TOKEN as a string, even if

it is a keyword like 'match' or an

operator like '/'

(EXPRESSION) V alue of EXPRESSION

Beware that many operators need to be escaped or quoted for shells. Comparisons are arithmetic if both ARGs are numbers, else lexicographical. Pattern matches return the string matched between \( and \) or null; if \( and \) are not used, they return the number of characters matched or 0. fakeidentd

fakeidentd [-fiw] [-b ADDR] [STRING]

Provide fake ident (auth) service

Options:

-f Run in foreground

-i Inetd mode

-w Inetd 'wait' mode

-b ADDR Bind to specified address

STRING Ident answer string (default: nobody)

false

false

Return an exit code of FALSE (1)

fbset

fbset [OPTIONS] [MODE]

Show and modify frame buffer settings

fbsplash

fbsplash -s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD]

Options:

-s Image

-c Hide cursor

-d Framebuffer device (default /dev/fb0)

-i Config file (var=value):

BAR_LEFT,BAR_TOP,BAR_WIDTH,BAR_HEIGHT

BAR_R,BAR_G,BAR_B

-f Control pipe (else exit after drawing image)

commands: 'NN' (% for progress bar) or 'exit' fdflush

fdflush DEVICE

Force floppy disk drive to detect disk change

fdformat

fdformat [-n] DEVICE

Format floppy disk

Options:

-n Don't verify after format

fdisk

fdisk [-ul] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK Change partition table

Options:

-u Start and End are in sectors (instead of cylinders)

-l Show partition table for each DISK, then exit

-b 2048 (for certain MO disks) use 2048-byte sectors

-C CYLINDERS Set number of cylinders/heads/sectors

-H HEADS

-S SECTORS

find

find [PA TH...] [EXPRESSION]

Search for files. The default PA TH is the current directory, default EXPRESSION is '-print' EXPRESSION may consist of:

-follow Dereference symlinks

-xdev Don't descend directories on other filesystems

-maxdepth N Descend at most N levels. -maxdepth 0 applies

tests/actions to command line arguments only

-mindepth N Do not act on first N levels

-name PA TTERN File name (w/o directory name) matches PA TTERN

-iname PA TTERN Case insensitive -name

-path PA TTERN Path matches PA TTERN

-regex PA TTERN Path matches regex PA TTERN

-type X File type is X (X is one of: f,d,l,b,c,...)

-perm NNN Permissions match any of (+NNN), all of (-NNN),

or exactly (NNN)

-mtime DAYS Modified time is greater than (+N), less than (-N),

or exactly (N) days

-mmin MINS Modified time is greater than (+N), less than (-N),

or exactly (N) minutes

-newer FILE Modified time is more recent than FILE's

-inum N File has inode number N

-user NAME File is owned by user NAME (numeric user ID allowed)

-group NAME File belongs to group NAME (numeric group ID allowed)

-depth Process directory name after traversing it

-size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.)).

+/-N: file size is bigger/smaller than N

-print Print (default and assumed)

-print0 Delimit output with null characters rather than

newlines

-exec CMD ARG ; Run CMD with all instances of {} replaced by the

matching files

-prune Stop traversing current subtree

-delete Delete files, turns on -depth option

(EXPR) Group an expression

findfs

findfs LABEL=label or UUID=uuid

Find a filesystem device based on a label or UUID

flash_lock

flash_lock MTD_DEVICE OFFSET SECTORS

Lock part or all of an MTD device. If SECTORS is -1, then all sectors will be locked, regardless of the value of OFFSET

flash_unlock

flash_unlock MTD_DEVICE

Unlock an MTD device

fold

fold [-bs] [-w WIDTH] [FILE]

Wrap input lines in each FILE (standard input by default), writing to standard output

Options:

-b Count bytes rather than columns

-s Break at spaces

-w Use WIDTH columns instead of 80

free

free

Display the amount of free and used system memory

freeramdisk

freeramdisk DEVICE

Free all memory used by the specified ramdisk

fsck

fsck [-ANPRTV] [-C fd] [-t fstype] [fs-options] [filesys...]

Check and repair filesystems

Options:

-A Walk /etc/fstab and check all filesystems

-N Don't execute, just show what would be done

-P With -A, check filesystems in parallel

-R With -A, skip the root filesystem

-T Don't show title on startup

-V V erbose

-C n Write status information to specified filedescriptor

-t type List of filesystem types to check

fsck.minix

fsck.minix [-larvsmf] /dev/name

Check MINIX filesystem

Options:

-l List all filenames

-r Perform interactive repairs

-a Perform automatic repairs

-v V erbose

-s Output superblock information

-m Show "mode not cleared" warnings

-f Force file system check

fsync

fsync [OPTIONS] FILE...Write files' buffered blocks to disk

Options:

-d A void syncing metadata

ftpd

ftpd [-wvS] [-t N] [-T N] [DIR]

Anonymous FTP server

ftpd should be used as an inetd service. ftpd's line for inetd.conf: 21 stream tcp nowait root ftpd ftpd /files/to/serve It also can be ran from tcpsvd:

tcpsvd -vE 0.0.0.0 21 ftpd /files/to/serve

Options:

-w Allow upload

-v Log to stderr

-S Log to syslog

-t,-T Idle and absolute timeouts

DIR Change root to this directory

ftpget

ftpget [OPTIONS] HOST LOCAL_FILE REMOTE_FILE

Retrieve a remote file via FTP

Options:

-c,--continue Continue previous transfer

-v,--verbose V erbose

-u,--username Username

-p,--password Password

-P,--port Port number

ftpput

ftpput [OPTIONS] HOST REMOTE_FILE LOCAL_FILE

Store a local file on a remote machine via FTP

Options:

-v,--verbose V erbose

-u,--username Username

-p,--password Password

-P,--port Port number

fuser

fuser [OPTIONS] FILE or PORT/PROTO

Find processes which use FILEs or PORTs

Options:

-m Find processes which use same fs as FILEs

-4 Search only IPv4 space

-6 Search only IPv6 space

-s Silent: just exit with 0 if any processes are found

-k Kill found processes (otherwise display PIDs)

-SIGNAL Signal to send (default: TERM)

getopt

getopt [OPTIONS]

Options:

-a,--alternative Allow long options starting with single -

-l,--longoptions=longopts Long options to be recognized

-n,--name=progname The name under which errors are reported

-o,--options=optstring Short options to be recognized

-q,--quiet Disable error reporting by getopt(3)

-Q,--quiet-output No normal output

-s,--shell=shell Set shell quoting conventions

-T,--test Test for getopt(1) version

-u,--unquoted Don't quote the output

getty

getty [OPTIONS] BAUD_RA TE TTY [TERMTYPE]

Open a tty, prompt for a login name, then invoke /bin/login

Options:

-h Enable hardware (RTS/CTS) flow control

-i Do not display /etc/issue before running login

-L Local line, do not do carrier detect

-m Get baud rate from modem's CONNECT status message

-w Wait for a CR or LF before sending /etc/issue

-n Do not prompt the user for a login name

-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue

-l LOGIN Invoke LOGIN instead of /bin/login

-t SEC Terminate after SEC if no username is read

-I INITSTR Send INITSTR before anything else

-H HOST Log HOST into the utmp file as the hostname

grep

grep [-HhrilLnqvsoweFEABCz] PA TTERN [FILE]...

Search for PA TTERN in each FILE or standard input

Options:

-H Prefix output lines with filename where match was found

-h Suppress the prefixing filename on output

-r Recurse

-i Ignore case distinctions

-l List names of files that match

-L List names of files that do not match

-n Print line number with output lines

-q Quiet. Return 0 if PA TTERN is found, 1 otherwise

-v Select non-matching lines

-s Suppress file open/read error messages

-c Only print count of matching lines

-o Show only the part of a line that matches PA TTERN

-m MAX Match up to MAX times per file

-w Match whole words only

-F PA TTERN is a set of newline-separated strings

-E PA TTERN is an extended regular expression

-e PTRN Pattern to match

-f FILE Read pattern from file

-A Print NUM lines of trailing context

-B Print NUM lines of leading context

-C Print NUM lines of output context

-z Input is NUL terminated

gunzip

域名解析长期不稳定的解决和nslookup命令的用法

域名解析长期不稳定的解决和nslookup命 令的用法 域名故障解析ip变来变去https://www.360docs.net/doc/cc5821665.html,的域名总在两个ip之间变化。它的根域名https://www.360docs.net/doc/cc5821665.html,很稳定。 这样一来,这个域名有时就不能访问.长期如此. 通过ping 域名,发现域名对应ip地址不时变化. 用操作系统的左下角->开始->运行,输入命令ipconfig /flushdns 然后回车执行,清除本地缓存.确认与本地无关. 通过nslookup命令,溯源查错: C:\Documents and Settings\lyz>nslookup https://www.360docs.net/doc/cc5821665.html, *** Can't find server name for address 202.96.69.38: Server failed Server: https://www.360docs.net/doc/cc5821665.html, Address: 202.96.64.68 Non-authoritative answer: Name: https://www.360docs.net/doc/cc5821665.html, Address: 203.171.231.2 C:\Documents and Settings\lyz>nslookup https://www.360docs.net/doc/cc5821665.html, *** Can't find server name for address 202.96.69.38: Server failed Server: https://www.360docs.net/doc/cc5821665.html, Address: 202.96.64.68 Non-authoritative answer: Name: https://www.360docs.net/doc/cc5821665.html, Addresses: 203.171.231.2, 121.199.253.180 C:\Documents and Settings\lyz>nslookup https://www.360docs.net/doc/cc5821665.html, 202.96.64.68 Server: https://www.360docs.net/doc/cc5821665.html, Address: 202.96.64.68 Non-authoritative answer: Name: https://www.360docs.net/doc/cc5821665.html, Addresses: 121.199.253.180, 203.171.231.2 C:\Documents and Settings\lyz>nslookup -q https://www.360docs.net/doc/cc5821665.html,

常用的网络工具命令解析

如果你玩过路由器的话,就知道路由器里面那些很好玩的命令缩写。 例如,"sh int" 的意思是"show interface"。 现在Windows 2000 也有了类似界面的工具,叫做netsh。 我们在Windows 2000 的cmd shell 下,输入netsh 就出来:netsh> 提示符, 输入int ip 就显示: interface ip> 然后输入dump ,我们就可以看到当前系统的网络配置: # ---------------------------------- # Interface IP Configuration # ---------------------------------- pushd interface ip # Interface IP Configuration for "Local Area Connection" set address name = "Local Area Connection" source = static addr = 192.168.1.168 mask = 255.255.255.0 add address name = "Local Area Connection" addr = 192.1.1.111 mask = 255.255.255.0 set address name = "Local Area Connection" gateway = 192.168.1.100 gwmetric = 1 set dns name = "Local Area Connection" source = static addr = 202.96.209.5 set wins name = "Local Area Connection" source = static addr = none

busybox详解制作根文件系统

详解制作根文件系统 单击,返回主页,查看更多内容 一、FHS(Filesystem Hierarchy Standard)标准介绍 当我们在linux下输入ls / 的时候,见到的目录结构以及这些目录下的内容都大同小异,这是因为所有的linux发行版在对根文件系统布局上都遵循FHS标准的建议规定。 该标准规定了根目录下各个子目录的名称及其存放的内容: 制作根文件系统就是要建立以上的目录,并在其中建立完整目录内容。其过程大体包括: ?编译/安装busybox,生成/bin、/sbin、/usr/bin、/usr/sbin目录 ?利用交叉编译工具链,构建/lib目录 ?手工构建/etc目录 ?手工构建最简化的/dev目录 ?创建其它空目录 ?配置系统自动生成/proc目录 ?利用udev构建完整的/dev目录 ?制作根文件系统的jffs2映像文件 下面就来详细介绍这个过程。 二、编译/安装busybox,生成/bin、/sbin、/usr/bin、/usr/sbin目录

这些目录下存储的主要是常用命令的二进制文件。如果要自己编写这几百个常用命令的源程序,my god,这简直是一个噩梦!好在我们有嵌入式Linux系统的瑞士军刀——busybox,事情就简单很多。 1、从https://www.360docs.net/doc/cc5821665.html,/下载busybox-1.7.0.tar.bz2 2、tar xjvf busybox-1.7.0.tar.bz2解包 3、修改Makefile文件 175 ARCH ?= arm 176 CROSS_COMPILE ?= arm-linux- 4、make menuconfig配置busybox busybox配置主要分两部分。 第一部分是Busybox Settings,主要编译和安装busybox的一些选项。这里主要需要配置:

CAD常用命令汇总及详解

CAD中有哪些命令?我们可以把它们分为几类。一类是绘图类,二类是编辑类,三类是设置类,四类是其它类,包括标注、视图等。我们依次分析。 第一类,绘图类。常用的命令有: Line 直线 Xline 构造线 mline 双线 pline 多义线 rectang 矩形 arc 圆弧 circle 圆 hatch 填充 boundary 边界 block 定义块 insert 插入快 第二类,编辑类。常用的命令有: Matchprop 特性匹配 Hatchedit 填充图案编辑 Pedit 多义线编辑 Erase 擦除 Copy 拷贝 Mirror 镜像 Offset 平移 Array 阵列 Move 移动 Rotate 旋转 Scale 缩放 Stretch 拉伸 Lengthen 拉长 Trim 裁减 Extend 延伸 Break 打断 Fillet 倒圆角 Explode 炸裂 Align 对齐 Properties 属性

绘图工具栏: 直线(L):全称(line) 在屏幕上指定两点可画出一条直线。也可用相对坐标 或者在正交模式打开的情况下,直接给实际距离鼠标拖动来控制方向 构造线(XL):全称(xline) H为水平V为垂直O为偏移A为角度B为等分一个角度。 多段线(PL):全称(pline) 首先在屏幕上指定一点,然后有相应提示: 指定下一个点或[圆弧(A)/半宽(H)/长度(L)/放弃(U)/宽度(W)]。可根据需要来设置。 其中“圆弧”指定宽度可画任意角度圆弧;“半宽”指多段线的一半宽度,即如要高线宽为10,则5;“长度”给相应的值,则画出相应长度的多段线;“放弃”指放弃一次操作;“宽度”指多段线的宽度 多边形(pol):全称(polygon) 所绘制多边形为正多边形,边数可以自己设 E:根据边绘制多边形也可根据圆的半径利用外切和内接来画正多边形 矩形(REC):全称(rectang) 点击矩形工具后出现下列提示: 指定第一个角点或[倒角(C)/标高(E)/圆角(F)/厚度(T)/宽度(W)] 其中“倒角”是将90度直角的两条边割去一点。变成一个斜角。“标高”是空间上的意义可以在三视图当中展现出来,标高是相对的;“圆角”:即是将四个直角边倒成半径为X的圆角;“厚度”:空间上的意义,可在Z轴上表现出来“宽度”:平面空间的概念,指矩形四边的宽度。 圆弧(ARC或A):默认为3点画圆弧,成弧方向为逆时针,画优弧半径给负值。绘图菜单中有如下选项: 起点、圆心、端点; 起点、圆心、角度; 起点、圆心、长度; 起点、端点、角度; 起点、端点、方向; 起点、端点、半径; 圆心、起点、端点; 圆心、起点、角度; 圆心、起点、长度;

BusyBox简化嵌入式Linux系统

BusyBox 简化嵌入式Linux 系统 BusyBox 的诞生 BusyBox 最初是由Bruce Perens 在1996 年为Debian GNU/Linux 安装盘编写的。其目标是在一张软盘上创建一个可引导的GNU/Linux 系统,这可以用作安装盘和急救盘。一张软盘可以保存大约 1.4-1.7MB 的内容,因此这里没有多少空间留给Linux 内核以及相关的用户应用程序使用。 BusyBox 许可证 BusyBox 是按照GNU General Public License(GPL)许可证发行的。这意味着如果我们在一个项目中使用BusyBox,就必须遵守这个许可证。我们可以在BusyBox Web 站点(请参看本文后面参考资料一节的内容)上看到这个许可证的内容。BusyBox 团队似乎正忙于监视违反这个许可证的情况。实际上,他们维护了一个“Hall of Shame” 页面来说明违反者的情况。 BusyBox 揭露了这样一个事实:很多标准Linux 工具都可以共享很多共同的元素。例如,很多基于文件的工具(比如grep和find)都需要在目录中搜索文件的代码。当这些工具被合并到一个可执行程序中时,它们就可以共享这些相同的元素,这样可以产生更小的可执行程序。实际上,BusyBox 可以将大约3.5MB 的工具包装成大约200KB 大小。这就为可引导的磁盘和使用Linux 的嵌入式设备提供了更多功能。我们可以对 2.4 和 2.6 版本的Linux 内核使用BusyBox。 BusyBox 是如何工作的? 为了让一个可执行程序看起来就像是很多可执行程序一样,BusyBox 为传递给 C 的main 函数的参数开发了一个很少使用的特性。回想一下 C 语言的main 函数的定义如下: POSIX 环境 尽管 BusyBox 的目标是提供一个相当完整的 POSIX(可移植操作系统接口)环境,这是一个期望,而不是一种需求。这些工具虽然并不完整,但是它们提供了我们期望的主要功能。 清单 1. C 的main 函数 int main( int argc, char *argv[] ) 在这个定义中,argc是传递进来的参数的个数(参数数量),而argv是一个字符串数组,代表从命令行传递进来的参数(参数向量)。argv的索引 0 是从命令行调用的程序名。 清单 2 给出的这个简单 C 程序展示了BusyBox 的调用。它只简单地打印argv向量的内容。 清单 2. BusyBox 使用argv[0]来确定调用哪个应用程序 // test.c #include int main( int argc, char *argv[] ) {

Nslookup命令详解 (域名DNS诊断)

Nslookup显示可用来诊断域名系统(DNS)基础结构的信息。只有在已安装TCP/IP 协议的情况下才可以使用Nslookup 命令行工具。 语法 nslookup [-option][hostname][server] Nslookup 有两种模式: 交互式和非交互式。 要随时中断交互式命令,请按CTRL+C。 要退出,请键入exit。 要将内置命令当作计算机名,请在该命令前面放置转义字符(\) 如果查找请求失败,nslookup 将打印错误消息。下表列出可能的错误消息。错误消息说明 Timed out 重试一定时间和一定次数之后,服务器没有响应请求。可以通过set timeout 子命令设置超时期。而利用set retry 子命令设置重试次数。 No response from server 服务器上没有运行DNS 名称服务器。 No records 尽管计算机名有效,但是DNS 名称服务器没有计算机当前查询类型的资源记录。查询类型使用set querytype 命令指定。 Nonexistent domain 计算机或DNS 域名不存在。 Connection refused or Network is unreachable 无法与DNS 名称服务器或指针服务器建立连接。该错误通常发生在ls 和finger 请求中。 Server failure DNS 名称服务器发现在其数据库中内部不一致而无法返回有效应答。

Refused DNS 名称服务器拒绝为请求服务。 Format error DNS 名称服务器发现请求数据包的格式不正确。可能表明nslookup 中存在错误。 范例 每个命令行选项均由连字符(-)后紧跟命令名组成,有时是等号(=)后跟一个数值。例如,要将默认的查询类型更改为主机(计算机)信息,并将初始超时更改为10秒,请键入: nslookup -querytype=hinfo-timeout=10 概要 Nslookup.exe 是命令行管理工具,用于测试或解决DNS 服务器问题。此工具是通过“控制面板”与TCP/IP 协议一起安装的。本文包含使用Nslookup.exe 的若干提示。 更多信息 要使用Nslookup.exe,请注意以下方面: ?TCP/IP 协议必须安装在运行Nslookup.exe 的计算机上。 ?在Microsoft TCP/IP 属性页的DNS 选项卡的“DNS服务搜索顺序”字段中必须至少指定一个DNS 服务器。 ?如果已经使用Microsoft TCP/IP 属性页DNS 选项卡上定义的“域后缀搜索顺序”(Domain Suffix Search order )中的搜索列表,将不会发生抽取操作。查询将被附加到列表中指定的域后缀中。要避免使用搜索列表,请始终使用“完全合格的域名称”(即,在名称中添加尾随点)。 Nslookup.exe 可以在两种模式下运行:

Linux常用命令详解(配合示例说明,清晰易懂)

Linux常用命令详解 (常用、详细) BISTU 自动化学院 刷碗小工(frisen.imtm) 2010年11月 开源社区,造福大家,版权所有,翻录不究(初次接触Linux命令可能对以下说明有不少疑问,可待看完一遍后再回头细看) (配合Ctrl + F可快速查找你想了解的命令)

索引:(待完善) 文件说明:Linux命令很多,但最常用的80个左右 文档内容充实,用示例说明命令如何使用笔者力求语言简洁,清晰易懂 由于忙于其他事情,改进排版的工作只能搁置了 最后,望此文档能为大家Linux学习之路献微薄之力 一、路径: 执行命令前必须要考虑的一步是命令的路径,若是路径错误或是没有正确的指定,可能导致错误的执行或是找不到该命令。要知道设置的路径,可执行以下命令: 一般而言,本书的命令位于/bin、usr/bin、/sbin、/usr/sbin之中。若读者执行了命令却出现“command not find”或是“命令不存在”的字样,就必须要确定该命令的位置是否在命令的路径中,或是系统上根本没有安装该套件。 二、命令顺序: 若在shell内置的命令/bin以及/usr/bin之下都出现了命令pwd,那当我们执行该命令时,会执行哪一个?答案是第一优先执行shell内置的命令,再执行路径中的设置;因此若有相同名称的命令时,必须要注意顺序设置,或是直接输入完整路径。 三、参数(或称选项)顺序: 一般除了特殊情况,参数是没有顺序的。举例而言,输入“–a –v”与输入“–v –a”以及“–av”的执行效果是相同的。但若该参数后指定了要接的文件或特殊对象,如“–a cmd1 –v cmd2”,则不能任意改变选项顺序。 四、常用参数: 下面所列的是常见的参数(选项)意义: --help,-h 显示帮助信息 --version,-V 显示版本信息 -v 繁琐模式(显示命令完整的执行过程) -i 交谈模式(指定界面) -l 长列表输出格式 -q,-s 安静模式(不显示任何输出或错误信息) -R 递归模式(连同目录下所有文件和子目录一起处理) -z 压缩 五、命令的结合与定向: 命令中除了一般命令外,还有管道(或称途径)(|)与定向(>或>>)。 管道(途径)的用法: “命令一[选项]”| “命令二[选项]”,也就是将“命令一[选项]”的输出结果传到“命令二[选项]”,通过命令二的处理之后才输出到标准输出(屏幕)上。比如“ls /etc”会列出etc下的所有文件,若加上“| less”,也就是“ls /etc | less”,则会将“ls /etc”的结果通过less分页输出。 定向的用法: 将结果定向到命令的输出设备,一般不加文件名意为将结果输出到屏幕,若是在定向后加上文件名,则会将命令的执行结果输出到定向的文件,例如“ls > temp.txt”,就会将ls 的结果输出到文件temp.txt中。“>”与“>>”的差异在于前者是覆盖,而后者是附加。 六、命令中的命令: 许多命令在执行后,会进入该命令的操作模式,如fdisk、pine、top等,进入后我们必须要使用该命令中的命令,才能正确执行;而一般要退出该命令,可以输入exit、q、quit或是按【Ctrl+C】组合

基于busybox的根文件系统制作

龙源期刊网 https://www.360docs.net/doc/cc5821665.html, 基于busybox的根文件系统制作 作者:李飞,武金虎,石颖博 来源:《电脑知识与技术》2010年第17期 摘要:Busybox是构建嵌入式Linux文件系统的必备软件,它是所有文件和设备节点的起始点,是决定系统能否正常启动的关键。通过busybox-1.1.3为例,进行配置、编译、安装等过程,从而形成简单的根文件系统映像文件,为以后嵌入式Linux系统的移植打下了良好的开端。 关键词:Busybox;嵌入式Linux;Linux操作系统;根文件系统;cramfs 文件系统 中国分类号:TP316.81文献标识码:A文章编号:1009-3044(2010)17-4655-02 Making Root File System Based on Busybox LI Fei, WU Jin-hu, SHI Ying-bo (College of Computer Science and Information, Guizhou University, Guiyang 550025, China) Abstract: Busybox is an essentiaL software to buiLd an embedded Linux fiLe system. It is the starting node point of aLL the fiLes and devices and the key whether the system can have a normaL start. Taking busybox-1.1.3 for exampLe, making a simpLe root image system fiLe by configuration compiLation and instaLLation Lays a good foundation for migration of the embedded Linux system. Key words: busybox; embedded linux; Linux OS; root file system; cramfs file system 1 根文件系统结构 根文件系统是所有文件和设备节点的起始点,包括系统所必须的各种工具软件、库文件、 脚本、配置文件等一系列的文件。一个基本的Linux根文件系统包含有以下的目录:dev、proc、bin、etc、usr、Lib、temp、var、usr等等目录。其中dev是设备文件节点目录,proc是挂载proc文件系统所用的目录,bin目录下面包含了系统的基本命令,etc目录是系统启动脚本所在的目录,Lib是系统默认的动态链接库目录,usr是用户目录,temp是临时目录,用来保存临时文 件,var目录包含系统运行时要改变的数据。以上都是根文件系统所必须的目录 2 Busybox简介 熟练嵌入式Linux的朋友对busybox一定不会陌生,它是标准Linux工具的一个单个可执行实现,被形象的称为嵌入式Linux系统中的“瑞士军刀”,因为它将许多常用的UNIX工具和命令 结合到一个单独的可执行程序中。虽然busybox中的这些工具相对于GNU常用工具功能有所

常用命令CAT详解

Unix常用命令cat详解 这个命令可不是“猫”的意思,而是catenate的缩写。顾名思义,是把东西串起来。比如:cat file1 file2 就是把文件file1和file2连在一起,然后输出到屏幕上。注意,输出到屏幕上是cat的自定义目的。如果要改变它的输出方向,就必须使用Unix操作系统系统的输出重定向符"",""输出重定向符。稍微高级一点的dos用户都知道这个符号。在Unix操作系统里的用法同Dos的区别不是很大。但比较不同的地方是,Unix操作系统系统将任何的一个外设都认同为一个文件。 所以如果你要将输出重定向到打印机之类的地方,只要写上代表打印机的设备文件名。前一章里我们曾讲过终端机器名,它也是一个文件。比方我的设备机器是ttya,而小李的设备机器是ttyb,他想让我把当前目录的内容给他看。那么用这条命令就可以了ls -a-u-F ttyb。这充分利用了Unix操作系统系统多用户的设计思想。 同样的使用ls -a-u-Ffile1就是将当前Unix操作系统目录列表输出到file1中。 又比如:cat file1 file2file3 就是将文件file1和file2的内容输出到file3中。在Dos里这条命令被写成copy file1+file2 file3 当你用''来输出重定向的时候,Unix操作系统马上打开一个空文件来准备存放''之前那个文件命令的输出结果。比如: cat file1 file2file3 系统先将file3的内容清空。所以:cat file1 file2file1这条命令将产生一个错误提示。也许这条命令的本意是增加file1里的内容,但在系统初始这条命令的时候就把file1里的内容清空了。所以你得到一个错误提示。如果要追加文件内容请使用以下命令:cat file2file1""表示追加,而不是先清空file1中的内容。 Unix常用命令cat命令格式参数 命令:cat 使用权限:所有使用者 使用方式:cat [-AbeEnstTuv] [--help] [--version] fileName 说明:把档案串连接后传到基本输出(萤幕或加fileName 到另一个档案) 参数: -n 或--number 由1 开始对所有输出的行数编号 -b 或--number-nonblank 和-n 相似,只不过对于空白行不编号 -s 或--squeeze-blank 当遇到有连续两行以上的空白行,就代换为一行的空白行-v 或--show-nonprinting

busybox简介及使用

busybox简介及使用 :2006-11-27作者:acsbor来自:cublog 1,busybox简介 busybox是一个集成了一百多个最常用linux命令和工具的软件,他甚至还集成了一个http服务器和一个telnet服务器,而所有这一切功能却只有区区1M左右的大小.我们平时用的那些linux命令就好比是分立式的电子元件,而busybox就好比是一个集成电路,把常用的工具和命令集成压缩在一个可执行文件里,功能基本不变,而大小却小很多倍,在嵌入式linux应用中,busybox有非常广的应用,另外,大多数linux发行版的安装程序中都有busybox的身影,安装linux的时候案ctrl+alt+F2就能得到一个控制台,而这个控制台中的所有命令都是指向busybox的链接. Busybox的小身材大作用的特性,给制作一张软盘的linux带来了及大方便. 2,busybox的用法 可以这样用busybox #busybox ls 他的功能就相当运行ls命令 最常用的用法是建立指向busybox的链接,不同的链接名完成不同的功能. #ln -s busybox ls #ln -s busybox rm #ln -s busybox mkdir 然后分别运行这三个链接: #./ls #./rm #./mkdir 就可以分别完成了ls rm 和mkdir命令的功能.虽然他们都指向同一个可执行程序busybox 但是只要链接名不同,完成的功能就不同,busybox就是这么的神奇.

很多linux网站都提供busybox的源代码下载.目前版本是busybox1.0正式版. 3,配置busybox busybox的配置程序和linux内核菜单配置方式简直一模一样.熟悉用make menuconfig方式配置linux内核的朋友很容易上手. #cp busybox-1.00.tar.gz /babylinux #cd /babylinux #tar xvfz busybox-1.00.tar.gz #cd busybox-1.00 #make menuconfig 下面是需要编译进busybox的功能选项,其他的可以根据需要自选,但是同样不要太贪心. General Configuration应该选的选项 Show verbose applet usage messages Runtime SUID/SGID configuration via /etc/busybox.conf Build Options Build BusyBox as a static binary (no shared libs) 这个选项是一定要选择的,这样才能把busybox编译成静态链接的可执行文件,运行时才独立于其他函数库.否则必需要其他库文件才能运行,在单一个linux内核不能使他正常工作. Installation Options Don't use /usr 这个选项也一定要选,否则make install 后busybox将安装在原系统的/usr下,这将覆盖掉系统原有的命令.选择这个选项后,make install后会在busybox目录下生成一个叫_install的目录,里面有busybox和指向他的链接. 其他选项都是一些linux基本命令选项,自己需要哪些命令就编译进去,一般用默认的就可以了. 配置好后退出并保存.

实验3_使用Wireshark分析DNS协议

实验八利用Wireshark分析DNS协议 一、实验目的 分析DNS协议 二、实验环境 与因特网连接的计算机,操作系统为Windows,安装有Wireshark、IE等软件。三、实验步骤 nslookup工具允许运行该工具的主机向指定的DNS服务器查询某个DNS记录。如果没有指明DNS服务器,nslookup将把查询请求发向默认的DNS服务器。其命令的一般格式是: nslookup –option1 –option2 host-to-find dns-server 1、打开命令提示符(Command Prompt),输入nslookup命令。 图中显示三条命令,第一条命令:nslookup https://www.360docs.net/doc/cc5821665.html,“提出一个问题” 即:“将主机https://www.360docs.net/doc/cc5821665.html,的IP地址告诉我”。屏幕上出现了两条信息:(1)“回答这一问题”DNS服务器的名字和IP地址;(2)https://www.360docs.net/doc/cc5821665.html,主机名字和IP地址。

第二条命令:nslookup –type=NS https://www.360docs.net/doc/cc5821665.html, 在这个例子中,我们提供了选项“-type=N S”,域为https://www.360docs.net/doc/cc5821665.html,。执行这条命令后,屏幕上显示了DNS服务器的名字和地址。接着下面是三个MIT DNS服务器,每一个服务器是MIT校园里权威的DNS服务器。 第三条命令:nslookup www.aiit.or.kr https://www.360docs.net/doc/cc5821665.html, 在这个例子中,我们请求返回https://www.360docs.net/doc/cc5821665.html, DNS server 而不是默认的DNS服务器(https://www.360docs.net/doc/cc5821665.html,)。此例中,DNS 服务器https://www.360docs.net/doc/cc5821665.html,提供主机www.aiit.or.kr 的IP地址。 2、ipconfig ipconfig用来显示TCP/IP 信息, 你的主机地址、DNS服务器地址,适配器等信息。如果你想看到所有关于你所在主机的信息,可在命令行键入: ipconfig /all ipconfig在管理主机所储存的DNS信息非常有用。 如果查看DNS缓存中的记录用命令:ipconfig /displaydns 要清空DNS缓存,用命令:ipconfig /flushdns 3、利用Wireshark捕获DNS信息 (1)利用ipconfig命令清空你的主机上的DNS缓存。

常用命令解析2

名称:/etc/aliases 使用权限:系统管理者 使用方式:请用newaliases 更新资料库 说明: sendmail 会使用一个在/etc/aliases 中的档案做使用者名称转换的动作。当sendmail 收到一个要送给xxx 的信时,它会依据aliases档的内容送给另一个使用者。这个功能可以创造一个只有在信件系统内才有效的使用者。例如mailing list 就会用到这个功能,在mailinglist 中,我们可能会创造一个叫redlinux@https://www.360docs.net/doc/cc5821665.html, 的mailinglist,但实际上并没有一个叫redlinux 的使用者。实际aliases 档的内容是将送给这个使用者的信都收给mailing list 处理程式负责分送的工作。 /etc/aliases 是一个文字模式的档案,sendmail 需要一个二进位格式的/etc/aliases.db。newaliases 的功能传是将/etc/aliases 转换成一个sendmail 所能了解的资料库。范例: # newaliases 下面命令会做相同的事, # sendmail -bi 相关命令: mail, mailq, newaliases, sendmail 名称:mail 使用权限:所有使用者 使用方式:mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] user1 [user 2 ...] 说明: mail 不仅只是一个指令,mail 还是一个电子邮件程式,不过利用mail 来读信的人应该很少吧!对于系统管理者来说mail 就很有用,因为管理者可以用mail 写成script ,定期寄一些备忘录提醒系统的使用者。 参数: i 忽略tty 的中断讯号。(interrupt) I 强迫设成互动模式。(Interactive) v 列印出讯息,例如送信的地点、状态等等。(verbose) n 不读入mail.rc 设定档。 s 邮件标题。 c cc 邮件地址。 b bc c 邮件地址。 范例: 将信件送给一个或以上的电子邮件地址,由于没有加入其他的选项,使用者必须输入标题与信件的内容等。而user2 没有主机位置,就会送给邮件伺服器的user2 使用者。 mail user1@email.address mail user1@email.address user2 将mail.txt 的内容寄给user2 同时cc 给user1 。如果将这一行指令设成cronjob 就可以定时将备忘录寄给系统使用者。 mail -s 标题-c user1 user2 < mail.txt 名称:mesg 使用权限: 所有使用者 使用方式: mesg [y|n]

Busybox 裁剪

因为原先板子上的busybox大小接近2MB,包含的东西太多,现在又需要把系统裁到16 MB了, 并且原来是static编译的, 并且/lib中存在uclibc库, 应用程序也需要使用, 浪费了。 所以决定重新对busybox进行裁剪,编译为动态链接库,初步估计能省下1.5 MB的宝贵空间。 步骤: 1. 解压 2. 修改Makefile 的CROSS_COMPILE 3. 根据产品需求配置 make menuconfig 生成的.config文件如下: # # Automatically generated make config: don't edit # Busybox version: 1.12.1 # Sat Oct 11 14:04:08 2008 # CONFIG_HAVE_DOT_CONFIG=y # # Busybox Settings # # # General Configuration # # CONFIG_DESKTOP is not set # CONFIG_EXTRA_COMPAT is not set CONFIG_FEATURE_ASSUME_UNICODE=y CONFIG_FEATURE_BUFFERS_USE_MALLOC=y # CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set # CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set CONFIG_SHOW_USAGE=y # CONFIG_FEATURE_VERBOSE_USAGE is not set # CONFIG_FEATURE_COMPRESS_USAGE is not set CONFIG_FEATURE_INSTALLER=y # CONFIG_LOCALE_SUPPORT is not set CONFIG_GETOPT_LONG=y # CONFIG_FEATURE_DEVPTS is not set CONFIG_FEATURE_CLEAN_UP=y # CONFIG_FEATURE_PIDFILE is not set CONFIG_FEATURE_SUID=y # CONFIG_FEATURE_SUID_CONFIG is not set # CONFIG_FEATURE_SUID_CONFIG_QUIET is not set # CONFIG_SELINUX is not set

nslookup命令用法

nslookup命令用法2007-01-19 00:46nslookup命令用法gl Dq\& x 1.查询A记录H sA L` }O C:\>nslookup https://www.360docs.net/doc/cc5821665.html, =(Ka 3! nslookup -type=mx https://www.360docs.net/doc/cc5821665.html, t#(U+ ;%!w *** Can't find server name for address 192.168.2.1: Non-existent domain /8 l#+ L, *** Default servers are not available MH 9 << Server: UnKnown FTG<1x"W L Address: 192.168.2.1 { !@4 v Non-authoritative answer: d7a r0 https://www.360docs.net/doc/cc5821665.html, MX preference = 8, mail exchanger = https://www.360docs.net/doc/cc5821665.html, X\g h #7 . https://www.360docs.net/doc/cc5821665.html, nameserver = https://www.360docs.net/doc/cc5821665.html, ,sS TW O https://www.360docs.net/doc/cc5821665.html, internet address = 61.129.102.61 +]b-%~s@ F https://www.360docs.net/doc/cc5821665.html,是https://www.360docs.net/doc/cc5821665.html,对应的MX记录. 2vkOwS |{_ 3.查CNAME记录d* B (V[ C:\>nslookup -type=cname https://www.360docs.net/doc/cc5821665.html, |X]?$ ~5y; *** Can't find server name for address 192.168.2.1: Non-existent domain fT* )E0s7 *** Default servers are not available g|{2PlnWq Server: UnKnown 2s(WL^ :$ Address: 192.168.2.1 CaB` x%tE Non-authoritative answer: ! %1 [ https://www.360docs.net/doc/cc5821665.html, canonical name = https://www.360docs.net/doc/cc5821665.html, @n } Y ih https://www.360docs.net/doc/cc5821665.html,是https://www.360docs.net/doc/cc5821665.html,对应的CNAME记录. UE .nslookup -type=ns https://www.360docs.net/doc/cc5821665.html, <]43,%[gc *** Can't find server name for address 192.168.2.1: Non-existent domain k# m bR%o *** Default servers are not available M4 @H*Nm Server: UnKnown vk /\ w$9 Address: 192.168.2.1 pp 4! GD; Non-authoritative answer: 8_A dXipw https://www.360docs.net/doc/cc5821665.html, nameserver = https://www.360docs.net/doc/cc5821665.html, J2V O 9^#b https://www.360docs.net/doc/cc5821665.html, internet address = 61.129.102.61 &6A= 8+ 0 https://www.360docs.net/doc/cc5821665.html,是https://www.360docs.net/doc/cc5821665.html,域名的DNS服务器. 5:G PAT- C 5.指定域名服务器查询结果. zq@PWY iE`& C:\>nslookup https://www.360docs.net/doc/cc5821665.html, 202.102.128.68 S CK0 q& Server: https://www.360docs.net/doc/cc5821665.html, }]ib/q/ w

Nslookup命令详解

Nslookup 是一个监测网络中DNS 服务器是否能正确实现域名解析的命令行工具。只有在已安装TCP/IP 协议的情况下才可以使用Nslookup 命令行工具。 语法: nslookup [-opt ...] #使用默认DNS进入交互模式。 nslookup [-opt ...] – server #使用指定DNS进入交互模式。 nslookup [-opt ...] host #使用默认DNS查询host。 nslookup [-opt ...] host server #使用指定DNS查询host。 参数: -opt ... : 将一个或多个nslookup 子命令指定为命令行选项。 例: C:\>nslookup https://www.360docs.net/doc/cc5821665.html, Server: https://www.360docs.net/doc/cc5821665.html, Address: 10.0.0.1 Non-authoritative answer: Name: https://www.360docs.net/doc/cc5821665.html, Addresses: 61.135.169.125, 61.135.169.105

61.135.169.125, 61.135.169.105是https://www.360docs.net/doc/cc5821665.html,对应的IP地址. 交互式模式: 要在交互模式下启动Nslookup.exe,只需在命令提示符下输入nslookup: C:\> nslookup Default Server: https://www.360docs.net/doc/cc5821665.html, Address: 10.0.0.1 > 在命令提示符下输入help 或? 将生成可用的命令列表。在命令提示符下输入的任何内容,如果它不是有效命令,则假设它是主机名,尝试使用默认服务器来解析它。要中断交互命令,请按CTRL+C。要退出交互模式并返回到命令提示符下,并在命令提示符下输入exit。 以下是帮助输出,其中包含选项的完整列表: Commands: (identifiers are shown in uppercase, [] means optional) NAME - print info about the host/domain NAME using default server NAME1 NAME2 - as above, but use NAME2 as server help or ? - print info on common commands set OPTION - set an option all - print options, current server and host [no]debug - print debugging information

UG8.5新功能和常用命令解析2014

Design UG(Unigraphics NX) 高级设计解决方案帮助您制定更明智的决策

NX 设计NX 设计:优势和益处 高级设计解决方案帮助您制定更明智的决策 NX 设计是有助于您开发创新型新产品的集成解决方案。NX 采用前沿设计工具和技术,能够简化和加快产品开发过程。 与仅支持CAD 的解决方案和封闭型企业解决方案不同,NX 能够在开放型协同环境中的开发部门之间提供最高级集成。 Design Advantages 快速、灵活、高效的产品设计 NX 设计工具拥有强大的能力、丰富的功能和极高的生 产效率。您能够以更快的速度和更高的效率完成各种 类型的设计任务,涵盖从2D 布局到3D 建模、装配设 计、制图和文档记录的各个方面。 . 无缝利用来自其他CAD 系统的数据 通过同步建模技术,NX 让您能够直接使用其他CAD 系统创建的模型。您可以快速、轻松、高效地导入和 修改来自任何来源的CAD 几何体。NX 解决方案是多 CAD 协同设计的理想之选。

NX 设计 依托强大的功能处理复杂的产品 NX 装配设计工具已为最复杂的装配做好准备,即使面对具有数千个零件的装配,也能从容应对。您可以利用NX 创建完整的多CAD 数字样机,从而快速识别和解决问题。 . 集成设计验证 为了帮助您满足客户和工程师的要求,NX 提供了自动化集成设计验证功能。您可以持续监控设计是否符合公司和行业标准,更轻松地交付实现自身目标、满足客户要求的设计。 . 可视化分析改善了决策流程 借助NX 可视化报告和分析,您可以即时收集产品和流程信息,在3D 设计环境中呈现这些信息所产生的影响。PLM 数据可视化合成能够加快设计流程,改善决策水平。 .

相关文档
最新文档