BusyBox (en): Unterschied zwischen den Versionen

Aus Gemini-Wiki
Zur Navigation springen Zur Suche springen
 
(10 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 5: Zeile 5:
 
[[Datei:BusyBoxLogo.png|right|thumb|BusyBox Logo]]
 
[[Datei:BusyBoxLogo.png|right|thumb|BusyBox Logo]]
 
This article is about the basics of the Busybox and the most used commands. Feel free to add new commands...
 
This article is about the basics of the Busybox and the most used commands. Feel free to add new commands...
=== BusyBox ===
+
== BusyBox ==
 
The [http://en.wikipedia.org/wiki/BusyBox Busybox] includes all known commands of the Dreambox.<br />
 
The [http://en.wikipedia.org/wiki/BusyBox Busybox] includes all known commands of the Dreambox.<br />
 
To have a closer look at them, first connect via Telnet, as described in chapter [[Telnet (en)|Telnet]]<br />
 
To have a closer look at them, first connect via Telnet, as described in chapter [[Telnet (en)|Telnet]]<br />
Zeile 22: Zeile 22:
 
<br />
 
<br />
  
=== Commands - what is the found command good for? ===
+
== Commands - what is the found command good for? ==
 
The purpose or usage of a command can easily be found out by using the<br />
 
The purpose or usage of a command can easily be found out by using the<br />
 
option "<code>-h</code>" or "<code>-help</code>"
 
option "<code>-h</code>" or "<code>-help</code>"
Zeile 77: Zeile 77:
 
'''cat:''' is used for view files and its content <br />(e.g.:''' cat /etc/resolv.conf''')  
 
'''cat:''' is used for view files and its content <br />(e.g.:''' cat /etc/resolv.conf''')  
  
+
 
 
'''cp:''' is used for copying files at the box.<br />
 
'''cp:''' is used for copying files at the box.<br />
 
(e.g.: cp /tmp/DATEINAME /etc/)
 
(e.g.: cp /tmp/DATEINAME /etc/)
Zeile 93: Zeile 93:
  
  
'''fsck:''' command for file system checks
+
'''[[fsck (en)|fsck:]]''' command for file system checks
  
 
   
 
   
Zeile 102: Zeile 102:
 
   
 
   
 
'''[[Midnight Commander|mc:]]''' is a file manager, who is already installed on the Dreambox.
 
'''[[Midnight Commander|mc:]]''' is a file manager, who is already installed on the Dreambox.
 +
  
 
'''free:''' see memory usage (RAM)
 
'''free:''' see memory usage (RAM)
Zeile 109: Zeile 110:
  
 
   
 
   
'''find . | grep FILENAME:''' command for finding a file
+
'''grep:''' filter output (files or pipes) for characters/strings.<br />
 +
Examples:
 +
# <tt>grep "http" /etc/services</tt>, to show the lines from the file (<tt>/etc/services</tt>) which contain <tt>http</tt>.
 +
# <tt>grep -v "^#\|^$" /etc/services</tt>, to show the file (<tt>/etc/services</tt>) without (<tt>-v</tt>) comments (<tt>^#</tt>) and (<tt>\|</tt>) without (<tt>-v</tt>) empty lines (<tt>^$</tt>). <tt>^</tt> stands for the beginning of the line and <tt>$</tt> 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:~#
 +
[[Bild:route.jpg|thumb|Example of output for ''route'']]
 +
[[Bild:ifconfig.jpg|thumb|Example of output for ''ifconfig'']]
 +
 
 +
'''[[vi (en)|vi]] FILENAME''' to edit a file directly on the box <br /> The manual of VI (which is realy needed ;-)) can be found at http://www.my-space.li/schule/editor_VI.pdf
 +
 +
 
 +
'''[[date (en)|date]]:''' show the date and time, or set it manually.
 +
 
 +
 
 +
'''[[rdate (en)|rdate]]:''' set the date and time over the [http://en.wikipedia.org/wiki/Time_Protocol Time Protocol].
 +
 
 +
 
 +
'''[[IPKG (en)|IPKG]] list | grep dvb-modules''' is the command to show the dvb-modul (driver version).
 +
 
  
 +
'''[[IPKG (en)|IPKG]] list | grep secondstage''' is the command to show the version of the secondstage.
 +
 +
 +
'''route''' is the command to set/show netzwork routes. With <tt>route -n</tt> the standard gateway is shown in the last line.
 +
 +
 +
'''ifconfig''' is the command to set/show the network parameters. With <tt>ifconfig</tt> 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 (en)|OE 2.0]] / [[OE 2.2 (en)|OE 2.2]] / [[OE 2.5 (en)|OE 2.5]] based images from DMM the list from the <code>ls</code> command is not colorized. The colorized display in the shell can be activated with following commands (via [[Telnet (en)|Telnet]] or [[SSH (en)|SSH]]).
 +
<syntaxhighlight>
 +
echo 'alias ls="ls --color"' >> ~/.profile
 +
 +
source ~/.profile
 +
</syntaxhighlight>
  
=== Continuative links and information ===
+
== Continuative links and information ==
 
BusyBox on [http://en.wikipedia.org/wiki/BusyBox Wikipedia]
 
BusyBox on [http://en.wikipedia.org/wiki/BusyBox Wikipedia]
  
 
[http://www.busybox.net/ Project home page]
 
[http://www.busybox.net/ Project home page]
  
More information and usage examples about the shell commands max be found at<br /> different Dreamboxboards or Linuxboards or Wikis, HowTo`s and books.<br />
+
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<br />
+
Here a Link to the IHAD board to a PDF with a summary of different linux commands [http://www.i-have-a-dreambox.com/wbb2/thread.php?postid=834435#post834435]  
[http://www.i-have-a-dreambox.com/wbb2/thread.php?postid=834435#post834435]  
+
as well as a link for simple Unix commands [http://de.wikibooks.org/wiki/Linux-Kompendium:_Shellprogrammierung:_Beispiele_f%C3%BCr_Unix-Befehle#Einfache_Unix-Befehle]
as well as a link for simple Unix commands
 
[http://de.wikibooks.org/wiki/Linux-Kompendium:_Shellprogrammierung:_Beispiele_f%C3%BCr_Unix-Befehle#Einfache_Unix-Befehle]
 
 
[[Kategorie:Software-Tool]]
 
[[Kategorie:Software-Tool]]

Aktuelle Version vom 29. September 2018, 12:23 Uhr

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...

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 / OE 2.5 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]