Today's article is about making a better terminal experience...

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
11,775
Reaction score
10,335
Credits
97,436
I've been wanting to write an article about Bash aliases for a while. It just seemed like a dreary and boring article to write. I wanted the article, but I lacked the motivation to write it.

Enter AI...


The prompt I gave it is shared in the article (way down at the bottom). It didn't come out anything like one of my articles. Heck, it came out better than some of my articles. That AI invested some energy in writing that. Probably not a whole lot of energy, but energy nonetheless.

At any other site, one might not even suspect that it's an AI article. (I did tweak it a little.) It doesn't match my style of writing and doesn't match my formatting.
 


Interestingly, the debian .bashrc, by default, describes how to enable the use of the .bash_aliases file with this bit of default code, if the user creates a ~/.bash_aliases file:
Code:
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi
The bash-doc package it refers to is not installed by default, and its details on bash aliases is quite brief.
 
I opened .bashrc in /home and added

alias update='sudo apt-get update && sudo apt-get upgrade'

I now type update into terminal...it asks for my password and does the job

Simples !
 
describes how to enable the use of the .bash_aliases file

This is a planned article, so it's easier to save and transfer between distros.

Simples !

Mine is:

Code:
alias update="sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt clean -y"
 
Is it possible to make an alias for my password ?
 
Is it possible to make an alias for my password ?

Not as far as I know and, if you did, it'd mean you were storing your password in plain text.

If you give zero poops, you can actually use sudo without a password.


Full disclosure, I have some systems set up like that. Anyone with physical access owns the machine and I'm not worried about an evil maid.

I'm reluctant to suggest doing this. General principle says I shouldn't suggest it.

Instead, I'll say I wouldn't judge you harshly if your situation was similar and you opted to make those changes to your system.

You still need (unless disabled) a password to log into the system. It's just using sudo without a password within the terminal specifically.

I'm obligated to say don't do this. It's bad. It sure is handy, however.
 
I thought you could use Linux without touching the terminal now days?
 
I thought you could use Linux without touching the terminal now days?

I believe there are heathens that do just that. I use the terminal all the time. It's just easier, faster, and tends to be closer to universal. If you do use aliases, you can make it seem even more universal.

I realize the terminal seems archaic and tedious to some new users, but it really is an easy way to get thins done.
 

Members online


Top