1

For the first time I accessed the bashrc file. I wanted to create alias shortcuts.

I wasn't able to do anything and when I closed the terminal, I am not able to access it anymore.

It gives me the following:

    # ~/.bashrc: executed by bash(3) 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
case $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# 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 checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# 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|*-256color) 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
New contributor
FilipZafran is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1

Fix it by replacing your broken .bashrc with default .bashrc from /etc/skel directory:

  • Switch to tty3 by Ctrl+Alt+F3
  • Log in as root
  • cp /etc/skel/.bashrc /home/youruser/
  • chown youruser:youruser /home/youruser/.bashrc
  • Hey Gryu, I really appreciate the reply. Please note that I am a complete noob and you will have to dumb it down a bit for me, as I got an error: 'login incorrect' / I wrote: 'cp /etc/skel/.bashrc /home/ficho/' as soon as tty3 was initiated... I guess im missing something on the second step: 'Log in as root' when I access tty3 stands: 'ficho-PS63-Modern-8M login:' – FilipZafran yesterday
  • Use root as login: ficho-PS63-Modern-8M login: root, and also provide password for root, not for ficho user. Your typing will be invisible. – Gryu yesterday

Your Answer

FilipZafran is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.