Tagged Questions

When the Bash shell is started as an interactive (but not login) shell, the .bashrc script (if it exists) is read and executed. The --norc option can prevent this, and the --rcfile <file> option will cause Bash to read and execute <file> instead of .bashrc.

learn more… | top users | synonyms (1)

0
votes
1answer
13 views

How can I check whether Vim has the -p (tabs) option or not?

I would like to figure out in my .bashrc (or one of the files it sources) whether Vim has the -p option available and if so create an alias. Now, that same .bashrc is used on numerous systems ...
0
votes
2answers
34 views

What is the correct way to alias applications in OS X through bash?

In my ~/.bashrc, I have several aliases like: alias emacs='/Applications/Aquamacs.app/Contents/MacOS/Aquamacs' alias octave='/Applications/Octave.app/Contents/Resources/bin/octave' alias ...
2
votes
1answer
98 views

Multiple .bashrc.save in my ~/home/user/

I noticed that in my home folder I have multiple .bashrc.save files. Why the system save them? It is normal or I have to disable something? Specifically I have .bashrc .bashrc.save ...
0
votes
1answer
59 views

Create a function that wraps an alias, but prints out the alias string

I want to create a bash function that will basically wrap an alias, except that it will output what the alias is doing so I don't forget the actual command. e.g.: alias abc='cd ~/root' So when I ...
3
votes
1answer
113 views

Linux: coloring bash prompt will broke carriage return

When I try to colorize the bash prompt like this: export PS1="\e[0;31m[\u@\h \W]\$ \e[m " it breaks the carriage return (instead of going to a new line when line is full, it starts in the same line ...
0
votes
2answers
43 views

source .bashrc doesn't work

I installed TinyOS on RedHat for my academic purposes. Now I can't log in to the system. I logged in in single user mode. Then I tried to log in. I couldn't login in as any user. I couldn't start the ...
1
vote
1answer
88 views

Alias that allows to edit ~/.bashrc and then “sources” it automatically - Why it doesn't work?

I use MacBook Air with OSX 10.7.2. I would like to create an alias that does the following: Opens TextMate with ~/.bashrc and allows me to edit it Once I close TextMate, "sources" ~/.bashrc (so if ...
1
vote
1answer
54 views

How do I enable tab tips in Bash?

I am working under debian squeeze. I always install packages such way: sudo apt-g(Tab pressed) i(Tab pressed) aria(Tab pressed) sudo apt-get install aria2 I have installed chroot squeeze to test my ...
1
vote
2answers
71 views

bash: execute command given in commandline and don't exit

how do I specifiy a command on the commmandline of bash which shall be executed once inside the new bash after reading ~/.bashrc -- But all this without letting bash exit after the command is ...
0
votes
2answers
143 views

How do I stop automatic changing of iterm tab titles?

After switching to using .bashrc instead of .bash_profile (I didn't like how the default terminal worked with one config file and utilities like screen with another), the behavior of iterm2 changed. ...
0
votes
1answer
109 views

-bash: /home/rb27/.bash_profile: Permission denied

I have tried changing permissions and I have looked for a solution, but the error still exists.In fact it gives me a different error every time I log in. Could not chdir to home directory /home/rb27: ...
1
vote
1answer
56 views

.bashrc loading aliases from different file

I have a .bashrc file, which I want to setup so it reads aliases from an .aliases file and sets them up. Currently I have: # User specific aliases and functions while read alias_line do echo ...
0
votes
1answer
92 views

How to check terminal color capability from command line?

I write: $ infocmp -1 xterm ... colors#8, bold=\E[1m, blink=\E[5m, ... $ tput -Txterm colors && echo OK || echo err 8 OK $ tput -Txterm blink && echo OK || echo err ...
0
votes
1answer
102 views

“Reset” colors of terminal after ssh exit/logout

When I ssh into a remote server, I like the colors of the terminal to change. I use setterm on my remote ~/.bashrc file to get this done. However, when I exit, the terminal colors are not reset to the ...
0
votes
1answer
79 views

Bash Alias Adding a Background Process

In my .bashrc, I want to put something like this. alias lst='ls &' So that I can do something like this. $ lst /tmp which will be translated into $ ls /tmp & How can I do the above?
1
vote
1answer
42 views

Formatting my $PS1 to x amount of character

I'm looking for a way to force my PS1 variable to a certain number of chars. It currently looks like: $PS1="\W $" and I'm trying to keep the same number of characters regardless of the length of ...
0
votes
1answer
148 views

How to use cyg-wrapper to fork a new tab in win32 gvim

I would like to set up an alias in my cygwin .bashrc that translates pathnames unix-to-dos and passes them to windows gvim in a new tab of an existing instance. I am trying to use Luc Hermitte's ...
3
votes
2answers
216 views

Is it possible to override the command line's built in “cd” command?

Just about every time I 'cd' to a different directory on my machine (in this case, running Mac OS X 10.6.7) via the command line (which is bash), I immediately type 'ls' to get the list of contents in ...
1
vote
1answer
314 views

How to change default vi alias in Fedora 14?

In my laptop, if I type below $ which vi alias vi='vim' /usr/bin/vim Now I want to change the vi alias to another bin, e.g. vim_wrapper a script created in /usr/bin/, I type this line: alias ...
0
votes
2answers
4k views

How to execute python script from console without writing full path?

I have a few python scripts on /usr/share/scripts/ that I use often, and I want to be able to execute them by just writing the name and not the full path, how could I do this? echo $PATH shows me: ...
2
votes
1answer
55 views

Bash: take local .bashrc (or similar) settings to remote boxes w/o putting .bashrc on every instance

I'd like to take my local .bash_rc (with, for example vi keybindings), to various boxes and various users on those boxes? Some of these settings are very user-specific (I'm the only one who likes ...
1
vote
1answer
71 views

Default folder from which commands execute

Once I upgraded to Maverick Ubuntu, bash shell in gnome-terminal starts by default at root rather than my home directory, this was easily fixable by adding a cd command in .bashrc. However, this is ...
1
vote
2answers
1k views

Where's .bashrc for root?

I know it's not best practice, but on my dev system I login as root. What's the equivalent of the .bashrc file so I can alias some functions? I've found the /etc/bash.bashrc & ...
2
votes
1answer
318 views

Bash completion makes bash start slowly

Starting a bash on my ubuntu system takes about 2 seconds. If I remove loading /etc/bash_completition in .bashrc it starts without delay. Of course I don't want to give up completition and I don't ...
1
vote
2answers
60 views

What's the most reliable way to distinguish local from remote logins in .bashrc?

What's the most reliable way to distinguish local from remote logins in .bashrc?
0
votes
2answers
117 views

How to detect ubuntu in a shared bashrc?

I share my .bashrc (all my dotfiles, actually) between ubuntu and archlinux. Since the paths may vary between them, I'd like to run some commands only on ubuntu (and others only on archlinux). How can ...
0
votes
2answers
139 views

bash: source from URL

In addition to my own computer, I sometimes use an Ubuntu cluster at my school. Rather than manually keep my .bashrc's in sync, I would like to make the school cluster's .bashrc source my personal ...
0
votes
1answer
383 views

Why is shell not reading from Bash startup files

Okay, after several frustrating hours, I am relegated to using this forum again. I'm just trying to do the simple task of adding my MYSQL directory to the PATH variable so that I can use the mysql, ...
0
votes
1answer
75 views

How do I install Z.SH to my Linux?

I want to install Z to my Linux:https://github.com/rupa/z/ Here's the installation notes: # INSTALL: # * put something like this in your .bashrc: # . /path/to/z.sh # * put something like ...
0
votes
1answer
187 views

I want to make a save command by editing the .bashrc

I found this script http://dotfiles.org/~jacqui/.bashrc.. Basically this is a shortcut for cd-ing my file system.. I can type "save nm" where "nm" is any short name for the directory, like "blog" or ...
2
votes
4answers
3k views

Mac OS X .bashrc not working

I have a one-line .bashrc file in my home directory: alias countlines='find . -type f -print0 | xargs -0 cat | wc -l' But it is not creating the alias. Why might that be?
3
votes
5answers
267 views

bashrc: how to know X window is available or not?

There is a part in my ~/.bashrc, which sets $EDITOR to be gvim. It works fine when I am in X window. However, if I ssh to my workstation (from another workstation) gvim starts to complain "cannot open ...
1
vote
1answer
178 views

Bash profile script order in screen

I have put an echo in three profile scripts that shows the file name so that I can see the order they run. When I log in I see. /etc/profile /etc/profile.d/color-ls ~/.bashrc /etc/bashrc $ alias ls ...
2
votes
2answers
983 views

How can I change my bash prompt on Ubuntu?

I have one account on an Ubuntu server with the correct PS1 variable and I want to make one of my other accounts on the same server have the same PS1 variable, so that my prompt on this new account ...
0
votes
2answers
304 views

.bashrc reports unexpected EOF

I am trying to add some functions to my bashrc, namely: h () { history | fgrep $1 | sort -u | cut -b 8- } extract () { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xvjf $1 ;; ...
3
votes
4answers
230 views

Run parts of .bashrc asynchronously

I have some exports and other things that require another program to run (to get paths or whatever) and they take a non-trivial amount of time to run, meaning my bash startup time is on the order of 5 ...
4
votes
2answers
256 views

Is it a good idea to put “screen -r” in my .bashrc?

I'd like to use screen to keep ssh sessions alive on my server. It would be nice if I could automatically resume any running session for my user when I log in. The straightforward way to do this would ...
3
votes
1answer
273 views

Bash shell: how to reconcile portable configuration files and GUI terminal start-up types (login or interactive)?

In an attempt to "properly" implement a standard configuration of my preferred shell, bash, for use across multiple platforms, I've come across some confusion when dealing with terminals that are ...
2
votes
2answers
75 views

Why is there a dot in front of .bashrc

I have been trying to figure this out for a while now, pretty simple question for some I can only guess, but why is there a 'dot' in front of .bashrc?
5
votes
2answers
3k views

Open gnome terminal programmatically and execute commands after bashrc was executed

For starting my dev environment I wrote a little script. One part is to open a gnome terminal with several tabs where automatically some commands should be executed. Some of those commands depend on ...
1
vote
1answer
333 views

How to escape commands in a bashrc alias?

I need to occasionally touch a file with the current timestamp as the filename. I would do so this way: touch `date "+%Y-%m-%d_%H-%M"`.txt However, I'd like to define an alias for this. When I try ...
1
vote
4answers
464 views

How do I only display the base dir in my Ubuntu Terminal?

In Ubuntu 10.04 Terminal when I traverse into some long directory structure the entire path gets displayed, this leads to lot of space wastage on my terminal, where the cursor comes way over to the ...
3
votes
1answer
248 views

Problems with bash path when using 'su'

In Ubuntu Lucid Lynx, I'm trying to do su -l user -c "foo.sh args" where foo.sh is an executable bash script on the PATH set in ~user/.bashrc. Unfortunately, this fails because it can't find ...
1
vote
3answers
158 views

.bashrc file adds a couple of tens of spaces to the prompt

I got myself a .bashrc file off the net. I checked it beforehand, didn't detect anything bad about it. One thing that's odd about it, is that several spaces are added to the terminal command line. ...
20
votes
3answers
4k views

Difference between .bashrc and .bash_profile

What's the difference between them and which one should I use?
1
vote
2answers
227 views

gnome-terminal: how to preserve symlinks of working directory when opening new tab?

If I'm using gnome-terminal in a working directory whose path includes symlinks and I open a new tab, the symlinks will be expanded to their destinations in the working directory of the new tab. Is ...
2
votes
4answers
351 views

Bash prompt: how to have the initials of directory path

I normally have just the name of the current directory in my bash prompt (PS1='\u@\h:\W$ '), so if I am in ~/projects/superapp/src/ I get: hamish@host:src$ However I'd like to have an indication ...
4
votes
3answers
2k views

Linux - bash not loading .profile in new session

I'm setting up a new Linux machine I got from out IT dept, and noticed .profile is not loaded when I start a new terminal session. The current shell is bash, though I changed it from the default sh it ...
1
vote
2answers
292 views

running .bashrc versus new login

I added new alias into .bashrc Running .bashrc doesn't create that alias but new log in yes. Could you somebody explain why is that so and how I can test if the new .bashrc works without doing test ...
5
votes
1answer
439 views

What does the 'rc' in `.bashrc`, etc. mean?

Well, this is embarrassing. I feel like I just realised I don't know a loyal colleague's name after working with them for 10 years. "Hey, er... *cough!*, thanks for that great job you did on setting ...

1 2