Tell me about your bash aliases!
Tell me about your bash aliases!
I've started using some custom aliases for my Linux terminal. They really help speed things up and make commands easier to type. Performance mode now shows CPU stats, power saving is enabled, and I’ve adjusted monitor settings with ease. My second monitor is off for better free sync, while the second one is on with DisplayPort. Restarting Xorg is quick with the command I use. Updating packages is a breeze thanks to apt commands. Removing packages is just a single step, and installing updates is straightforward. The current CPU speed is displayed easily, and I’ve edited my bashrc for convenience. Anyone else have handy aliases?
It's straightforward, but I've modified my .bashrc file. I rely on Linux as my main system and spend most of my time coding for university and research projects. The only notable feature here is my "dim" command, which lets me adjust monitor brightness beyond standard limits. Typing "dim 0.5" will reduce it to half power, perfect for late-night work.
In addition to standard commands (such as listing files), here are some less common options: # Determine my public IP alias ipify = "curl https://api64.ipify.org && echo" # Restore terminal appearance reset_terminal_colors = "konsoleprofile colors=Breath" # SSH server1 alias sshsrv1 = "konsoleprofile colors=Gruvbox; ssh srv1; reset_terminal_colors;" # SSH server2 alias sshsrv2 = "konsoleprofile colors=Solarized; ssh srv2; reset_terminal_colors;" Clearly, instead of using srv1 or srv2, I specify the actual server names. Having distinct color schemes for each connection helps avoid unintended commands on the wrong server. *This applies to "Konsole" terminal emulator and also works for "Yakuake". You likely already know this (given your mention of lower limits), just in case someone reads it and tries to adjust brightness via xrandr: it doesn’t influence the backlight at all, so it’s best suited when you lack control over the backlight or when your existing settings aren’t sufficient (like in your situation).*
You may want to explore redshift @dcgreen2k. The alias includes fluxgui, which resembles the interface at https://justgetflux.com/. It doesn’t change the purple or grey-purple glow on a black background, but it can significantly reduce blue and aqua illumination. Gamma adjustments tend to keep green light visible unless the temperature drops below 1400 Kelvin (much redder: 1750-1900). Green and blue both suppress melatonin production for up to an hour of exposure. Once exposed to similar lighting for about an hour, blue becomes twice as strong as green. However, there’s no widespread advice against avoiding green light at night. Harvard’s 2014 article (updated later) discusses this topic. To lessen the blue-violet glow, switch your background to dark brown or orange in a virtual terminal. On VT, use: `As root: echo -en "\e]P0200800"` where 0 = black, 1 = red, 2 = green, 3 = unchanged (yellow), 4 = blue, 5 = magenta, 6 = cyan, 7 = white. This lets you adjust text and folder colors. Another method is setting `setterm --background yellow`—it changes the default orange tone to a more neutral shade. You can tweak foreground and background colors or modify all hues via commands like `echo -en "..."`. This approach also works with fullscreen tools such as top.
I’ve shared my thoughts on sleep and light in another article:
Do you have any commands you run right before shutdown and again as soon as it starts up? I’m able to use Ctrl+R to search in bash, usually finding what I need after a few attempts with different commands. For the unbound DNS server, here’s an alternative: Also, how can I set this up automatically at shutdown and startup? I’ve added startup commands in the GUI but rely on the command line runlevel at boot. ~/.bashrc alias loadcache='cat unboundfilename.dump | sudo unbound-control load_cache' That’s a startup alias dump='sudo unbound-control dump_cache > unboundfilename.dump'. I also have another (usually I just press the UP arrow and hit enter, password and again, quickly). alias pail='sudo pihole tail' I really enjoy watching DNS requests when connecting a new device, using a wildcard to block everything at first. Then I press Ctrl+C and run sudo pihole blacklist domainname. The main question is, can I shorten “sudo pihole blacklist” to “block”, type the space after an alias of that, and add a domain name? Could I replace it with just “block” followed by the domain?