Giter VIP home page Giter VIP logo

custom-bash's Introduction

Customize Bash

Overview

Environment: UNIX/Linux

For macOS users, check out this guide: Deck Out Your Mac Terminal: Part I

In order to customize your shell with aliases, colors, and set a custom prompt, start by adding a .bashrc and a .bash_profile file.

The .bash_profile is executed for login shells and the .bashrc is executed for interactive non-login shells. When you login using a username and password to a server/virtual machine (vm) via ssh or directly on a machine, the .bash_profile is executed to configure the shell before the initial command prompt appears. If you have already logged into the server/vm and open a new terminal window, then the .bashrc is executed before the command prompt appears. The .bashrc is also run when you switch back from another shell (i.e ksh or zsh) into bash.

Steps

  1. On your server / VM, set bash to be your permanent login shell
# set bash as login shell 
chsh -s $(which bash)

# check if your shell changed
cat /etc/passwd | grep $(whoami)
  1. Clone the two files and place them into your user home directory
# go into user home
cd ~

# clone repo
git clone https://github.com/zarinlo/custom-bash.git
  1. Customize your .bashrc by adding other aliases or changing up the PS1 (Prompt String 1)

  2. Change permissions on the two files and source the .bash_profile

# make files executable 
chmod u+x .bashrc
chmod u+x .bash_profile 

# execute to configure your shell 
source .bash_profile
  1. Exit the shell and log back in to see the changes take affect

  2. If you kept the default .bashrc provided, you should have the following prompt:

PS1

References

custom-bash's People

Contributors

zarinlo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.