Questions tagged [bashrc]

bashrc is one of the scripts the Bash shell reads as `.bashrc` and executes when started as an interactive (but not login) shell.

Filter by
Sorted by
Tagged with
0 votes
0 answers
30 views

every time i open my parrot OS terminal i get bash: ‘export: command not found

I prefer Linux. I accidentally executed a misspelled command in terminal. sudo echo 'export PATH=/home/grump/miniconda3/bin:$PATH' >> /.bashrc What can I do now that it is constantly executing ...
0 votes
0 answers
27 views

.bashrc is not sourced when open new tab in Terminal.app

When I opened new tab in Terminal.app with cmd + T, .bashrc is not sourced automatically. I had to manually run the source command. Could you please tell me why this is? environment macOS Monterey 12....
  • 1
0 votes
1 answer
14 views

How to get full path in terminal and what PS1 cmd to use in bashrc [duplicate]

Every time I change the directory I get only current directory name but I want full path what cmd should I use in my .bashrc file ? currently, i am trying as follows export PS1="\W >" ...
  • 1
0 votes
1 answer
185 views

Aliases from ~/.bashrc don't work until I run . ~/.bashrc

My aliases from ~/.bashrc don't work until I run . ~/.bashrc. I see alias_xxx: command not found I log in via SSH and I started a new ssh session after making changes to .bashrc. echo $SHELL returns /...
0 votes
0 answers
25 views

log completion of command in bash script

I am using trap 'before_exec' DEBUG to log when a command is executed in bash, but I would also like to log after the command executed so I have a record. In zsh, I can do this with zsh hooks, one ...
  • 989
0 votes
0 answers
203 views

How to log Linux commands ran from a script?

I am able to log commands executed on bash shell using export PROMPT_COMMAND='history -a > ..... , but this wont log commands executed from within a shell script. Is there any way to log command ...
1 vote
1 answer
3k views

How to properly use environment variables in crontab

I export a variable in my ~/.bashrc file (Ubuntu 20), which I'd like to use in a cron job. Searching for answers, I found two ways of doing it, but none worked for me: 12 11 * * * BASH_ENV=/home/l86/....
3 votes
1 answer
304 views

Set PATH in .bashrc depending on shell

I have a user switcher that has different use-cases. It's PATH should depend on whether the current shell is restricted or not. Thus I've added to the end of /home/switcher/.bashrc: [[ $- == *r* ]] &...
  • 45
0 votes
1 answer
26 views

Can not open a file from .bashrc with the terminal

I saved a file.txt in my home directory and add that in .bashrc : alias tiling='clear; cat tiling-gelp.txt' And I thought if I typed tiling in my terminal, the .txt would open, but not? idea?
  • 11
0 votes
2 answers
33 views

Bash recognizes function argument as a program

I'm pretty new to the syntax of bash and I have a piece of code in my '.bash_aliases' file. It either gets an integer as an argument or the letter 'c', when it gets an integer, it puts that integer in ...
0 votes
1 answer
749 views

oh-my-posh won't activate when starting up terminal, but if I refresh .bashrc it activates

Upon starting the terminal: But if I run .bashrc it works: I'm not sure why when .bashrc runs on startup it doesnt work, but if I run it myself it works. Edit : I found a solution that worked I was ...
  • 11
0 votes
1 answer
613 views

Bashrc not able to chain commands anymore using && or ;

You guys are my last resort. I've got a bashrc file with all kinds of commands in it. A lot of them are variations to this alias test=' test1 && test2 ' alias test1=' echo "i hope&...
  • 13
0 votes
1 answer
180 views

How do I make it so that I don't need to source everytime I open up my terminal?

Due to the way I downloaded a certain program [Gromacs], every time I open a terminal to use gmx, I must do the following and would like to make it so I don't need to do this every time: cd ~/...
  • 3
0 votes
1 answer
51 views

I am a newbie and I want to use linux bashrc

So I am a newbie in using Linux and I am following courses and blog posts related to linux to learn more and more about it. As I was searching about Linux Bashrc, what it is and how to use it, I came ...
1 vote
1 answer
64 views

Bash script that displays time on terminal

I wanted to write a bash script that serves like a greeting and show date and time(in terminal), and I ran into some issues. I've done some digging I solved most of the issues. The one and only issue ...
1 vote
1 answer
194 views

Can i have a private / user-specific etc folder?

I am often fiddling about with software built from source, which i install in $HOME/.local. To make it run, i have to export various variables such as LD_LIBRARY_PATH. But i do not want to have to ...
  • 113
0 votes
1 answer
225 views

Alias in bashrc returns syntax error

I am using archlinux with bash. I have been trying to create a new alias but bashrc doesn't like my curly bracket. The command down below should count the video duration length of every .mkv in my ...
0 votes
1 answer
71 views

Full-letter cursor in bash

I just started using Vim within a bash terminal. Often the cursor is very hard to see, it being a tiny line among hundreds of characters that are the same color. I'd like to change my cursor to be of ...
  • 181
0 votes
1 answer
32 views

How do you get bash to cd to your previous session directory on login?

I would like to on ssh login, change directory to my previous one. (I'm the only user on my machine).
  • 119
3 votes
7 answers
11k views

How to revert to one line terminal in new Kali Linux 2020.04

┌──(kali㉿kali)-[~] └─$ I want this to be in one line on terminal like it was before I updated kali. I tried changing bashrc on kali user and on root user there was no update.
-1 votes
1 answer
58 views

can i place all my .bash* file in to a directory?

i have quite a few .bash* file in ~/ .bash_aliases .bash_history .bash_logout .bashrc Can i put all these files in to a ~/.bash directory and if so how, or would it just break?
0 votes
0 answers
112 views

putty and remina work but telnet and ssh do not

I am connecting from a ubuntu 20.04 to a raspberry pi 4 B also on Ubuntu 20.04 telnet dies immediately ssh can be forced with ssh -T user@host however there is no prompt, the prompt can be restored by ...
  • 1
0 votes
0 answers
179 views

Is there a way to get the path to the .bashrc file that has been used by BASH?

I am logging into a server using a .bashrc file different from the one in $HOME or in ~/. Since the server is huge and there is plenty of users folders, I really don't want to use find to look for any ...
5 votes
2 answers
3k views

SSH without sourcing .bashrc

I was experimenting with my .bashrc file while remotely logged in to a server over SSH. I inadvertently left an exit in there that caused all subsequent logins to immediately disconnect. I was ...
  • 53
0 votes
0 answers
494 views

Adding to the PATH environment variable / editing the .bashrc file

I'm very much a newbie with Linux (coding in general really) but I've have taken the plunge and installed Mint for my coding projects. I've installed Julia, which I use to run numerical simulations ...
  • 101
8 votes
4 answers
1k views

Restoring ~/.bashrc without using bash commands

I think I had a typo when I add a path to ~/.bashrc and after I source it, I cannot use bash commands anymore. Now I want to restore a normal ~/.bashrc, however most of the discussion I found (e.g. ...
0 votes
0 answers
203 views

How to block access to .bashrc and .profile

How can I block possibility to download .bashrc and .profile files from Debian server with Nginx? I already added this to vhosts configuration: location ~* \.(bashrc|profile)$ { deny all; } ...
  • 101
0 votes
1 answer
264 views

How to get my bash alias to run when I open terminal

I setup a bash alias to run neofetch in .bash-alias but the only way to get it to run is to source it in every new terminal window. How can I get it to actually run when the terminal starts/opens? ...
2 votes
1 answer
1k views

OS X Catalina: update_terminal_cwd:11: unrecognized modifier `i'

In .zshrc be sure to have # .zshrc # Source global definitions if [ -f /etc/zshrc ]; then . /etc/zshrc fi instead of # .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /...
1 vote
0 answers
21 views

can't find bash history executed via ruby net::sh library

In the hope for getting the commands that run via ruby net::ssh tool which is described as follow: Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. It allows you to write ...
  • 123
2 votes
0 answers
868 views

Dash rc files for non-login non-interactive shells

Does dash have a non-interactive non-login rc file? I've read the man page, which recommends .profile for login shells and $ENV environment variable for interactive shells. Is there anything that ...
  • 133
0 votes
1 answer
652 views

Raspberri Pi 4: run an application at startup not working properly in interactive mode

I wanted to run a script when my RPi 4 boots. my application requires ~./bashrc to run beforehand, then as far as I know, I should call terminal in "interactive" mode. when I run below command in a ...
  • 1
0 votes
0 answers
2k views

Can't Run bash file inside ZSH

I've placed a bash file inside .zshrc and tried all different ways to run it every time I open a new terminal window or source .zshrc but no luck. FYI: it was working fine on .bashrc here is .zshrc ...
2 votes
1 answer
1k views

Slow midnight commander startup

OS: Ubuntu 18.04. I'm midnight commander user. When i starts terminal and then type "mc", it starts immediately. But i don't want to type it every time i open terminal. So i added "mc" to end of ....
0 votes
1 answer
46 views

What args should be used to make ls group file in such a way?

I'd like to list files grouped in such a sequence: ALL hidden files, directories, and the rest sorted by extension. So I made an alias in .bashrc like this: alias ll="LC_COLLATE=C ls -AlhF --sort=...
0 votes
2 answers
501 views

Injecting sudo su with aliases

I'm wondering if there is a way to inject alias when you switch to root profile with sudo. What I have in mind is this: sshLogin@linuxVM /home/sshLoginUser/> sudo su -x "alias goHome='cd /home/...
  • 1
0 votes
0 answers
1k views

source ~/.bashrc or ~/.profile or ~/.bash_profile stalling terminal

Below I am displaying the structure of my files, some of the code in each, and what I do to try and get it all sourced and ready to do. STRUCTURE ~/ .bash_profile .bashrc .profile .bashrc #--...
0 votes
2 answers
1k views

Is there a way to edit bashrc without loging into a user account

I have a probpem with Manjaro Linux. I worked with Android Studio and I added some lines to bashrc file. Now. Every time I try to login into that user it is stuck after I enter valid password. When I ...
3 votes
2 answers
880 views

Configure .bashrc to save all commands and output

For a new project we are setting up a Linux box that will run several processes. To be better able to backtrack or rollback configurations we'd like to keep a persistent history of all commands ...
  • 380
0 votes
0 answers
231 views

Reload .bashrc by GNOME, not by terminal

I've changed $PATH in .bashrc and would like the Ubuntu command launcher (opened by Alt+F2) to search for commands in the updated $PATH. Is it possible to do without restarting the GUI session?
  • 113
1 vote
1 answer
38 views

ssh hostname cmd isn't loading .bashrc

So, I'm trying to run a command from a linux machine on my WSL desktop and the environment is all wrong and thus, the command won't run. I was under the impression that .bashrc would be loaded if it ...
0 votes
2 answers
2k views

how to get bash and zsh setup correctly on macOS mojave

I'm running macOS (Mojave.) I'm wanting to make the switch from default bash to zsh/oh-my-zsh. Everything I install assumes I'm going to be editing my .bash_profile (or .bashrc.) I'm not 100% on how ...
0 votes
1 answer
62 views

Use output text from a command as filename

curl http://v6.ipv6-test.com/api/myip.php returns me my current IPv6 addr. I'd like to use this string as part of a filename to be created, followed by timestamp of when the script ran. Any idea how ...
  • 285
3 votes
3 answers
2k views

How to show git status and conda environment in command prompt?

I am using the git-prompt.sh script to show the git status at the bash command prompt. Using the PROMPT_COMMAND method to also have colors: .bashrc : source ~/.bash.d/git-prompt.sh # Show git ...
  • 617
0 votes
1 answer
479 views

Customize Bash Prompt and apply the modification for all logged users

I have a linux with dynamic IP address. I would like to change the bash prompt according to the current IP. A python script is responsible for this connection and his launched at boot. os.system('...
  • 145
0 votes
1 answer
21 views

Print time after command has been entered

Is there a way to concatenate time after command has been entered? Example: user@machine$ date 11:50:41 Tue Jun 25 11:50:41 EEST 2019 Current workaround is to add \t\n to PS1 before the username but ...
  • 7
0 votes
1 answer
248 views

Shell prompt: \W shown as '\w', left puzzled

TL;DR: PS1 is not as it's supposed to be. PS1="\W" shows as \w█ the block being the blinking cursor. The folder name will appear only after directory change. OS is Debian 9.9 Stretch. I'm not quite ...
  • 7
0 votes
1 answer
249 views

Unable to use `read` command in .ssh/rc

I want to read input from keyboard when SSH connection established. So I edited .ssh/rc file and used read command, just like: #!/bin/sh read -p "input: " something echo $something But the output ...
0 votes
2 answers
705 views

Two .bashrc files in my home dir

I'm using Ubuntu on Windows and I was attempting to modify my .bashrc file to add a directory to my PATH variable. I used redirection to do it like so: pwd >> ~/.bashrc Now I have two .bashrc ...
3 votes
3 answers
569 views

Alias to source .bashrc after it's been edited?

I would like to add an alias (for convenience sake) that would allow me to edit my bashrc, and if changes were made, source it, but if no changes were made, don't source (in case I changed my mind). ...

1
2 3 4 5 6