Terminal Shortcuts

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
User avatar
trawglodyte
Posts: 113
Joined: Tue Feb 13, 2024 7:35 am

Terminal Shortcuts

#1 Post by trawglodyte »

You can add this code to ~/.bashrc to give yourself shortcuts for common terminal commands. (you will have to reboot after saving ~/.bashrc with the added code). Rather than entering <sudo apt update && sudo apt upgrade>, you will now be able to enter <uu>. Rather than entering <sudo remove google-chome-stable>, you can now enter <r google-chrome-stable>. etc...

Code: Select all

# terminal shortcuts
alias u='sudo nala update'
alias uu='sudo nala update && sudo nala upgrade'
alias i='sudo nala install'
alias p='sudo nala purge'
alias r='sudo nala remove'
alias a='sudo nala autoremove'
alias s='nala search'
alias d='nala show'
alias n='sudo nano'
alias m='man -Hfirefox'
!!CAUTION- You should enter each of the shortcuts in terminal first to make sure no command already exists on your machine using those characters. !!

notes - <nala> does the same thing as <apt>, it just displays the output nicer. You may have to install it if you don't have it. <sudo apt install nala>. Alternatively, just replace <nala> with <apt> in the code. apt is a bit quicker and nala does not do full-upgrade or dist-upgrade.
notes - You may need to install troffcvt for the 'm' shortcut to work. <sudo apt install troffcvt> It causes the man to open in your browser of choice (i.e.- <m conky> will open the conky man in firefox browser). You can replace 'man -Hfirefox' with 'man -Hopera', 'man -Hgoogle-chrome-stable' or whatever browser you want the man to open in.

User avatar
siamhie
Global Moderator
Posts: 3818
Joined: Fri Aug 20, 2021 5:45 pm

Re: Terminal Shortcuts

#2 Post by siamhie »

The Bash Config program also allows you to add aliases without the need to edit .bashrc files.

bash-config.png
You do not have the required permissions to view the files attached to this post.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
trawglodyte
Posts: 113
Joined: Tue Feb 13, 2024 7:35 am

Re: Terminal Shortcuts

#3 Post by trawglodyte »

siamhie wrote: Fri Jun 07, 2024 12:39 am The Bash Config program also allows you to add aliases without the need to edit .bashrc files.
smh, every time I learn something cool, MX Linux is way ahead of me!! Yes, the GUI to add aliases is WhiskerMenu>System>Bash_Config.

User avatar
siamhie
Global Moderator
Posts: 3818
Joined: Fri Aug 20, 2021 5:45 pm

Re: Terminal Shortcuts

#4 Post by siamhie »

trawglodyte wrote: Fri Jun 07, 2024 12:46 am
siamhie wrote: Fri Jun 07, 2024 12:39 am The Bash Config program also allows you to add aliases without the need to edit .bashrc files.
smh, every time I learn something cool, MX Linux is way ahead of me!! Yes, the GUI to add aliases is WhiskerMenu>System>Bash_Config.

The devs come up with some very useful scripts/programs to make setting up your desktop much easier.
The Bash Config program was written by dolphin_oracle.
bc.png

He also wrote a script and added it to MX Tweak for the fluxbox users who want to setup a timed screensaver
without having to open a terminal and type a bunch of xset commands.
screensaver.png
You do not have the required permissions to view the files attached to this post.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

Post Reply

Return to “Tips & Tricks by users (not for help)”