How do i get the bash command below to stop echo?

hey everyone i had a few quick questions that i hope you guys can help with, i cannot remember why i ran this bash command at the moment, but i dont know how to get into to stop echo in my terminal, as you can see in my screenshots it continues to do so even in a new terminal window, even after restart, I have even run every debsums commad to see if there were any issues, they all came back fine except for a sysctl.conf (from procps package) though these are two different issues, included are my screengrabs of terminal. hope yall have a solution to make especially that eco thing stop “withouut having the terminal simply just ignore the echo”


since im new here I cant upload more screengrabs, so this stuff here has to do with what debsums found and also my “firewall rules” not sure if that somehow has to do with what debums has fround below
bob@bob-ao533:~$ sudo debsums -as
[sudo] password for bob:
debsums: changed file /etc/sysctl.conf (from procps package)
bob@bob-ao533:~$ sudo debsums -cs
bob@bob-ao533:~$ sudo debsums -as
debsums: changed file /etc/sysctl.conf (from procps package)
bob@bob-ao533:~$ sudo debsums -ls
bob@bob-ao533:~$ sudo debsums -s
bob@bob-ao533:~$ sudo ufw status
Status: active

To Action From


22/tcp LIMIT Anywhere
443 ALLOW Anywhere
80/tcp DENY Anywhere
22/tcp (v6) LIMIT Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
80/tcp (v6) DENY Anywhere (v6)
I appreciate the time you all are putting in to help a linux noob like me! sorry if some of those debsums commands are redundant, just wanted to really see if there were any corruption ect.

here is the other bash command, but i think the other one is where this error is coming from is there a way to undo these? hopefully i can remember where i found these

my bad i think these were to change the update speed of htop and they were made persistent, i still dont understand why its giving me bash alias errors

There’s all kinds of wrong here:

sudo echo "alias top="top -d 0.2"" >> ~/.bashrc

  1. Why are you using sudo to edit a file in your $HOME? That’s just going to make it useless for your user (bob).
  2. You’re having quoting issues. Using more than one set of double quotes in a line like this is not going to do what you want. Once you start a quote, the next one ends it. So you’re asking to quote alias top= and null.
  3. The shell interprets quotes at the time of execution. It doesn’t just forward them on like characters. So the end result of what you’re doing will result in your file including the line alias top=top -d 0.2 with no quotes in it anywhere. If you want to stop interpretation, use a backslash (\) before the character.

So the end result of your command is that your .bashrc (which is run when you open terminals) executes your command, but the line you’ve added is this:

alias top=top -d 5

If you run that in the terminal, you’ll discover it doesn’t do what you think because of the lack of quotes. In fact, if you want to see the end result, just type alias top and you’ll get:

alias top='top'

However, that extra stuff isn’t lost, which is why every time you open a terminal you get all the extra noise. If you understand how alias works it helps. Running alias --help you find, among other things:

    Otherwise, an alias is defined for each NAME whose VALUE is given.
    A trailing space in VALUE causes the next word to be checked for
    alias substitution when the alias is expanded.

So in other words, you can do alias one=this two=that and produce two aliases with one line. You can also follow that with alias three=blah one and you will create one alias and check another for existence.

So your command can be split into three parts:

  1. Create alias top='top'
  2. Check to see if alias -d exists
  3. Check to see if alias 5 exists

Since those latter two don’t exist, you get the errors.

Now the question becomes why you get four sets of errors (note there are 4 -ds with numbers following them). Well, clearly you’ve been appending (that’s what >> does) multiple versions of this same command. So you probably have four lines at the end of your file:

alias top=top -d 5
alias top=top -d 1
alias top=top -d 0.2
alias top=top -d 0.1

So you should go edit that file and remove all that garbage.

If you actually want the line, you could add it with the proper quoting while you’re editing so the line looks like:

alias top='top -d 0.1' (I assume that’s what you want since that’s the last one)

If you insist on using echo, do this after removing the extra lines from your file:

echo "alias top=\'top -d 0.1\'" >> ~/.bashrc

You’ll probably want to also make sure you own the file and not root:

sudo chown bob:bob ~/.bashrc

I’m sure you can tell this affects top and not htop like you said, by the way. Both take the same delay argument, though.


As for debsums, it merely verifies your package files. If you make any changes to them, then you’ll get a changed files message. Clearly, you made a change to /etc/sysctl.conf.

In fact, looking at your screenshot, it looks like you were browsing at some information about it:
image

Let’s review what your different switches do (from man debsums):

       -a, --all
              Also check configuration files (normally excluded).

       -e, --config
              Only check configuration files.

       -c, --changed
              Report changed file list to stdout (implies -s).

       -l, --list-missing
              List packages (or debs) which don’t have an MD5 sums file.

       -s, --silent
              Only report errors.

So whenever you check all files, you get the notification. You don’t get it with changed files because, if you read carefully, normally config files are excluded. If you checked config files only, you’d get the same thing.

In the end, this is pretty unnecessary. There are integrity checks that happens with the whole package installation process.

1 Like

I really appreciate the reply, the article I got it from was pretty terrible, so is there a way to reverse this easily, this was an absolutely foolish mistake, but we all start from somewhere. Could you show me commands to fully get rid of these changes? I do hope this is possible and that I didn’t ruin anything…

You might’ve miss understood that im not doing this for anyone, this is just a personal project to get an old computer working and i made a simple mistake, Everything else about the system is set up perfectly to exactly how I want it, tweaking swappyness value to 10, using z ram as the first prority swap followedby a 4g swap file on my ssd to take over if I for some reason run out of compressible ram, having the firewall pretty locked down, but still allow basic access for things, an limiting port 22 because that from my understanding can be an “attack vector” got flstpak setup, have write caching on. A whole bunch of other stuff Ive done too. but on impulse I used a stupid command that i read from an article. I since found the proper way to get htop to do what I wanted after the fact, after the fact remembered the proper way to do it by editing A config file for it. I’m just hoping this is easy to reverse, but I don’t know where the file is to even point with say nano to delete everything out of It…

My advice: don’t use the command line unless you have a high degree of confidence in what you’re doing. As you can see, it’s easy to screw things up.

As for fixing it, I told you how.

Ah, well there is the missing piece: the file location. ~ is shorthand for $HOME or, in your case, /home/bob.

The file is called .bashrc with the period indicating it is a file that is hidden by default. But it’s there.

I typed in rm .bashrc and it went away one of the things I noticed after is the bob@bob-ao533 went from green text to Grey text but everything still works, tried pointing to it exactly and it wouldn’t remove it. Lmao

should’ve probably tried to unhide the file first

Typically, the file comes with a bunch of stuff already in it. You clearly removed everything since setting the colors of your command prompt is one of them. Copy /etc/skel/.bashrc to /home/bob/.bashrc and it should get everything back to normal.

1 Like

Thanks, I really appreciate your help, doing what I did didn’t harm anything right?

Removing .bashrc doesn’t necessarily harm anything, per se, but it does remove some stuff you might want. You can see the most recent version here.

so it would be cp ect/skel/.bashrc /home/bob/.bashrc

im an idiot with this so ill learn in time, I really appreciate the patience

cp /etc/skel/.bashrc /home/bob/

NOTE: etc not ect

Had a typo when I did ect, hands are messed up from injuries, did it, it finished now im restarting

No need to restart. The change is immediate. If you have a terminal open and want to run it, just do source ~/.bashrc. Or just close the terminal and open a new one.