How to hide your shell commands
Have you thought of hiding what you are doing on your linux bash shell prompt? and not allowing your colleague to see what command you are entering or do you want to confuse your colleague by showing something invisible but work as visible? then read out this…
Today I came across a neat, but pointless shell command. By running the following in shell, it will hide any commands you run.
root@server2 [/]# stty -echo
In order to disable this mode, simply remove the “-” before echo.
root@server2 [/]# stty echo
I guess there really is no point to the command, though you could always mess with your coworkers if they leave their shell prompt open
Cheers.



















Hi Kristine!
The only use I can think about for this command is when you do an interactive shell script and you want the user to input a password.
Cheers,
Paulo Matos
But when you do stty echo again your command history is still going to be visible via up-arrow presumably…
you are just toggling the terminal echo. It is not a pointless command. one example usage is handling of passwords from the terminal…
It is also useful in shells which do not have the capability to read a single character:
get_key()
{
[ -t 0 ] &_KEY=`dd bs=1 count=1 2>/dev/null`
[ -n "$1" ] && eval “$1=\”$_KEY\”"
[ -t 0 ] && stty $_STTY
[ -n "$_KEY" ]
}
Hi Kristine
It’s really great.
The -echo option to the stty utility was very useful in the days of serail line terminals such as the DEC VT220 and Wyse 60. Some terminals echo’ed everything via hardware, some did not.
How can I make some new posts on this wonderful looking site?
I have some stupid linux tricks to share… :-p
i wrote a batch program….but all my users are seeing that batch program what i wrote,but i m not interested to show what the program is what shall i do…?
Straight forward solution to hide history:
http://ashok-linux-tips.blogspot.com/2011/05/hidingclearing-history-commands.html