Bash

Global configuration file is: /etc/bash.bashrc User's configuration file is: ~/.bashrc

Prompt

Tip

For more information about it look here

Colors

To color the text inside your prompt you can use the regular escape codes.

\\[\e[1;32m\\]

Path

To change the prompt of the shell you have to look for the PS1 env variable inside your bashrc.

PS1='\\[\e[1;32m\\]\u@\s\\[\e[0m\\]:\\[\e[1;34m\\]\W\\[\e[0m\\]\$ '

This is the basic configuration of the prompt, except for the \W, that's my only change to bash's prompt. In origin there was a \w that showed the full path to the current directory, but I changed it and now it shows only the current folder name.

Functions

To execute a function inside your prompt you can place it inside two backticks.

\u@\h:\w:`my_function`$

Terminal

Readline

Global configuration file is in: /etc/inputrc User's configuration file is in: ~/.inputrc

Autocompletion case insensitive

To make readline autocomplete in a case insesitive manner, add or uncomment the lines below in the conf file.

set completion-ignore-case On
set show-all-if-ambiguous On

Partial history search

To make the up and down arrows search for partial commands, add or uncomment the lines below in the conf file.

"\e[A": history-search-backward
"\e[B": history-search-forward

Note

The letters A and B could be inverted on your system/machine.

System

Terminal

Command on new terminal

To run a command on a new terminal and than make it close when the command exits, do this.

gnome-terminal -- <command>

Important

This probably works only if you have GNOME installed.

Workspaces

To switch between your workspaces on different monitors, use this command.

gsettings set org.gnome.mutter workspaces-only-on-primary true

Time

On dual boot with Windows, if you want to keep both OS's time synced, do this.

timedatectl set-local-rtc 1 --adjust-system-clock

Important

This command works on the UTC+1 timezone, in other timezones it could be different.

GPU

Managing your GPU

If you want to change your discrete GPU behaviour, use the command below.

sudo prime-select <nvidia|intel|on-demand|query>
  • nvidia: only the discrete GPU will be used.
  • intel: only the integrated GPU will be used.
  • on-demand: it will switch automatically between the two GPUs.
  • query: at the moment idk.

Note

This command has been tested on a computer with an NVIDIA GPU.

Others

GDB

Global configuration file is: /etc/gdb/gdbinit User's configuration file is: ~/.gdbinit

Intel syntax

To make gdb use the intel syntax while debugging, add this line in the conf file.

set disassembly-flavor intel