{"id":404,"date":"2011-10-31T10:20:01","date_gmt":"2011-10-31T10:20:01","guid":{"rendered":"http:\/\/www.theprojectxblog.net\/?p=404"},"modified":"2011-10-31T10:20:01","modified_gmt":"2011-10-31T10:20:01","slug":"simple-tips-working-with-the-shell","status":"publish","type":"post","link":"https:\/\/www.jameseduard.com\/?p=404","title":{"rendered":"Simple Tips: Working With The Shell"},"content":{"rendered":"<p>Working with Shell is fun! But what is Shell? Before the introduction of the graphical user interface (GUI), Linux provided only textual interface (command line interface ( CLI )). Today, a Textual interface is available when logging in from a terminal emulator.<\/p>\n<h1><strong>Logging in from terminal<\/strong><\/h1>\n<p>Today, most Linux distribution (e.g. Ubuntu) comes with &#8220;login manager&#8221; (e.g. GDM, KDM, XDM). But when you are using a distro that doesn&#8217;t come with GUI, you probably don&#8217;t have these login managers so you have to login from terminal. \u00a0You should see this<\/p>\n<blockquote><p>Archlinux 3.0 -ARCH (nmepntgrm) (tty1)<br \/>\nnmepntgrm login: \u00a0myusername<br \/>\npassword:<br \/>\nLast Login: Wed Mar 10 19:09:59 on tty1<br \/>\n[myusername@nmepntgrm~]$<\/p><\/blockquote>\n<p><strong>Security Tip:\u00a0<\/strong>See the &#8220;Last Login:&#8221; line? That&#8217;s the date , time and place you last login. If the date and time is somewhat strange, you must change your password. The place here is tty1- if you don&#8217;t know what tty1 means, that is the virtual terminal number, you can work up with many terminals, switching tty will be Ctrl + Alt + (Function number) e.g<\/p>\n<blockquote><p>Ctrl + Alt + f2<\/p><\/blockquote>\n<p>Will lead you to tty2. So it means many workspace in shell! How nice is that? tty1 editing using emacs , tty2 typing in commands, tty3 listening to music etc.. But when the place is not tty, it is the computer name (e.g nmepntgrm, mycomp), it means you last login from different computer.<br \/>\n&nbsp;<br \/>\nLogging in from the network is the just same, you can use either telnet or ssh.<br \/>\n&nbsp;<br \/>\n<strong>Note:<\/strong>\u00a0Telnet is not secure! One reason telnet is not secure is that it send your username and password over the network in cleartext when you log in. SSH encrypts all information it send over the network so better to use ssh over telnet if possible. Example of ssh log in:<\/p>\n<blockquote><p>$ ssh myusername2@nmepntgrm<br \/>\npassword:<br \/>\nLast login: Wed Mar 11 20:02:06 \u00a0on nmepntgrm<br \/>\n[myusername@nmepntgrm myusername2]$<\/p><\/blockquote>\n<pre><\/pre>\n<p><strong>Erasing A Character:<\/strong><br \/>\nErasing a character sometimes bit annoying, but with this shorcuts you will love to erase :p.<br \/>\nBACKSPACE \u00a0&#8211; deletes one character thesame as DEL<br \/>\nCtrl+h \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8211; deletes one character, more easy to delete than backspace<br \/>\nCtrl+w \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8211; deletes a word (characters until the last space or tab)<br \/>\n&nbsp;<br \/>\n<strong>Closing, Suspending A Running Program:<\/strong><br \/>\nCtrl + z \u00a0&#8211; suspends the running program<\/p>\n<blockquote><p>e.g<br \/>\n$ emacs -nw<br \/>\n[1]+ \u00a0Stopped \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 emacs -nw<br \/>\n$ jobs<br \/>\n[1]+ \u00a0Stopped \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 emacs -nw<br \/>\n$ fg<br \/>\nemacs -nw<br \/>\n$ kill -TERM %1<br \/>\n[1]+ \u00a0Terminated \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0emacs -nw<\/p><\/blockquote>\n<p>jobs will list the running jobs, fg will continue the stopped job, kill -TERM %1 \u00a0will kill (oh brutal) a job.<br \/>\nCtrl + c will close a program, but you cannot close some app with this (e.g emacs)<br \/>\nThat&#8217;s All for now, I will discuss the power of su\/sudo on my next post \ud83d\ude42<br \/>\nHappy Hacking!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working with Shell is fun! But what is Shell? Before the introduction of the graphical user interface (GUI), Linux provided only textual interface (command line interface ( CLI )). Today, a Textual interface is available when logging in from a terminal emulator. Logging in from terminal Today, most Linux distribution (e.g. Ubuntu) comes with &#8220;login<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[213,214,215,216,217,218,219,220,221,222],"class_list":["post-404","post","type-post","status-publish","format-standard","hentry","category-linux","tag-command-line-interface","tag-graphical-user-interface","tag-interface","tag-interface-command","tag-myusername","tag-network","tag-password","tag-textual-interface","tag-tty2","tag-working"],"_links":{"self":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=404"}],"version-history":[{"count":0,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/404\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}