Bash is the shell used in Ubuntu's command-line interface.

learn more… | top users | synonyms (1)

1
vote
0answers
284 views

Need to close the 12.04 GNU Bash screen [closed]

I recently upgraded my Toshiba Satellite P105 laptop from Ubuntu 11.04 to 12.04 (I don't have windows there). It was working fine for a couple of days, but now every time that I start the laptop, I ...
2
votes
3answers
2k views

Loop in bash to create decimal number

How to generate a numbers 0.01, 0.02, 0.03 ... until 0.2 in bash ? i run this example but it doesn't work #!/bin/bash # # Script for running several experimentations one the same JVM # for ((i ...
3
votes
1answer
3k views

How do I launch a bash script using a keyboard shortcut?

Just like the title says, how do I launch a bash script in my ~/Downloads folder using a keyboard shortcut? I've tried binding cd ~/Downloads && ./bash-script.sh to different accelerators (ex. ...
1
vote
1answer
30 views

Can I suppress the last-minute 'writing to disk' dialogue when umounting? (bash script)

I have a bash script that will copy files over to drives upon insertion and then unmount. The actual copy line is simple: cp $SRCDIR/$FILE $DRIVE and the umount: umount $DRIVE However, once cp ...
3
votes
4answers
402 views

“rm” doesn't accept internal command as a paramter

Why doesn't this work? rm $(gsettings get org.gnome.desktop.background picture-uri | awk '{gsub("file://","");print $0}') rm: cannot remove ...
3
votes
1answer
4k views

Using sudo aptitude/apt-get update does not work

Trying to update via terminal via aptitude or apt-get is not working. There is no other package management program running in the background or any other user. I tried both, sudo aptitude update ...
3
votes
2answers
4k views

How to replace/fix a messed up /bin/sh and /bin/dash

I have corrupted my /bin/sh and have no idea how to replace it. I accidentally copied over it. How can I fix this? I am running Ubuntu Server 11.10, no X. update: I have tried the fix that was ...
3
votes
1answer
601 views

Pipable command to print in color?

I'm a bit new to bash scripting, and I'm wondering if there is a program or built-in command to pipe to that will print in a specified color? Or is there an echo argument to do so? Like I could do: ...
2
votes
1answer
1k views

Shortcut to terminal/bash script without 'instant close'

I've created a desktop entry in ~/.local/share/applications. It looks similiar to the following: [Desktop Entry] Version=1.0 Encoding=UTF-8 Name=Crontona Server GenericName=CA Server Comment=BDAF ...
5
votes
1answer
539 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. ...
3
votes
2answers
8k views

Bash Tab Auto-complete not working for apt

apt-get install and apt-cache policy do not complete package names. I have double checked /etc/bash.bashrc, no irregularities. Googled for answers but none suffice. Any help/advice?
1
vote
2answers
493 views

How to organize scripts and tools under ~/bin in directories, but have them in $PATH?

I always have ~/bin added to the $PATH in my ~/.profile. As is default in Ubuntu. # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi ...
12
votes
2answers
15k 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 ...
4
votes
1answer
3k views

Can't change theme of ZSH in Ubuntu 12.04

I have changed the theme in my ~/.zshrc file however whilst some of the colors in the prompt change the text size and background color remain as the Ubuntu default. Any one know how I can override ...
12
votes
3answers
10k views

Can't make ZSH the default shell

I am trying to set ZSH as my default shell, however it keeps reverting back to bash. I have tried this code: sudo chsh -s $(which zsh) I've also tried: sudo chsh -s /bin/zsh Also tried these ...
0
votes
2answers
103 views

Is there a way I can record when the stderr is printed to a log file?

I'm running the command php someFile.php 1>> stdout.txt 2>> stderr.txt Is there a way I can record when the stderr is printed?
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 ...
1
vote
1answer
2k views

Script for checking for installed applications

I'm trying to write a script for ubuntu 10.0.4 to check for an application on my system. I want the script to see if the particular named application is installed, and if it is, if it needs updating. ...
0
votes
0answers
241 views

Bash Script for counting the number of processes running returns odd answer [duplicate]

Possible Duplicate: Process ID using ps aux I was writing a script to display the number of processes running for the script I am running. The file name is test.sh The code is ...
3
votes
2answers
496 views

How to write bash actions to a file?

I know that there is a way to write bash shell outputs to a file. However, I want to know what commands have been executed by an application as some of these executions are not outputted as a shell ...
3
votes
1answer
1k views

Bash runs executable fine in 10.04 but not in 11.10 or 12.04

First post, but I come here often and this is the first time I haven't found the answer already posted, so I registered. I have a simple binary executable that runs fine in 10.04. ./buds Opening ...
7
votes
2answers
599 views

What is the difference between `VAR=…` and `export VAR=…`?

What is the difference in doing $ MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m" to doing $ export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m" and is there any side-effect of doing either in an SSH ...
4
votes
1answer
269 views

How to stop SSH filesystem from discarding root permissions after every command?

i have a small bash script that mounts my sshfs... problem is it ask for the server/host password for every mount... i have four mounts and i have to enter it every time for 4 times and its ...
5
votes
1answer
5k views

How to loop through arguments in Bash ($1 $2 $3 and so forth)?

I have the following code snippet for num do echo $num done But I don't understand why it works! How come does Bash know to loop through my params $1, $2, $3, $... using my personal taste of ...
1
vote
3answers
302 views

Advanced Terminal Emulation

Would there be a way to emulate the Desktop as a Terminal i.e. XTerm, so you can type in bash on the desktop? I want some form of window manager that does that exactly.
3
votes
2answers
3k views

align columns right

For the command shell, is there a common program like column that has an option to align specific or all columns to the right, if not also detect numeric fields and do so automatically for those? ...
19
votes
3answers
13k views

Changing colors for user, host, directory information in terminal command prompt

Is it possible to change the colors in the command prompt for the user@computer, as well as the the current directory and command parts of the prompt display? I've already seen something like this ...
3
votes
1answer
263 views

Removing a tree

CODE EDIT So now that I'm off work I can do a little coding in my free time. The way that I think I want this to work is take a tarball (what I would normally extract to a folder anyway) and compare ...
2
votes
2answers
6k views

How to recover from The command could not be located because '/usr/bin' is not included in the PATH environment variable. error?

I added these lines to my .bashrc file: export vertx_home=/anto/vertx/bin export PATH=${PATH}:${vertx_home}/bin after doing that. I get an error message like that for all command's I run, for ...
1
vote
1answer
261 views

How can I capture url requests?

I run Firefox with -no-remote so I can use multiple profiles. This means applications which try to open URLs don't work. Can I setup some form of bash script that will notify me of the attempted URL ...
8
votes
5answers
1k views

Prevent nautilus showing partition mounted in bash script

In my bash script I mount partitions, check them, copy files to them, and unmount. When the script mounts the partition, Nautilus pops up with a Window showing the partition and stealing focus. This ...
0
votes
3answers
144 views

How to convert my backup.cmd into something I can run in Linux?

Back in the day when i was using windows(and a noob at everything IT) i liked batch scripting so much that i wrote a lot of them and one i am pretty proud of that is my backup.cmd(see below). I am ...
4
votes
1answer
7k views

Undertanding .bashrc and .bash_profile

On a server when I login as root I see .bashrc (ubuntu 10.10). On my Mac I have a .bash_profile, does ubuntu always have only a .bashrc file and not .bash_profile? (just confused so asking, I realize ...
56
votes
4answers
76k 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 ...
5
votes
3answers
4k views

Why pssh command is not working?

I have pssh package installed in my Ubuntu 11.10 x64 system. And I can run the program via calling parallel-ssh However, pssh gives me $ pssh No command 'pssh' found, did you mean: Command 'bssh' ...
3
votes
1answer
691 views

How to add timestamp to bash after completed command

I would like to add the current time upon execution of a bash command. I would like it to be in the right hand site so not to be intrusive. The output I am looking for is: batman@Batcave:~/grails$ ls ...
2
votes
1answer
721 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
664 views

How do I create a Ubuntu script file that will open a .jar file?

How do I create a Ubuntu terminal script that will open a .jar file? This is what I have tried until now: java -jar "/home/my-name/Desktop/Slow but Accurate/BulkNameChecker-slowbutaccurate.jar" ...
2
votes
1answer
4k views

Error with program.csh (bin/csh: bad interpreter: No such file or directory)

I've installed a program from NASA, that use a csh command but I got the following error: $ do_ledaps.csh L71124049_04920000912_MTL.txt bash: /home/j/Documents/LEDAPStool/ledapsSrc/bin/do_ledaps.csh: ...
1
vote
0answers
150 views

How to obtain the geometry of an X window using Bash? [closed]

I am looking for a way to retrieve information (specifically geometry) about an X window in a bash script and perform some action depending on the value. For example, if the window is positioned ...
1
vote
1answer
434 views

Asus Zenbook: how do I apply the bluetooth patch for 11.10?

Note: There is no need for a patch if you are running Ubuntu 12.04 I am following these instructions to recompile a kernel with working bluetooth for my Asus Zenbook UX31E. However, when typing ...
0
votes
3answers
993 views

Crontab -e gives me error messages

I get a bunch of error messages when I run crontab -e Here are the error messages. And here is my crontab file under `/usr/bin/': # /etc/crontab: system-wide crontab # Unlike any other crontab you ...
2
votes
1answer
614 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 ...
0
votes
1answer
3k views

Run two shell file with thread

How i can run two file shell in parallel and do not shared the same jvm. may be i use thread but how i run two file shell bu two thread ? File 1: #!/bin/bash # # Script for running several ...
0
votes
1answer
274 views

Is there an HTML optimizing command I can access in Ubuntu's bash shell?

I have a bash shell script that I use to upload a set of HTML files to a web server. The script makes various changes to the code before it uploads it. One thing I'd like to do is strip the HTML code ...
2
votes
1answer
1k views

Is possible to create a launcher that open bash terminal with focus on a specific folder?

As a title, or in other words is possible assign in bash launcher a custom .bashrc?
1
vote
2answers
433 views

How to have multiple path separators in Bash

I have few python scripts which were written by someone else in Windows. These scripts use double backslash as path separator but when run in Ubuntu they don't work because of this. I can change all \ ...
4
votes
2answers
2k views

How to automatically run commands on SSH connection?

I have some Amazon EC2 instances that run Ubuntu 10.04.1 LTS. Every time I connect to those instances I run a couple of simple commands, like a cd <repository>, a git status etc. How can I add ...
3
votes
2answers
770 views

Wget like utility to download all images in mysite.com/img/ directory

My access to the mysite.com/img/ directory is blocked. However all the images in that directory are in the form n.jpg where n is the nth image. My access to mysite.com/img/n.jpg is not blocked Is ...
4
votes
2answers
902 views

Enter password only once for script making many sudo calls

I am writing a script to download build and install a bunch of packages. Building sometimes takes a while, and installing requires root priviledges: make; sudo make install What happens alot is that ...