It is a built-in command typically used in shell scripts to output status text to the screen or a file.
Questions tagged [echo]
89 questions
66
votes
2 answers
Why is there a /bin/echo and why would I want to use it?
I noticed that there is a binary executable /bin/echo on my Ubuntu MATE 17.04 system.
I thought, that's odd, because
$ type echo
echo is a shell builtin
Cursory testing suggests that /bin/echo does the same sort of thing as the Bash builtin echo:
$…
Zanna
- 72,312
25
votes
9 answers
How to print text in the terminal as if it's being typed?
I have a simple echo print out that I've added to my .bashrc:
echo "$(tput setaf 2)Wake up....."
sleep 2s
reset
sleep 2s
echo "$(tput setaf 2)Wake up....."
sleep 2s
reset
echo "$(tput setaf 2)Wake up neo....."
sleep 2s
echo "$(tput setaf 2)The…
SimplySimplified
- 400
21
votes
1 answer
Why don't "echo -e" commands seem to produce the right output?
In the terminal of Ubuntu 18.04 LTS, when I write this command:
echo -e "Hello\\\n"
It gives this as the output:
Hello\n
But it should print, as the man page says:
Hello\
That is, first print Hello, then \, then a newline character (and then…
yolin00
- 313
20
votes
9 answers
How to print "-n" without issuing a newline?
I'm trying to print -n using the echo command. But if i simply type echo -n, it only issues a newline, not show up -n, instead it issues a newline.
Star OS
- 2,668
19
votes
5 answers
Appending a line to a file in the cat command?
I can do cat file.txt to get the contents of a file but I also want to tack on a final line of my own choosing.
I tried piping (cat file.txt ; echo "My final line") | but only the final line is getting passed through the pipe. How can I join the cat…
DoubleBass
- 357
15
votes
2 answers
Using “while read…”,echo and printf get different outcomes
According to this question "Using "while read..." in a linux script"
echo '1 2 3 4 5 6' | while read a b c;do echo "$a, $b, $c"; done
outcome:
1, 2, 3 4 5 6
but when I replace echo with printf
echo '1 2 3 4 5 6' | while read a b c ;do printf "%d,…
user3094631
- 263
10
votes
1 answer
'top' shows 'echo "find"' processes using 100% CPU time
I have an Ubuntu 14.04 server, and found that some processes are running with root privileges and takes all my processor time. The processes are called 'echo "find"'. What are these, and how can I stop them?
András Galli
- 101
9
votes
2 answers
Disable volume auto adjust in pulseaudio "module-echo-cancel"
Important: this question How to disable microphone from auto adjusting its input volume doesn't cover this scenario.
This question is about the volume auto adjust feature of pulseaudio "module-echo-cancel".
I am using the pulseaudio module…
Paulo Coghi
- 2,102
7
votes
2 answers
Difference between " " and ' ' in bash
I am trying to figure out what is the difference between " " and ' '.
When I use them with echo they both give the same result,
sps@sps-Inspiron-N5110:~$ echo Hello world
Hello world
sps@sps-Inspiron-N5110:~$ echo "Hello world"
Hello …
sps
- 457
6
votes
3 answers
Is there a better way to create a file in bash other than using touch and echo?
I created a bash script that installed some applications and wrote a .conf file. I wanted my bash script to create the file for me so I could just run the file and it set it all up. was there a better way of going about it than this or did I do it…
6
votes
1 answer
Amazon Echo "Alexa" now only shows up as an input device
So, I've been using my Amazon Echo (the big tower, not the little "dot") as a bluetooth speaker with my Ubuntu laptop without any trouble. BUT a few days ago it started showing up only as an input device, not an output device at all. In fact,…
SenseiWarren
- 121
6
votes
3 answers
Why does echo $$ return a number?
Why does running echo $$ in bash return a number like 7190, while running echo $ only returns a $?
user8292439
- 3,878
- 7
- 32
- 57
6
votes
1 answer
How can you printf or echo the contents of your clipboard?
Alternatively, how can you dump the contents of your clipboard to a text file? If at all possible, I'd like this for the actual clipboard, but also the clipboard delegated to highlighted text, and even vim's if you can manage it.
I figure if you can…
Anon
- 12,339
6
votes
2 answers
Prompt overwrite file in echo
I am writing to a file using simple echo (I'm open to using other methods).
When writing to a file that already exists, can I make echo prompt the user to overwrite or not?
For eg, maybe an argument like -i would work?
echo -i "new text" >…
sazr
- 181
- 1
- 4
6
votes
2 answers
\n doesn't work on terminal
\n is not recognized as "change line". It just prints \n.
My terminal is gnome terminal 3.6.2.
First I noticed it with echo commands,and then with shell scripts.
Any suggestions as to why it doesn't work?
PaschalisAv
- 143
- 1
- 1
- 6