There’s all kinds of wrong here:
sudo echo "alias top="top -d 0.2"" >> ~/.bashrc
- Why are you using
sudo
to edit a file in your $HOME
? That’s just going to make it useless for your user (bob
).
- 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.
- 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:
- Create alias
top='top'
- Check to see if alias
-d
exists
- 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 -d
s 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:
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.