Skip to main content

my bashrc file for linux terminal







#####################################################################
                                                Start of code
#####################################################################

#
# ~/.bashrc
#

# If not running interactively, don't do anything
#[[ $- != *i* ]] && return

#alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '


#################################################################


#################################################################
#self added
#################################################################
#for sudo work for auto completion
if [ "$PS1" ]; then
complete -cf sudo
fi

# set up to use vi command editing mode
set -o vi

#Allows you to cd into directory by typing the directory name
shopt -s autocd
#################################################################




# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
#HISTSIZE=300000       #HISTSIZE= HISTFILESIZE=
#HISTFILESIZE=30000    #for infinite history
HISTSIZE= HISTFILESIZE=


# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
    else
color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]"
    #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]"
    #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]"
    #PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
#     if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
#         . /etc/bash_completion
#     fi



#####################################################################
                                                  end of code
#####################################################################







----------------------------------------------------------------------------------------------------------------------

         below are the Modified and light Form of Above bashrc

----------------------------------------------------------------------------------------------------------------------







#####################################################################
                                                Start of code
#####################################################################
#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

#SELF ADDED
#################################################################

# set up to use vi command editing mode
set -o vi

#Allows you to cd into directory by typing the directory name
shopt -s autocd
#################################################################


#HISTORY
#################################################################
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
#HISTSIZE=300000       #HISTSIZE= HISTFILESIZE=
#HISTFILESIZE=30000    #for infinite history
HISTSIZE= HISTFILESIZE=
#################################################################


#AUTO COMPLETION
#################################################################
#

#COLOR
#################################################################


# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]"
    ;;
*)
    ;;
esac
#################################################################


#################################################################
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi
#################################################################



#####################################################################
                                                  end of code
#####################################################################







----------------------------------------------------------------------------------------------------------------------




Comments

Popular posts from this blog

install WiFi-Pumpkin (ex 3vilTwinAttacker) for almost any linux

WiFi-Pumpkin (ex 3vilTwinAttacker) WiFi-Pumpkin Description Framework for Rogue Wi-Fi Access Point Attack. WiFi-Pumpkin is a very complete framework for auditing Wi-Fi security. The main feature is the ability to create a fake AP and make Man In The Middle attack, but the list of features is quite broad. Features Rogue Wi-Fi Access Point Deauth Attack Clients AP Probe Request Monitor DHCP Starvation Attack Credentials Monitor Transparent Proxy Windows Update Attack Phishing Manager Partial Bypass HSTS protocol Support beef hook ARP Poison DNS Spoof Patch Binaries via MITM Karma Attacks (support hostapd-mana) LLMNR, NBT-NS and MDNS poisoner (Responder) Pumpkin-Proxy (ProxyServer (mitmproxy API)) Capture images on the fly TCP-Proxy (with scapy) Plugins dns2proxy  - This tools offer a different features for post-explotation once you ch

How To Add The BlackArch Pentesting Repository To Arch Linux

BlackArch is a penetration testing distribution, similar to Kali Linux, but it’s built on top of Arch Linux. In reality, BlackArch is really a pre-configured Arch installation with an extra repository full of security tools. As a result, you can add the BlackArch repository to a regular install of Arch and gain access to all the same tools. In this tutorial you will learn: How to Download the BackArch Setup Script How to Verify The BlackArch Script How to Run The BlackArch Setup Script How to Install a Package from BlackArch How to Install an Entire Category from BlackArch Install BlackArch on Arch. Software Requirements and Conventions Used Software Requirements and Linux Command Line Conventions Category Requirements, Conventions or Software Version Used System Arch Linux Software BlackArch Repository Other Privileged access to your Linux system as root or via the sudo command. Conventions # - requires given linux commands to be

How Make Terminal look like Parrot's OS terminal?

copy the following codes and paste this code to file name bashrc which is locate in /home/username/ eg . /home/lazyboy/bashrc   copy code from  HERE or just copy following code ------------------------------------------------------------------------------------------------------------------------- # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything [ -z "$PS1" ] && return # don't put duplicate lines in the history. See bash(1) for more options # ... or force ignoredups and ignorespace HISTCONTROL=ignoredups:ignorespace # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s

How To Change Mac Address | Mac Spoofing in Kali / linux

there are mainly two ways to change your mac Method 1: kali@root# ifconfig {Nework Interface} down kali@root# macchanger {options} {network Interface} kali@root# ifconfig {Nework Interface} up kali@root# service network-manager restart     example:         kali@root# ifconfig wlan0 down         kali@root# macchanger -r wlan0         kali@root# ifconfig wlan0} up         kali@root# service network-manager restart Method 2: kali@root# /etc/init.d/networking stop kali@root# ifconfig {Network Interface} down kali@root# ifconfig {Network Interface} hw ether {any new mac} kali@root# /etc/init.d/networking start     example:         kali@root# /etc/init.d/networking stop         kali@root# ifconfig wlan0 down         kali@root# ifconfig wlan0 hw ether h0:38:99:25:6h:02         kali@root# /etc/init.d/networking start that's it.. to conform ,kali@root#macchanger -s wlan0

How to stop MAC address from changing after disconnecting? linux

Network-Manager will reset your mac address during the wifi scanning. To permanently change your mac address: Edit your  /etc/NetworkManager/NetworkManager.conf  as follows: [main] plugins=ifupdown,keyfile [ifupdown] managed=false [device] wifi.scan-rand-mac-address=no [keyfile] Edit your  /etc/network/interfaces  by adding the following line: pre-up ifconfig wlp68s0b1 hw ether xx:xx:xx:yy:yy:yy The  xx:xx:xx:yy:yy:yy  is the new mac address obtained from the output of  macchanger -A wlp68s0b1   sources: click here

How to set up your shell to use vi command editing mode in Terminal

Most shells that have a command line editing feature support Emacs key bindings. (a tiny subset) Up Ctrl + P Down Ctrl + N Left Ctrl + B Right Ctrl + F Home Ctrl + A End Ctrl + E Delete Ctrl + D Alternatively, you could set up your shell to use vi command editing mode, by adding   set -o vi to your shell startup file (e.g., ~/.bashrc ).  Then, for example, you can Use Esc  k  Enter to re-execute the previous command (same as !! ).  The minus key - also works as a "move up" command. Use Esc  k  k  k  k  k  k  k  k  k  k  k   k Enter or Esc  1 2  k  Enter to re-execute the 12th previous command (same as !-12 ). Use Esc and a motion command (i.e., k , suitably repeated), and then edit the bash command line you find there.  Remember, you will still be in vi command mode, so you will need to use a vi editing command (e.g., I , A , C , R , or one of their lowercase counterparts) to actually add to the command from history. So, for examp

Changing Your MAC Address/Linux ,Powerful Metod

Changing Your MAC Address/Linux Jump to navigation Jump to search Under GNU/Linux, the MAC address of a network interface card (NIC) can be changed by following the procedures below. NOTE: MAC addresses used within this article are provided for example only. Substitute according to your requirements. NOTE: Commands below MUST be executed with root privileges (e.g. prepended with "sudo "), in order for things to work! /etc/init.d/networking stop ifconfig eth0 hw ether 02:01:02:03:04:08 /etc/init.d/networking start Execute " ifconfig eth0 " to confirm. The above should work on   Debian ,   Ubuntu , and similar distributions. Alternatively, under   RHEL / Fedora   and possibly other GNU/Linux distributions (incl.   CentOS   and   Scientific Linux ), to disable and restart networking, one must stop and start   /etc/init.d/network , instead of   /etc/init.d/networking . If you have iproute2 utilities installed, you may prefer to use the " ip " co

How to Connect Wi-Fi from Linux Terminal Using Nmcli Command

There are several command-line tools for managing a wireless network interface in Linux systems. A number of these can be used to simply view the wireless network interface status (whether it is up or down , or if it is connected to any network), such as iw , iwlist , ip , ifconfig and others. And some are used to connect to a wireless network, and these include: nmcli , is a command-line tool used to create, show, edit, delete, enable, and disable network connections, as well as control and display network device status. First start by checking the name of your network device using the following command. From the output of this command, the device name/interface is wlp1s0 as shown. $ iw dev phy#0 Interface wlp1s0 ifindex 3 wdev 0x1 addr 38:b1:db:7c:78:c7 type managed     Next, check the Wi-Fi device connection status using the following command.   $ iw wlp2s0 link Not connected. From the output above the device is not connected to any network, run the

How To Install Brave Browser On Debian Linux

installing brave on Debian (specially on kali) linux is not an easy. so it can be painful. but suppose you install it any how but it is still painful to open brave. in fact, you can't open it without using --no-sandbox .And using --no-sandbox to open brave is extremely dangerous for your machine security. after many research, i found a very simple solution.   STEP1: On machine,  follow the  official Ubuntu instructions and only change the following step: echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ $UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/brave-browser-release- ${UBUNTU_CODENAME} .list to this: echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ bionic main" | sudo tee /etc/apt/sources. list .d/brave-browser-release-bionic. list STEP2: Then add the following in  /etc/sysctl.d/00-local-userns.conf : kernel.unprivileged_userns_clone = 1   STEP3: finally run the following comma

Random Posts