{"id":121,"date":"2013-01-05T22:53:10","date_gmt":"2013-01-05T20:53:10","guid":{"rendered":"http:\/\/icefront.info\/wp\/?p=121"},"modified":"2013-01-05T22:53:10","modified_gmt":"2013-01-05T20:53:10","slug":"useful-linux-debian-commands-and-facts","status":"publish","type":"post","link":"https:\/\/icefront.info\/index.php\/2013\/01\/05\/useful-linux-debian-commands-and-facts\/","title":{"rendered":"Useful Linux (Debian) commands and facts"},"content":{"rendered":"<p>This article explains some very basic linux commands an facts needed when setting up and working with a web server. Note that this article isn&#8217;t covering all about Debian, in fact covers a very few but important knowledge one may need.<\/p>\n<p>This article contains information mainly for beginners.<\/p>\n<p>Some useful facts<\/p>\n<ul>\n<li>under Linux, everything is a file. Even a device, such as a HDD or port<\/li>\n<li>files have no extension. In fact the can have but files aren&#8217;t recognized by extension. Thus, in a file named &#8216;aaa&#8217; you can put a wav sound, a text, or anything binary. File names are case-sensitive!<\/li>\n<li>you can add\/remove software (packages) with apt-get. There are no two similarly named packages in Linux. These programs\/packages usually hold their config files under \/etc<\/li>\n<li>there are programs or services. Programs are like a text editor. You can run many instances and you can exit them. Services are running in background (eg. ftp, apache).<\/li>\n<li>the main system is text-based. You must write at the command prompt to interact with the system. BTW everything is very simple and archaic&#8230;<\/li>\n<\/ul>\n<h4>To log in or log out<\/h4>\n<p>Logging in is automatically initiated. Without logging in you can&#8217;t do anything, even you can&#8217;t stop the server (except pressing the power button to initiate shutdown)<\/p>\n<p>To log out use:<\/p>\n<pre>logout<\/pre>\n<h4>To start\/stop\/reboot the machine<\/h4>\n<p>Use one of the following:<\/p>\n<pre>reboot\nhalt\nshutdown -h now<\/pre>\n<h4>To see what&#8217;s here (files and directories here)<\/h4>\n<pre>ls\nls -l\nls --help<\/pre>\n<h4>To change directory<\/h4>\n<pre>cd lower_dir\ncd \/absolute_dir\/dir\/dir<\/pre>\n<p>You may want to see more files\/directories so install the Linux&#8217;s Norton Commander-like app, Midnight Commander:<\/p>\n<pre>apt-get install mc\nmc<\/pre>\n<h4>See the free space<\/h4>\n<pre>df\ndf -h<\/pre>\n<h4>Change the permissions over files and dirs<\/h4>\n<pre>chmod 0xxx filedir\nchmod --help<\/pre>\n<p>You can read more about permissions at <a title=\"permissions\" href=\"http:\/\/wiki.debian.org\/Permissions\">wiki.debian.org<\/a>.<\/p>\n<h4>To manage running services<\/h4>\n<p>If you change a service&#8217;s config, you must restart the service.<\/p>\n<pre>\/etc\/init.d\/xxxxx restart\n\/etc\/init.d\/xxxxx stop\n\/etc\/init.d\/xxxxx start\nservice xxxxx restart\nservice xxxxx stop\nservice xxxxx start<\/pre>\n<p>Replace xxxxx with the service name.<\/p>\n<p>[To be continued&#8230;]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article explains some very basic linux commands an facts needed when setting up and working with a web server. Note that this article isn&#8217;t covering all about Debian, in fact covers a very few but important knowledge one may need. This article contains information mainly for beginners. Some useful facts under Linux, everything is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-121","post","type-post","status-publish","format-standard","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/comments?post=121"}],"version-history":[{"count":0,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/posts\/121\/revisions"}],"wp:attachment":[{"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/media?parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/categories?post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/tags?post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}