{"id":13451,"date":"2022-01-05T02:11:43","date_gmt":"2022-01-05T02:11:43","guid":{"rendered":"https:\/\/linuxways.net\/?p=13451"},"modified":"2022-01-05T02:11:43","modified_gmt":"2022-01-05T02:11:43","slug":"how-to-install-and-use-busybox-in-ubuntu","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-and-use-busybox-in-ubuntu\/","title":{"rendered":"How to Install and Use Busybox in Ubuntu"},"content":{"rendered":"<p>Busybox is free to install under the terms of GNU with a free softwares release. It is a single executable file with a number of UNIX tools. It is specially designed for the embedded operating system that has limited resources such as storage space and memory. It provides minimalist replacement of shell utilities that you can use on desktop systems such as ls, mv, cp, tar, etc. Execution of busybox can be done on many popular operating system environments such as Linux, Android and so on.<\/p>\n<p>In this article, we are going to explain the installation process and the use cases of Busybox in Ubuntu 20.04 LTS server.<\/p>\n<h2>Installation of Busybox on Ubuntu 20.04 LTS<\/h2>\n<p>Installing the Busybox on Ubuntu 20.04 LTS desktop\/server is quite easy. You can directly install it with the use of apt command. Check the below command for further details.<\/p>\n<p>First let\u2019s run the apt update command before installing busybox.<\/p>\n<pre>$ sudo apt update<\/pre>\n<p>Now, run the command as shown below to install the Busybox.<\/p>\n<pre>$ sudo apt install busybox -y<\/pre>\n<p>You can also install the busybox with the apt-get command. The process is similar to the above steps.<\/p>\n<p>First let\u2019s run the apt-get update command before installing busybox.<\/p>\n<pre>$ sudo apt-get update<\/pre>\n<p>Now, run the command as shown below to install the Busybox.<\/p>\n<pre>$ sudo apt-get install busybox -y<\/pre>\n<h2>Uses of Busybox on Ubuntu 20.04 LTS<\/h2>\n<p>You are able to use busybox through its shell directly on Ubuntu 20.04 LTS. WIth the shell interface, executing the commands like ls, rm is available. Lets run the command as shown below for further details.<\/p>\n<pre>$ busybox sh<\/pre>\n<p>After executing this command, you will see the output as shown below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"126\" class=\"wp-image-13452\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-603.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-603.png 598w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-603-300x63.png 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/p>\n<p>Here, we are trying to delete a file named \u201cexec\u201d with the command as shown below.<\/p>\n<pre>$ busybox sh<\/pre>\n<p>Then,<\/p>\n<pre>$ ls<\/pre>\n<pre>$ rm exec<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"653\" height=\"332\" class=\"wp-image-13453\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-604.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-604.png 653w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-604-300x153.png 300w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><\/p>\n<p>Here, we have successfully removed the file exec with the busybox command.<\/p>\n<p>Busybox provides httpd webserver as a program which is very popular and useful. You can check the availability and use httpd webserver with the command as shown below. Be sure to switch to root user in such case.<\/p>\n<pre># busybox sh<\/pre>\n<p>Then<\/p>\n<pre># ps -ef | grep httpd<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"592\" height=\"197\" class=\"wp-image-13454\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-605.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-605.png 592w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-605-300x100.png 300w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/p>\n<p>Now , to check if the webserver is functioning, let&#8217;s create a HTML file with a simple code.<\/p>\n<pre># busybox sh<\/pre>\n<p>Then<\/p>\n<pre># vi index.html<\/pre>\n<pre>&lt;!DOCTYPE html&gt;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Busybox HTTPD Testing&lt;\/h1&gt;\r\n\r\n&lt;p&gt;Success.&lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;<\/pre>\n<p>Then save it. Check picture below for further details.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"595\" height=\"335\" class=\"wp-image-13455\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-606.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-606.png 595w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-606-300x169.png 300w\" sizes=\"auto, (max-width: 595px) 100vw, 595px\" \/><\/p>\n<p>Now, check by browsing the site to check if it is working or not.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"845\" height=\"402\" class=\"wp-image-13456\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-607.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-607.png 845w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-607-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-607-768x365.png 768w\" sizes=\"auto, (max-width: 845px) 100vw, 845px\" \/><\/p>\n<p>Here, we have successfully tested the webserver. It seems to be running well as shown on the above picture.<\/p>\n<p>Another use case of busybox is to get the actual path of the file, you can use busybox with the readlink command as shown below.<\/p>\n<pre>$ busybox sh<\/pre>\n<pre>$ readlink -f list.sh<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"645\" height=\"275\" class=\"wp-image-13457\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-608.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-608.png 645w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-608-300x128.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/p>\n<p>Here, we execute the readlink command for the actual path of list.sh by using busybox shell.<\/p>\n<h2>Conclusion<\/h2>\n<p>In this tutorial, you have learnt how to install the busybox and use it on Ubuntu 20.04 LTS server. It is very useful and comes in handy in many cases. Thank you!<\/p>","protected":false},"excerpt":{"rendered":"<p>Busybox is free to install under the terms of GNU with a free softwares release. It is a single executable file with a number of UNIX tools. It&hellip;<\/p>","protected":false},"author":1,"featured_media":13646,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[811,100],"class_list":["post-13451","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-busybox","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=13451"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13451\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/13646"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=13451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=13451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=13451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}