Score:0

How can I disable echo in terminal

sh flag

This might seem simple but sometimes I need terminal to not echo anything , whether for a specific command or all commands.

in windows I could simply do echo off

I tend to make files with cat command a lot but it returns whatever I'm entering and I feel like an Alcoholic because I see double.

example :

cat | sudo tee -a vocab.txt

I am the first line
I am the first line
I am the second line
I am the second line

John Ronald avatar
ca flag
Possible solution could be to modify your command to "cat | sudo tee -a vocab.txt>/dev/null"
YoloWex avatar
sh flag
It worked but didn't make vocab.txt @JohnRonald
Terrance avatar
id flag
`tee -a filename` appends to the file. `tee filename` creates the file. And with what @JohnRonald posted above worked for me for creating a new file as well. You may not need the `sudo` if you are not writing into a folder that is owned by root or not you.
sudodus avatar
jp flag
Don't use `tee` if you don't want any [extra] output to the terminal. Simply redirect the output to where you want it, modify the command in your question to (as one single line) `cat > vocab.txt`
Score:1
us flag
jpx

The answer is to run:

set +x

Turning on echo is

set -x

I just ran into this issue when a script failed and the terminal kept echo'ing all the commands I typed afterwards. This is the first answer than came up when I tried searching for a fix.

More info:

set -x enables a mode of the shell where all executed commands are printed to the terminal. (see: https://stackoverflow.com/questions/36273665/what-does-set-x-do)

Oleksandr_DJ avatar
um flag
Correct answer!
Score:1
cn flag
raj

You can turn terminal echo off with the command:

stty -echo

(warning: after entering this command, you won't see following commands that you'll type)

and turn it on again with the command:

stty echo
vanadium avatar
cn flag
@YoloWex, you are the one who seeks help. Is this how you address those willing to help you?
YoloWex avatar
sh flag
Dude I might haven't been clear I don't want the terminal to respond to me but I want to see what I'm typing. I tried what you said but all it did was hiding what I'm typing . I want the exact opposite.
raj avatar
cn flag
raj
@YoloWex So what's your problem then? Seeing what you type is a default setting, you don't need to change anything.
Score:0
us flag

The option to switch echoing of the command in a terminal off - with bash as a shell is:

set +v

# - the -->  set -v <-- sets the command echoing back on
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.