Tagged Questions
1
vote
2answers
44 views
Bash is printing (only) one of my aliases before every prompt
I think this is the relevant bit of my ~/.bashrc file:
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors ...
3
votes
1answer
107 views
Saw an interesting command but can't alias it
Saw an command from this post http://askubuntu.com/a/266839/75967 that I would like to alias
find {,/usr}/{,s}bin -printf '%f\0' | xargs -0 whatis | sort | less
I assume the less or the | is ...
3
votes
2answers
138 views
How can I shorten the bash prompt's current path to one letter per directory?
I can't remember where, but I've already seen the bash prompt's current path shortened in an interesting way: every directory contained in the path is replaced by its first letter only. For instance: ...
0
votes
0answers
17 views
PATH variable for sudo [duplicate]
I tries to add some path to the PATH variable. first of all , I added them at the end of ~/.bashrc that only works for the current user and doesn't work for root. then added the same lines into ...
3
votes
1answer
184 views
How to save terminal history manually?
It's my understanding that the history file is updated when the terminal exits. But sometimes my computer crashes out, and the terminal doesn't exit cleanly, and then I lose those commands from my ...
20
votes
2answers
568 views
How to run a script every time internet connects
I often mount a remote drive using sshfs. I would love to have this mount automatically. However, if I mount it in my .bashrc or startup scripts, the mount often fails because my wireless internet ...
1
vote
1answer
115 views
bash history not being preserved
this is a fresh install of ubuntu 12.10. i haven't even looked at the bashrc or profile files when i noticed that
history would work fine for the current session.
as soon as i closed the terminal, ...
0
votes
1answer
121 views
What is the best way to add some configuration to bashrc?
I'm currently trying to configure a server using Precise Pangolin and Vagrant (a software allowing me to provision a number of software when booting my VM).
My current question is a pure bash one.
...
6
votes
0answers
117 views
command prompt suddenly starts with (base) [closed]
For seemingly no reason today my command prompt added (base) as a prefix. I didn't change the shell or anything else. Neither the .bashrc or /etc/bash.bashrc files have (base) anywhere. The command ...
1
vote
2answers
74 views
how to reverse the lower case characters in word using only sed
Reverse every word of a line using sed
Description
-----------
The job to do is reversing every word of a line.
that a word is a sequence of lowercase alphabets
Raw Input
...
0
votes
0answers
129 views
/etc/bash.bashrc executed but not ~/.bashrc [duplicate]
The bash man page says:
"When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, "
I can see that bash.bashrc is executed ...
1
vote
1answer
316 views
What can cause my .profile file to not be loaded when a new terminal shell is initialized?
There are no errors in xsession and I don't have a .bash_login or .bash_profile file, so I'm 100% certain neither of those is loaded and thus cancels .profile loading.
When I rename the .profile to ...
4
votes
1answer
137 views
why aren't my bash aliases applied when logging in to server
When I log in to my Ubuntu 12.04 LTS server my bash aliases aren't applied, but if I execute bash from the command line they are.
~/.profile executes ~/.bashrc:
if [ "$BASH" ]; then
if [ -f ...
5
votes
1answer
147 views
My bash function runs only once per terminal opened
When I try to run my bash function, defined in .bashrc, for a second time in the same terminal, it doesn't work.
The code is the following:
function nos (){
local option
while getopts cs ...
0
votes
2answers
220 views
Running gedit in background
So I've got this working in a 10.04 ubuntu OS in bash where I can run:
$ gedit app/file.rb
bash opens that file with gedit but it is tied up.
How can I make my earlier command equivalent to $ ...
1
vote
1answer
286 views
How do I source a shell script for Node Version Manager?
Hi and thanks for looking!
I am new to Linux/Ubuntu, but I have set up an Ubuntu box on which to run Node.js.
I have had moderate success, but now I need to be able to easily upgrade my version of ...
2
votes
1answer
170 views
How to stop bash prompt colours from escaping
I'm trying to configure bash to display the current git branch, based off the example here, but I can't figure out how to get bash to stop escaping the colour strings. Everything I try results in the ...
2
votes
3answers
156 views
What do I do if I want to execute ls command everytime I do a cd to any directory?
Most of the time when I do a cd command I also do a ls to see what other files or folder are in that directory. So I want to execute ls everytime I change the directory. I know I can do cd foo ...
5
votes
5answers
3k views
difference between bash.bashrc and /etc/environment file
Till data I was used to set my environment variables in the bash.bashrc file. Recently I told to use the /etc/environment file. Well, both work fine.
So, what is the difference between them?
I ...
5
votes
1answer
2k views
How can I shorten my command line (bash) prompt?
Currently it is:
michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$
Outside of renaming my machine and directory structure...
How could I make it be something ...
4
votes
5answers
397 views
How can I uniqely record every new command I use, and possibly timestamp it?
I've been on Linux for more than 6 months now but never went too much into the CLI (command-line interface or terminal or shell)
Now as I ask questions here, get answers, or help from other sites, I ...
5
votes
1answer
224 views
Synchronize profiles across servers (.vimrc and .bashrc)
I'm on a few different servers on any given day. I'm starting to really tweak two files in my bash profile: .vimrc and alias.sh. Would anyone have a recommended way to save and sync these two files. ...
6
votes
1answer
5k views
Configure gnome-terminal to start bash as a login shell, doesn't read .bashrc
I'm trying to integrate RVM with gnome-terminal.
Per default, gnome-terminal does not start bash as a login shell. I enabled run command as a login shell as suggested in this answer about the same ...
2
votes
1answer
2k views
~/.bashrc changes have no effect?
I have been trying to set some custom colors on the user@hostname:~$ on the terminal. I edited both ~/.bashrc and /etc/bash.bashrc
Where it said:
debian_chroot:+($debian_chroot...
I just changed ...
5
votes
2answers
1k views
Changing colors for user/computer name and current directory in terminal
Is it possible to change the colors for the user@computer, the current directory and command parts of the terminal? I've already seen similar things with osx users, but I don't know how to do the same ...
21
votes
3answers
12k views
Why ~/.bash_profile is not getting sourced when opening a terminal?
Problem
I have an Ubuntu 11.04 Virtual Machine and I wanted to set up my Java development environment. I did as follows
sudo apt-get install openjdk-6-jdk
Added the following entries to ...
1
vote
1answer
300 views
Change default binaries for texlive
Ubuntu ships with texlive 2009, which installs the tex binaries into /usr/bin/latex
I've installed the current version of texlive with its installer, which installs its binaries into ...
2
votes
1answer
342 views
Is it possible to have .bashrc outside home directory?
I want to put a .bashrc file in a directory where my application is located, to set up path variables accordingly independent of the location of the directory at the moment.
At the same time, I want ...
1
vote
1answer
268 views
Error message when open terminal
This appears when I open the terminal:
bash: export: `=': not valid name
bash: export: `/home/(my account ...
4
votes
2answers
3k views
Root's .bashrc not executing on sudo -i
On one of my Ubuntu 11.10 servers, when I use sudo -i to become the root user, root's .bashrc is not being executed. On all other servers, whose relevant configurations are identical as far as I know, ...
8
votes
0answers
320 views
Is it possible to have suffix aliases in bash? [closed]
Suffix aliases are the only reason I'm considering to switch to ZSH but I want to stick with bash. So is it possible to have something like suffix aliases in bash?
For those that doesn't know what a ...
10
votes
2answers
371 views
Can I create a separate bash history file for each terminal profile?
I use a bash script to start gnome-terminal with multiple tabs, each tab using a different profile, working directory, and in some cases executing a command within the tab.
In this situation, I'd ...
2
votes
1answer
589 views
How can I set HISTSIZE for all users?
How can I set HISTSIZE for all users on Ubuntu 10.04?
I've tried adding the following lines to both /etc/profile and /etc/bash.bashrc. I'm not sure I understand the difference between the two files ...
0
votes
1answer
136 views
Line gets overwritten instead of continuing on same line
I have a problem with the bash prompt. When I type a command that exceeds the length of the width of the screen it continues on the same line and overwrites what I have written, and then continues on ...
1
vote
1answer
299 views
My terminal prompt PS1 mixed up
By the way I'm on a Mac OS X but I'm connected to an Ubuntu Server.
Yesterday I installed a module for node.js(after a hour I deleted it) which asked me to add something to the .bashrc file and now ...
17
votes
5answers
1k views
How do I teach bash in Ubuntu some curse words?
When bash encounters an unknown command(word?) it does this :
The program 'hello' can be found in the following packages:
* hello
* hello-debhelper
Try: sudo apt-get install <selected ...
2
votes
5answers
6k views
How to modify “/etc/bash.bashrc”? It is read only?
Trying to modify /etc/bash.bashrc I get an error:
$ echo "my edit" >> /etc/bash.bashrc
bash: /etc/bash.bashrc: Permission denied
ls -ll /etc/bash.bashrc shows:
-rw-r--r-- 1 root root 1975 ...
3
votes
2answers
845 views
Where to put custom .bashrc stuff, in .bash_local?
Just upgraded to 11.10, and prompted me to wondering where is now the preferred way to put customised .bashrc bits?
I have some aliases, some env variables, and a python virtualenvwrapper script, for ...
13
votes
3answers
476 views
How (and where) can one change 'user@host $:' pattern in gnome-terminal?
When I start terminal in Ubuntu, I see:
ilya@HOST:~$
I need to add a timestamp to this, something like:
2011-10-09T09:32:00 ilya@HOST:~$
How can I configure this?
12
votes
2answers
4k views
Bash history search, partial + up-arrow
I have searched, but not found anything on this. I am looking for a functionality in bash, using a terminal.
Way back when, I had a user on a debian system, and a friend set me up with a convenient ...
4
votes
1answer
348 views
Source/Dot operator error on login. Possibly caused by bad byobu uninstall
I am getting an error message every time I ssh into my box or run sudo -i. It looks like this for login:
login as: person
chands@ubuntu-server's password:
-bash: .: filename argument required
.: ...
1
vote
1answer
1k views
I accidentally overwrite /etc/bash.bashrc file. Please give the default content
I accidentally overwritten the /etc/bash.bashrc file.
Please give the default content in that file to restore or the file itself.
3
votes
1answer
3k views
What could be a reason for `.bash_profile` and `.bashrc` not to execute the exports?
the CUDA installation tutorial tells me to add the following two lines to my .bash_profile.
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
But ...
0
votes
2answers
710 views
Shell tweak to show current path in addition
I'm using ubuntu 10.10 and now I got in the shell something like that:
machine1user@mylinux:~:
how can i change it to
machine1user@mylinux:/my/current/path :~: ?
0
votes
1answer
649 views
bash shells opened via Terminal's “Open Tab” do not source .bashrc [closed]
The first time I launch a Terminal window, my ~/.bashrc (bash is my shell) is sourced; if I then open a new Terminal window from the "Open Tab" menu, ~/.bashrc is not sourced. How can I fix this?
...
5
votes
2answers
7k views
bash: [: too many arguments?
I'm trying to create a directory and cd into it:
In ~/.bashrc:
function abc() {
appname=$1
appdir="$HOME/code/$appname"
if [ mkdir $appdir -a cd $appdir ]; then
echo Success
else
...
1
vote
1answer
495 views
Executing a Super-user command through .bashrc
Is it possible to execute a super-user command in .bashrc? And if so, how?
It would save me having to execute "sudo /opt/lampp/lampp start" on each startup. I've considered using the LAMP stack from ...
0
votes
1answer
2k views
Where is bashrc profile for root?
I believe the question says it all.
Also if it doesn't exist where do I create it.
Ubuntu 10.04
