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

learn more… | top users | synonyms (1)

1
vote
1answer
1k views

Why we can't run commands with gnome shortcuts?

When I make a custom shortcut with gnome (gnome-control-center keyboard) I can't set it to a command. Why? Example: I can't set a shortcut for sudo apt-get update. Instead I must first invoke a ...
2
votes
2answers
536 views

Why “cd ..” doesn't work in this if

pwd | grep 'database$' if [ "$?" = 0 ]; then echo "has db" cd .. cd .. echo "after has db" fi after I execute it I see has db after has db and I'm still in the same dir, how to fix it?
6
votes
1answer
308 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 ...
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
1k views

Want to write a simple SVN update bash script

I want to write a simple bash script that will update an SVN working copy in a given directory. The repository is accessed with the svn+ssh protocol. The basic process this needs to follow is: ...
1
vote
1answer
738 views

Linux command that builds a shell script automatically after you run a command

Alright I'm drawing a blank here but I know I used to run some linux command that would automatically generate a shell script for me based on how i interacted with the shell. Example: If i remember ...
1
vote
1answer
202 views

Scripting question (youtube-dl and xclip)

I have youtube-dl and xclip installed. Is there a way I could write a script that can run commands from both? For example: youtube-dl -l --extract-audio (url) but instead of pasting a url could I ...
0
votes
3answers
4k views

Anomalous result using bash “set” command

When one issues the set command without arguments at a bash prompt (which should output a list of shell variables and their values), a script of 8,274 lines scrolls by. Examining this script shows ...
2
votes
1answer
413 views

Script to login and load main gui in Ubuntu 11.10

I have a RFID reader interfaced with an Arduino microcontroller left over from a past project, which I would now like to use to automatically login on Ubuntu 11.10. What I'm imagining specifically is ...
5
votes
2answers
540 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 ...
1
vote
1answer
1k views

Red5 start script not working

I have an EC2 instance running Red5 and I added the following script to the scripts that run on startup and shutdown of the server: ################# NOTE FROM DOMINICK # First Follow these ...
6
votes
1answer
6k views

Cannot echo “hello” > x.txt even with sudo? [duplicate]

Possible Duplicate: sudo & redirect output I'm trying to create a file in /var/www, but even with sudo this fails: user@debVirtual:/var/www$ sudo echo "hello" > f.txt -bash: f.txt: ...
1
vote
1answer
188 views

Unable to press 'E' key in bash when I add export EDITOR=vim in /etc/inputrc

When I add the line export EDITOR=vim into /etc/inputrc and start a new session in BASH, I am unable to press the E key on the keyboard. (Well, I can press it, physically, but nothing shows up in the ...
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
458 views

delete files with particular character length and a extension in a directory using some command in terminal window

I would like to know what command must be executed in the terminal window which will enable us to delete files with a particular extension(say .c) in a particular directory whose name length is 6 ...
1
vote
1answer
428 views

Error message when open terminal

This appears when I open the terminal: bash: export: `=': not valid name bash: export: `/home/(my account ...
2
votes
2answers
710 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 ...
2
votes
2answers
3k views

How to run an executable bash script on Kubuntu?

I have recently changed my OS from Ubuntu 11.04 to Kubuntu 10.04 but don't know how to get my executable bash scripts to run on Kubuntu. On Ubuntu all I did was click on the text file and I was given ...
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 ...
2
votes
1answer
481 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 ...
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, ...
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 ...
6
votes
3answers
448 views

How do you get details from the output of the locate command?

When I run the ls -l command I get details about the files in the current directory like permissions, owner, group, file size. Is there a way I can get these same details instead of just the ...
12
votes
6answers
837 views

How can I grep through tab completion possibilities?

When I press tab in a console I get this output Display all 2957 possibilities? (y or n) Is there any way to use grep on these 2957 possibilities? I would like to search for all commands with ...
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 ...
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: ...
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 ...
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 ...
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.
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 ...
0
votes
1answer
913 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/ ...
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 ...
5
votes
4answers
176 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. ...
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 ...
2
votes
2answers
4k views

Copy file to same directory with appended filename Via SSH Bash Script

How would I copy a batch of files into the same directory with an appended filename via SSH Bash Script? For example. /path/files/file /path/files/file-20120105 The trick is for it to be a one liner ...
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
901 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 \ ...
18
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 ...
0
votes
3answers
849 views

Help me to add line to file password /etc/shadow

when I try to add line inside /etc/shadow: echo -e "admin234:!!:0:0:99999:7:::" >> /etc/shadow 1 2 3 The console show this message: -bash: 0: unrecognized history modifier or ...
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 ...
3
votes
1answer
669 views

Load configuration from XML (Xfconf)

I'm trying to make an app to switch your XFCE4-Panel's layout between 3 layouts. I applied those layouts and copied the XML file where Xfconf stores its configuration for the panel. The general idea ...
1
vote
1answer
14k 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
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 ...
2
votes
2answers
2k views

sudo -i only allows one argument

Is this normal? > sudo -u misc -i "ls" note test tmp > sudo -u misc -i "ls ~" -bash: ls ~: command not found > sudo -u misc -i "ls ~" -bash: ls ~: command not found > sudo -u misc -i ...
1
vote
4answers
618 views

Replace commas with colons and move all values to one line

I entered a list of number in Calc and saved it as CSV so that all the values on one line are separated by commas. I will describe what I'm seeking with bash in the following example: INPUT 22,33 ...
2
votes
3answers
3k views

Install C Shell in Ubuntu 11.04 Terminal Temporarily

One of my friend wants to use C Shell in Ubuntu 11.04 Terminal instead of Bash Shell for sometime, Is there any way to do it without affecting System in any way?