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

learn more… | top users | synonyms (1)

2
votes
1answer
200 views

Gnome Tweak Tool editable via bash/python?

Is there a way to access the variables to edit via bash (or other libraries with bash or python)? Similar to how you can use 'gconftool-2' in bash to edit properties that would update them after ...
5
votes
2answers
541 views

Help understanding command line

We are starting our Jenkins CI with the following bash command that I would like understand. Could someone explain what is doing (the only bit I get is "java -jar jenkins.war"). Thanks! nohup java ...
2
votes
2answers
711 views

open multiple instances of a (.pdf) file

I would like to open multiple instances of the same file with some sort of command. I've tried some very unsophisticated ideas (e.g., an alias or function in my .bashrc, a simple shell script), but ...
41
votes
4answers
17k views

How to see the command attached to a bash alias?

Suppose I have an alias in the bash shell. Is there a simple command to print out what command the alias will run?
1
vote
1answer
1k views

Named pipe getting “clogged”

for elem in {1..99} ; do echo $elem> mypipe ; done This piece of bash code should pass 99 ints through the pipe, which previously, in another terminal had this set: cat <mypipe Does anyone ...
2
votes
1answer
482 views

Run default mail client

To run the default web browser or terminal there are commands like x-www-browser and x-terminal-emulator. There are other alternatives for common programs. Is there a similar command to run the ...
2
votes
2answers
1k views

create .xml file with data from bash

I am trying to make a .xml file, the bash command need to copy this block of code, and replace the CITY-FROM-TEXT-FILE-LINE-1 attribute from city.txt (one city per line) <ss:Row ss:Height ...
3
votes
1answer
688 views

How can I make a music playlist out of a .txt file?

I am using Ubuntu 11.10 (I don't think that really matters) with Bash. How can I make a music playlist out of a .txt file? It is a command but I forgot it. I would appreciate it if someone would ...
0
votes
1answer
76 views

Command who question [duplicate]

Possible Duplicate: What is tty7 in the commandline? Why when I type the command who does it show my_username tty7 my_username pts/0 Shouldn't it just show one? Why am I logged in ...
0
votes
1answer
160 views

Using a custom list for autocompletion (e.g., a list of files)

what I would like to do is when I write inside on console a command, for example. ls file1.txt folder1 folder2 then I write cd (I hit some magic shortcut and I can access using down ...
1
vote
1answer
107 views

Can't install libmodman from source

I have this file libmodman-2.0.1.tar.gz, and want to install it, so I extracted it, navigated to the directory, then ./ configure and I get this : ~/Downloads/libmodman-2.0.1$ ./configure bash: ...
1
vote
5answers
2k views

How to kill only if process is running?

Currently I use line like this in my sh script file: kill `ps aux | grep -F 'myServer' | grep -v -F 'grep' | awk '{ print $2 }'` But I wonder how to call it only if process (myServer here) is ...
7
votes
2answers
9k 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, ...
0
votes
2answers
2k views

My df totals don't come close to adding up… why? [duplicate]

Possible Duplicate: ext4 partition size / free space discrepancies The results from a df on my main drive on my server don't add up. I came close to running out of disk space, I freed 4 ...
5
votes
5answers
487 views

How can I add to a already running process an additional 'shutdown' command?

On a regular basis I forget to add && shutdown -h now to a long-running process. Is there any way to add a shutdown -h now command after the first command was invoked? It is not intended to ...
7
votes
3answers
1k views

How to get colored output from bash script?

When I execute grep from within gnome-terminal, I get colored output - easily noticeable match, line-numbers (-n) with different colors etc But when I execute exactly same grep command through bash ...
6
votes
1answer
6k views

How do I start x11vnc via bash script on startup, not login?

I have a server with Xubuntu 11.10 Desktop installed, and x11vnc. When on login screen I want x11vnc to start and to take some settings: Automatically set defined password Automatically accept ...
2
votes
3answers
576 views

How can I install and remove programs in one command line, and confirm only once?

When I install Ubuntu, the first thing I usually do is remove some programs and install some others. To get that done, I enter the following in a terminal: sudo apt-get remove applicationA ...
2
votes
1answer
464 views

How to set svn info response/call result language?

I have localized russian Ubuntu 11.10. But all my scripts use stuff like REMOTE_REV=`svn info $REMOTE_REPO | grep '^Revision:' | awk '{print $2}'` Where in my localization ^Редакция: would do ...
3
votes
3answers
624 views

How do I remove ._ from beginning of filename?

I have several files' names starting with "._". I'd like to remove the point and underscore in a script. Howto do this? Thank you very much in advance.
4
votes
3answers
2k views

cron jobs not running

I've got a couple of scripts that I've had scheduled to run in cron for a while. About a week or so ago, they stopped running as far as the (very basic) logging showed, and also I noticed that my ...
20
votes
4answers
35k views

How to run an alias in a shell script?

I have an executable file mpiexec, whose full path is ~/petsc-3.2-p6/petsc-arch/bin/mpiexec. Since I want to execute this command in different directories (without having to retype the entire path), ...
3
votes
3answers
289 views

After double-clicking a script on the desktop, show output in a terminal

I am trying to make a demo Virtual Machine. On the desktop, I have a script foo.sh and it outputs stdout to foo.log (e.g. with some command > foo.log) When I double click on the script, it ...
7
votes
3answers
11k views

Add bash script folder to path?

I have some bash scripts in an application folder that I'd like to use as if they were on my path. If they were straight-up applications, I'd just add the directory to ~/.bashrc, but these are ...
6
votes
1answer
309 views

automatically run ls after changing path using autocd

So everytime I change the directory I would like the new path to automatically get listed with ls.There are solutions if the path gets changed using cd but I never found a solution that would work ...
32
votes
7answers
30k views

How do I make my terminal display graphical pictures?

This is a quick mockup I copy and pasted together. I imagine this being super cool and useful. Does something like this exist already?
9
votes
2answers
3k views

How can my script determine whether it's being run by bash or dash?

I'm running a fresh Oneiric install (i.e. not an upgrade) on two different systems and running into the same set of seemingly related problems. The most frustrating of the bunch is that, when I use ...
1
vote
1answer
628 views

Project Ideas for newbies. [closed]

I am a college student who is taking a sort of introductory class to Unix, Linux ( and to be honest i have been accustomed to it and like it better than widows now) and we have just covered the ...
4
votes
1answer
2k views

ulimit -u gives illegal option error when running from a script but not when from a terminal

I have the following script: #!/bin/sh echo "OUTPUT:" gcc temp.c echo "ACTOP" ulimit -t 1 ulimit -f 1024 ulimit -u 3 ./a.out > out.txt The output I get is OUTPUT: ACTOP ulimit: 7: Illegal ...
6
votes
4answers
2k views

Keep a program running in terminal

So I am well aware of nohup and suffixing commands with & to ensure that they go into the background. However if I run a graphical application - sometimes using neither seems to do the job. So ...
3
votes
1answer
1k views

How to escape `$` and `#` symbols in bash?

I have a simple string I want to echo from my bash script: $(document).ready(function() {$('#cf-footer-paragraph').append('<p>Revision 12345</p>');}); But any how I try to add \ before ...
0
votes
1answer
914 views

rsync to check/compare server1:/data/archive/ to server2:/data/archive/ and have the files synced to another destination such as server2:/data/?

This has been tearing my hair out. I need to: compare server1:/data/archive/ to server2:/data/archive/ (through rsync, ssh, etc) filenames that don't match, get copied (scp) to server2:/data/ ...
2
votes
2answers
2k views

How to make svn look for if there is an update once a minute and if there is call some script?

I wonder if it is possible to create such .sh script that a normal user would be capable to start with something like nohup ./superScript.sh >& /dev/null & and which would once a minute ...
6
votes
4answers
177 views

Why doesn't changing a variable in a script alter it outside the script?

Let's say I export a variable with the terminal. After that I call a script that alters that variable to something else. But when I return to the terminal and echo the variable, it remains as its ...
6
votes
2answers
5k views

Is there a way to do a ' ls -R | grep “aname”* | rm; to remove multiple files in multiple directory

I have installed (compiled) emerald. The command make uninstall didn't work (there is no makefile as it is just a script). So I decided to remove the file manually. But there were a lot of files. ...
3
votes
2answers
4k views

Running commands on boot in 11.10

So I am getting properly confused on how to create a startup script on my Ubuntu 11.10 server. I have read about init-scripts, upstart-jobs and more, but I get even more confused the more I read. ...
15
votes
6answers
40k views

How do I open a file from inside a bash script?

Ok, so running gedit myfile.txt works well. But what about opening a file from inside a bash script, using the default desktop app linked to the filetype? I've tried below, which works great when run ...
2
votes
1answer
5k views

Connecting to MySQL in Bash (without MySQL installed)

I am trying to connect to a remote MySQL database in Bash. On the server hosting the database I can type: mysql -u _username_ -p to connect. I would like to be able to type: mysql -h _host_ -u ...
0
votes
1answer
296 views

Help or advice for my script

I have written the following script which you may find useful if running Ubuntu on VirtualBox and make use of NetBeans. The scripts may even be used for other VirtualBox needs as it tries to: ...
1
vote
1answer
903 views

Bash is abnormal in Makefile!

all, I have found that the same Makefile works well in Mac OS X, but does not work in Ubuntu. The snippet is as following: start: @echo $(seperator) @if [[ "$(PROJECT)" == "" ]]; then \ ...
4
votes
2answers
763 views

how can I set my bash window title to the last command that ran?

I'd like the title of my terminal windows to show the last command that ran. It'd be handy for finding the terminal that's running Mongrel in Dev/Test/Prod etc (for testing rails apps). I tried this ...
19
votes
1answer
6k views

How do I set up bash completion for command arguments?

When I open up the command line and type in git, I get a bunch of completions for arguments of git, like add, commit, merge, and so on. How do I add this kind of completion to my own apps? So far, ...
5
votes
1answer
211 views

How to combine similarly structured directories?

I have two directories that look like this: /folder1/sub1/file1.txt /folder1/sub1/file2.txt /folder1/sub2/file1.txt /folder1/sub2/file2.txt /folder2/sub1/file3.txt /folder2/sub1/file4.txt ...
4
votes
3answers
137 views

To which directory should I install a program from a bash script?

I want to install Netbeans 7.0.1 with a bash script from the Netbeans website. The default directory chosen by the installer is /home/geoffrey/netbeans-7.0.1. But I do not think it belongs there.
12
votes
2answers
1k 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
3answers
3k views

Prevent an application from being closed on terminal exit

I have created a bash script that starts an application. Since I wanted the terminal window to close when the application is started, I used this line: firefox & 2> /dev/null; exit; It works ...
1
vote
1answer
15k views

tar -cvfz command results in error message unless I omit the hyphen before 'cvfz' [duplicate]

Possible Duplicate: sudo tar cvpzf exiting with failure due to previous error When I run the command tar -cvfz backup.tar.gz somedirectory I get the following sterr tar: Exiting with ...
2
votes
5answers
5k views

extract number from a string

i have the following string Device Enabled (126): 1 can i extract in a variable VAR only 126 and NOT (126) ? p.s 126 = random number please help me ! EDIT i paste my script so u can ...
10
votes
6answers
15k views

How to log all Bash commands by all users on a server?

Our small company runs an Ubuntu Server 11.10, to which a couple of people have SSH access. The actual terminals are sometimes used, too. How can we locally log all Bash commands run, along with user ...
2
votes
1answer
296 views

subshell ls -lh “$(find /music -type d)” doesn't return list, instead results of find command

I'm trying to list the details of all the directories in my music folder using the following command: ls -lh "$(find /music -type d)" However all I get is the return of the find command. Is this ...