BusyBox (en)

Aus Gemini-Wiki
Wechseln zu: Navigation, Suche
Deutsch.png - in Deutsch English.png - in English
BusyBox Logo

This article is about the basics of the Busybox and the most used commands. Feel free to add new commands...

Inhaltsverzeichnis

BusyBox

The Busybox includes all known commands of the Dreambox.
To have a closer look at them, first connect via Telnet, as described in chapter Telnet

Start Telnet, which may look like that:

Dreambox-konsole.jpg

Here we use the command "busybox", which gives us
all known Linux commands, which are supported by the Dreambox.

Busybox.jpg

Commands - what is the found command good for?

The purpose or usage of a command can easily be found out by using the
option "-h" or "-help"

If you are stuck and the shell is frozen, simply use Ctrl + c to exit

The command "chmod -help" for instance leads to:

root@dm800:~# chmod -help
BusyBox v1.01 (2008.11.26-20:45+0000) multi-call binary
 
Usage: chmod [-R] 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      Changes files and directories recursively.

The command "grep -h" for instance leads to:

root@dm800:~# grep -h
BusyBox v1.01 (2008.11.26-20:45+0000) multi-call binary
 
Usage: grep [-ihHnqvs] PATTERN [FILEs...]
 
Search for PATTERN in each FILE or standard input.
 
Options:
        -H      prefix output lines with filename where match was found
        -h      suppress the prefixing filename on output
        -i      ignore case distinctions
        -l      list names of files that match
        -n      print line number with output lines
        -q      be quiet. Returns 0 if result was found, 1 otherwise
        -v      select non-matching lines
        -s      suppress file open/read error messages

Important shell commands

passwd

passwd changes the passwords for user- and group accounts. A normaluser may only change his password, a superuser max change the passwords of all accounts. The administrator of a group may change the password of this group. passwd may also change the accountinformation like comment, loginshell or password-lease-time and -intervall

init 4

init 4 may change the runlevel. By calling this command init sends a stopsignal to all processes who are not defined for the new runlevel. After that the processes are "killed" and the processes for the new runlevel, who are not running yet are started. This command is especially useful at Enigma2 boxes
when system has crashed or hung up or we'd like to know something about the actions of the Enigma2 system.

init 3

init 3 restarts Enigma2 after init 4.

enigma2

enigma2 also restarts the enigma2 like init 3 after init 4 but you can follow each step in the shell and find errors easier.

More commands

cat: is used for view files and its content
(e.g.: cat /etc/resolv.conf)


cp: is used for copying files at the box.
(e.g.: cp /tmp/DATEINAME /etc/) First name origin directory, then name target directory.


mv: means "move" and is used for moving / renaming
(e.g.: mv /etc/TESTNAME /etc/TESTNAME_NEU)


fdisk: partitioning program


mkfs: is used for formatting


fsck: command for file system checks


chmod: change of data attributes (access rights).
(e.g.: chmod 755 /usr/bin/mc).
Command makes the file mc executable.


mc: is a file manager, who is already installed on the Dreambox.


free: see memory usage (RAM)


df -h: see memory usage (storage devices)


grep: filter output (files or pipes) for characters/strings.
Examples:

  1. grep "http" /etc/services, to show the lines from the file (/etc/services) which contain http.
  2. grep -v "^#\|^$" /etc/services, to show the file (/etc/services) without (-v) comments (^#) and (\|) without (-v) empty lines (^$). ^ stands for the beginning of the line and $ for the end.


find . | grep FILENAME: is the command to find a file


exportfs -v shows the shares of the NFS Server, example:

root@dm8000:~# exportfs -v
/media/hdc1     192.168.0.0/255.255.255.0(rw,async,wdelay,root_squash,all_squash,anonuid=0,anongid=0)
root@dm8000:~#
Example of output for route
Example of output for ifconfig

vi FILENAME to edit a file directly on the box
The manual of VI (which is realy needed ;-)) can be found at http://www.my-space.li/schule/editor_VI.pdf


date: show the date and time, or set it manually.


rdate: set the date and time over the Time Protocol.


IPKG list | grep dvb-modules is the command to show the dvb-modul (driver version).


IPKG list | grep secondstage is the command to show the version of the secondstage.


route is the command to set/show netzwork routes. With route -n the standard gateway is shown in the last line.


ifconfig is the command to set/show the network parameters. With ifconfig the IP Adress, Hardware adress, transmitted data volume etc. is shown.


opkg update && opkg upgrade is the command to reload the package sources and to update the box via Telnet ...

Tips and Tricks

Colorized display

With the OE 2.0 / OE 2.2 based images from DMM the list from the ls command is not colorized. The colorized display in the shell can be activated with following commands (via Telnet or SSH).

echo 'alias ls="ls --color"' >> ~/.profile
 
source ~/.profile

Continuative links and information

BusyBox on Wikipedia

Project home page

More information and usage examples about the shell commands max be found at different Dreamboxboards or Linuxboards or Wikis, HowTo`s and books.

Here a Link to the IHAD board to a PDF with a summary of different linux commands [1] as well as a link for simple Unix commands [2]