Interesting Commands !!!!!!

3 views
Skip to first unread message

Harinderjit Singh

unread,
Aug 11, 2009, 11:35:59 AM8/11/09
to JUIT Linux User Group
SEVEN WAYS TO LOGOUT OF BASH

how many ways do you know of to log out from a Bash shell??
here are atleast seven commands that you may use to log out -but
please be aware
that some of the commands are dangerous if you logged in as a ROOT
user because they could stop
services that usually run as root.

1.logout
2.exit
3.CTRL+l
4.export TMOUT=1
5.fuser -k 'pwd'(don't run it as ROOT)
6.skill -KILL -u 'whoami'(don't run it as ROOT)
7.kill -9 $$(don't run it as ROOT)


TEXT-BASED WEB BROWSING

you may use elinks or links in text mode to browse websites from a
console.

elinks http://www.google.com

this will open google in your home browser.press ESC key to access the
menu where ,among other
items,you will find FILE->EDIT to close the browser.



USING "!$"

another wonder of the simple shell variable is !$. Lets say you want
to make a directory,go into it
then rename it.

the flow of commands would be:

$ mkdir ur_dir
$ mv ur_dir my_dir
$ cd my_dir

linux has a shorter and smarter way to do it.

$ mkdir ur_dir
$ mv !$ my_dir
$ cd !$

!$ points to last String in the command String


these commands are fun and pretty useful too.though most of the LUG
members would know these
,but i thought this a good way to provoke interest among people who
are new.

THanks

Shashank Singh

unread,
Aug 11, 2009, 12:25:03 PM8/11/09
to JUIT Linux User Group
good post ,dude

Ank$

unread,
Aug 11, 2009, 1:02:45 PM8/11/09
to JUIT Linux User Group


On Aug 11, 8:35 pm, Harinderjit Singh <harinderji...@gmail.com> wrote:
> SEVEN WAYS TO LOGOUT OF BASH
>
> how many ways do  you know of to log out from a Bash shell??
> here are atleast seven commands that you may use to log out -but
> please be aware
> that some of the commands are dangerous if you logged in as a ROOT
> user because they could stop
> services that usually run as root.
>
> 1.logout
> 2.exit
> 3.CTRL+l
> 4.export TMOUT=1
> 5.fuser -k 'pwd'(don't run it as ROOT)
> 6.skill -KILL -u 'whoami'(don't run it as ROOT)
> 7.kill -9 $$(don't run it as ROOT)
>
> TEXT-BASED WEB BROWSING
>
> you may use elinks or links in text mode to browse websites from a
> console.
>
> elinkshttp://www.google.com
>
> this will open google in your home browser.press ESC key to access the
> menu where ,among other
> items,you will find FILE->EDIT to close the browser.
>
> USING "!$"
>
> another wonder of the simple shell variable is !$. Lets say you want
> to make a directory,go into it
> then rename it.
>
> the flow of commands would be:
>
> $ mkdir ur_dir
> $ mv ur_dir my_dir
> $ cd my_dir
>
> linux has a shorter and smarter way to do it.
>
> $ mkdir ur_dir
> $ mv !$ my_dir
> $ cd !$
>
> !$ points to last String in the command String
>
> these commands are fun and pretty useful too.though most of the LUG
> members would know these
> ,but i thought this a good way to provoke interest among people who
> are new.
>
> THanks

great work man...
awesome post full of knowledge

Chirag Anand

unread,
Aug 11, 2009, 2:56:33 PM8/11/09
to juit-linux...@googlegroups.com
nice post dude, very informative. And well, i didn't know about that bash variable... :p
so keep posting, noone here is a full linux expert and its always good to learn about new things.

--
Regards
Chirag Anand
Junior Systems Architect
E2E Networks | <http://www.e2enetworks.com>
chirag...@e2enetworks.com

Blog :http://techfreaks4u.com/blog
anything weird is worth a try...
Reply all
Reply to author
Forward
0 new messages