Questions tagged [echo]

It is a built-in command typically used in shell scripts to output status text to the screen or a file.

Filter by
Sorted by
Tagged with
1 vote
1 answer
118 views

How do I add the repository for Unity?

This is the command I am trying to run: sudo sh -c echo deb "https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list' I am trying to install unity to ...
user avatar
1 vote
1 answer
36 views

Print double quotes in file

I would like to print this to a file echo "hello world "today"" > /tmp/file.log have as a result on /tmp/file.log hello world "today"
user avatar
6 votes
1 answer
619 views

my ubuntu shows shell script echo in strange way

Hi I have a file with shell script which looks like this #!/bin/bash todayDate=$(date) echo "Today's date is ${todayDate}. have a nice weekend!" but when I call this file in my ubuntu ...
user avatar
0 votes
1 answer
329 views

How can I disable echo in terminal

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 ...
user avatar
  • 184
0 votes
2 answers
99 views

echo command breaks lines, being used in loops [duplicate]

In my file 'foo' there is a first line: 'a b', and the second line: 'c d': $ cat foo a b c d I want to print in terminal in loop these two lines: one after another: $ for i in $(cat foo); do echo $i;...
user avatar
  • 1,502
1 vote
0 answers
83 views

Ubuntu - Other people can hear whatever I play during call

During Google Meet call, other people can hear whatever I can from my computer without me sharing my screen. It can be Youtube, FB video from Chrome or song I play on the Spotify app, whatever kind of ...
user avatar
1 vote
1 answer
1k views

Exec format error with "data" file format

Does anyone knows why it gives format error when i try to run echo through /bin/echo or /usr/bin/echo but works well if i just type echo in the command line bash: /usr/bin/echo: cannot execute binary ...
user avatar
  • 29
1 vote
1 answer
941 views

Unable to read from serial port on command line

I tried reading from /dev/ttyS0 on 1 terminal as root with cat: cat < /dev/ttyS0 and sending message to the serial port from another terminal as root with echo: echo -ne "hello" > /...
user avatar
  • 75
-1 votes
1 answer
327 views

How to print bold text in terminal? [closed]

var=apple echo " the $var is a fruit " I want to print the apple is a fruit in bold I tried this echo $'\e[32;1m the $var is a fruit\e[0m\e ;' but not working, please help me.
user avatar
0 votes
1 answer
374 views

What is the difference between using "echo" command and editing using "vi" when making changes to .bashrc file?

I finished installing a program and some websites tell me to use the echo command to export an environment variable to the .bashrc file while others say to use vi .bashrc to edit the file directly. I ...
user avatar
  • 9
-1 votes
2 answers
410 views

How to use echo output as a variable

I simulated the situation where the value of variable bar is $foo. foo is a variable too, which has the value hello. $ foo=hello $ bar=$(echo "\$foo") $ echo $bar $foo How I can get to ...
user avatar
  • 1,502
-1 votes
1 answer
58 views

Echo it's terminal problem [duplicate]

When I type echo it's terminal or anything containing 'blah blah terminal blah blah with echo the output shows Blockquote what does this mean.
user avatar
  • 121
0 votes
1 answer
85 views

Make echo based command clickable

I have this command: echo -en '\033p011' | lp -d EPSON_TM-T20III -o raw It opens cash drawer via epson thermal printer It works perfect when i execute it in terminal. But i want it as a clicable file/...
user avatar
  • 1
0 votes
1 answer
185 views

Aliasing cd && echo doesn't work properly

I'm trying to create an alias that changes the directory and prints some content. I've wrote this line: alias test="cd ~/Documents/MyDir && echo 'content'" The result is: content ~$:...
user avatar
0 votes
1 answer
331 views

create multiple files made up of a range of values

Using linux command line I wish to create multiple text files with variables a,b,c increasing by a set range each time with a particular max., as below txt file 1 a 2 b 1 c 3 txt file 2 a 3 b 2 c 4 ...
user avatar
0 votes
1 answer
84 views

Why I can't display/echo -e?

I am working on a project where I need to pass the value of "-e" meaning "end date" to java program(jar file) but when I tried to debug it by displaying its value(echo) if it's ...
user avatar
0 votes
3 answers
97 views

Why does the following zsh command change my output? [closed]

When I execute this command port=3128 echo $port:localhost I get 3128ocalhost as output. PS: When I change the first 'l' char it works fine. I can't even google it.
user avatar
0 votes
1 answer
169 views

BlueTooth device(output) and PulseAudio's module-echo-cancel help needed

I'm trying to run PulseAudio's 'module-echo cancel' filter on my bluetooth speaker(output only). I've edited /etc/pulse/default.pa like that: .ifexists module-echo-cancel.so load-module module-echo-...
user avatar
0 votes
3 answers
410 views

Create new text file with echo only

I have a repertory called 'data' and have multiple random files in it. I want to create a 'results.txt' file with all the names of the files in 'data'. I want to use only the command echo in one ...
user avatar
0 votes
2 answers
2k views

Noise/Echo Cancelling Software for ubuntu 18.04 LTS

is there any noise cancelling software that filters background noise in ubuntu which can make my mic sound clearer when I record a voice/audio
user avatar
  • 1
1 vote
1 answer
404 views

tee: constraint_0_power_limit_uw: No data available

I am trying to replace value in the file of constraint_0_power_limit with new value using echo "45000000" | sudo tee constraint_0_power_limit_uw That file is under /sys/class/powercap/intel-rapl/...
user avatar
  • 55
1 vote
1 answer
211 views

Why would one want to allow in an echo protocol (port 7) from host router?

I am in the process of replacing an Ubuntu server originally designed by someone else at work. I expect there will be many issues with getting Windows (and really LabVIEW) to interface with all the ...
user avatar
  • 111
6 votes
1 answer
1k views

How to print variable value in next line using echo command

I'm getting a curl command output as below curl -s https://api.github.com/repos/harshavardhanc/dockerfile-ansible/pulls\?state\=all | jq -r '.[]|(.number|tostring)+" "+.user.login+" "+.created_at+" "...
user avatar
  • 309
21 votes
1 answer
2k views

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 ...
user avatar
  • 313
1 vote
2 answers
334 views

How to echo commands to other file

I want to make echo from one script to another script, but I don't want to get the output of the command because I want to use this command in another script, I need to create a script that creates ...
user avatar
0 votes
1 answer
60 views

how to display number of lines in running shell file

For my assignment i need to display the current number of lines inside of a shell file, below i have implemented the wc -l command inside of my program but instead of displaying the number of lines my ...
user avatar
0 votes
1 answer
120 views

File's order got destroyed while grepping and echoing into for loop

I want to write the result of grep inside for loop into a file, keeping original file structure. Original file: $cat newtest1 some_text /homes/myself/joz ivan petrov - 20/10/19 new customer: /homes/...
user avatar
  • 1,502
0 votes
2 answers
80 views

What !! means while calling echo [duplicate]

Could somebody explain this output? $ echo ! ! $ echo !! echo echo ! echo ! $ I expected sedond echo to write only !!
user avatar
  • 147
0 votes
3 answers
7k views

curl, sh, what do those commands mean?

I've been wandering in the web and saw this about how to install atom, the new text editor: $ curl -sL https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add - $ sudo sh -c 'echo "deb [...
user avatar
  • 19
1 vote
0 answers
942 views

Avoid trailing whitespace when copy/pasting from bash/byobu terminal

I wrote a bash script that computes information and echoes it into my byobu terminal. I then select the whole thing with my mouse and paste it into a Gmail conversation after editing it a bit. ...
user avatar
0 votes
1 answer
140 views

Every terminal I open starts with this code, how can I stop this?

every time I open up a terminal it starts with this. export PATH="/home/name/.rbenv/shims:${PATH}" export RBENV_SHELL=bash source '/home/name/.rbenv/libexec/../completions/rbenv.bash' command rbenv ...
user avatar
  • 23
6 votes
1 answer
3k views

Why there is a difference between the output of 'echo $VAR | wc -c' and 'echo ${#VAR}'?

I'm working on a Bash script and the length of the string contained in a certain variable is one of my conditions. The current string is W5u7TBTzF17GGFV8DBJHvgAAAAI. Initially I've count the string ...
user avatar
  • 27.6k
1 vote
1 answer
96 views

How do commands fill up the screen?

Some commands, like curl if you do the -# option, fill up the entire screen, even if you resize. How is this done?
user avatar
4 votes
1 answer
181 views

echo command variations

Worked for years but now at least \begin and \end are handled especially. The change in echo behaviour must be new. Even if echo is not portable and the dash echo doesnt support -e / -E options ...
user avatar
0 votes
1 answer
661 views

Escape command in echo

I have some really long and complex command containing both types of quotes: " and ', for example like: cd folder && command --hel="p_me:'please' anyone:'here?'" ; command2 --end='my:"trouble"...
user avatar
  • 1,637
2 votes
0 answers
160 views

I want to enable mic echo-cancellation in Ubuntu Mate, but it doesn't work. Please, help!

Please help! I want to enable echo-cancellation in Ubuntu Mate. I watched Yt tutorials and answers on this forum. For solutions like this: Edit /etc/pulse/default.pa and add the following lines to the ...
user avatar
0 votes
1 answer
122 views

Executing echo Command Using Launcher Icon [duplicate]

I am controlling the fan speed on my notebook using acpi and the command: echo level n > /proc/acpi/ibm/fan where level n is a number between 1 and 7. It works, and after I changed the ...
user avatar
26 votes
8 answers
51k views

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 ...
user avatar
8 votes
2 answers
10k views

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-...
user avatar
  • 1,774
-1 votes
4 answers
3k views

Split echo's output on two lines

It is written in the manual that /n will split the output of echo command to the next line. I tried: echo -e 'hello /n world' hello /n world Expecting 'world' on the next line. I failed.
user avatar
  • 1,502
0 votes
1 answer
66 views

I am quite unsure of how echo command works in the following two scenarios [duplicate]

I have tried fiddling with echo command to to add $_GET to a text file but looks like it does not work but escaping it with \ works may be because $ is special character in bash. For example, echo "\...
user avatar
0 votes
0 answers
165 views

Echo and Cat output problem

I'm trying to run this script: #!/bin/bash for file in /home/dima/Downloads/dir/* do if [ -f "$file" ] then echo "SSS::################====================#####################" >> ...
user avatar
  • 3
0 votes
1 answer
636 views

echo "eval `dircolors ${dircolorsdb}`" >> ~/.zshrc didn't work as I expected

I want to insert eval `dircolors $HOME/.dir_colors/dircolors.256dark` in my ~/.zshrc I assigned a variable: dircolorsdb=$HOME/.dir_colors/dircolors.256dark I expect double quotes to result in ...
user avatar
  • 1,851
0 votes
1 answer
43k views

What does the echo command do? [duplicate]

I am fairly new to Linux and all I know for sure about the command echo is that when you type a word after it, such as echo Linux!, it prints out Linux!. Is there anything else echo does? I don't ...
user avatar
4 votes
1 answer
4k views

Error using sudo -stdin

I'm trying to use the -S stdin arg on sudo. I tried this: echo 'mypass' | sudo -S cat /etc/shadow And echo 'mypass\n' | sudo -S cat /etc/shadow As the man pages suggest to add a newline. Both ...
user avatar
3 votes
1 answer
324 views

Error while trying to post $PS1 on my terminal

I have tried to echo $PS1 on my terminal to find out the [u@h W] this is the error I get. echo $PS1 %{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%X]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $...
user avatar
  • 31
14 votes
4 answers
34k views

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 ...
user avatar
5 votes
3 answers
4k views

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 ...
user avatar
63 votes
2 answers
19k views

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 ...
user avatar
  • 66.8k
3 votes
1 answer
5k views

Changing text color in-line?

Short question: Using bash, is it possible to print a sentence such that each individual word has a different color? I.e; print a word in-line, change the text color, repeat?
user avatar
  • 155