• ShaunaTheDead@fedia.io
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    My favorite tips are:

    You can filter the output of a command. Most commands return parameters like (output, error) so you can filter them by number like 1>/dev/null will filter the output and only show the errors, and 2>/dev/null will filter the errors and only show the output. Also if you want a command to run silently but it doesn’t have it’s own built-in quiet mode you can add &>/dev/null which will filter everything.

    Bash (and other shell’s I assume) can be fully customized. In addition to the .bashrc file in your home directory, there are also a few common files that bash will look for like .bash_aliases, .bash_commands, .bash_profile or you can create your own and just add to the end of the .bashrc file ./YOUR_CUSTOM_BASH_FILE_NAME

    Inside that file you can add any custom commands you want to run for every bash shell like aliases and what not.

    I personally often use a simple update command like so alias up='sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y' which just makes running updates, upgrades, and clean-up so much easier. Just type up and enter your password. I have previously added in things like &>/dev/null to quiet the commands and echo Fetching updates... to make some commands quieter but still give some simple feedback.

    There’s also the basics of moving around a terminal command as others have pointed out. The easiest and the one I use the most is if you hold CTRL+LEFT_ARROW the cursor will move entire words instead of one character at a time. Very helpful if you need to change something in the middle of a command.