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

learn more… | top users | synonyms (1)

1
vote
1answer
4k views

Commands not working after editing .bashrc file

I need to install a programming software called cuda for my academic purpose. Googling how to install it on my Ubuntu 10.04, I found these and I have done that. download the software cd ~/Downloads ...
9
votes
3answers
12k views

How do I configure Ubuntu to reboot every day at a given time?

Using the terminal or a bash file, how can I configure Ubuntu to reboot every day at (say for instance) 3 AM? In other words, I want to schedule an automatic reboot through the terminal. I haven't ...
0
votes
1answer
171 views

Why does the script list directories starting with uppercase first, and all-lowercase second?

The thread is an extension of: Basic script listing directories ([: discover: unexpected operator) When I execute the script: for item in * do if [ -d "$item" ] then echo "$item" fi ...
1
vote
2answers
458 views

Basic script listing directories ([: discover: unexpected operator)

I encounter an issue running a basic script listing directories. for item in * do if [ -d $item ] then echo $item fi done The outcome: lists all system folders returns an error: ...
0
votes
2answers
672 views

How to add your Eclipse workspace folder to your PATH?

I am using Ubuntu 12.04. Hi I have been working on the following issue for a couple of days and as much as a I look at the many different answers (What is PATH environment variable and how to add it) ...
1
vote
1answer
748 views

search and replace inconsistency between vim and sed

Using the Ubuntu 12.04 and vim 2.22.0, why inside the vim I shall use: :9s/\d\+/1/ to change first digit of the mentioned line to 1, but couldn't be able to use the same with sed as : sed -i ...
5
votes
1answer
4k views

How to link a custom keyboard shortcut to a bash script in Ubuntu 13.04?

As an Ubuntu 13.04 user I had myself as well various problems and incompatibilities with this newest version of Ubuntu. One of these is that the Brightness bar has suddenly disappeared from the ...
0
votes
2answers
5k views

Cannot access /etc/hosts

I cannot open my /etc/hosts file. I would very much like to, I have tried logging in as root and changing the ownership and changing the permissions, please help. When I try to open the file I get: ...
5
votes
1answer
11k views

How to change a directory using shell script?

I am trying to change a directory to home/developer. I used cd home/developer in my shell script. After executing script it is again coming to original directory,where I executed shell script.
0
votes
1answer
65 views

Any setup to version control ALL ubuntu settings?

Just now, I had to google for the third time in my life on how to disable that thing in Ubuntu, where you hold the super key and a help window pops up. Granted, there was a few months in between, but ...
0
votes
2answers
164 views

I am trying to check the mysql bind address int the terminal but keep getting error can someone help?

I am trying to check the mysql bind address in the terminal using the command cat/etc/hosts | grep localhosts that I got offline, but I keep getting a bash: cat/etc/hosts: no such file or directory ...
0
votes
1answer
30 views

Command substitiution problem, confused

I am trying to have sox play a file from user input. To do this, I set up a command like the one below: $ play proc/$(read -n 1).wav I have files 0.wav through 9.wav located in the directory proc. I ...
1
vote
1answer
200 views

Ubuntu .pam_environment for non-login shell

I remember in the past, we have two place to set env variables for Ubuntu Login shell - ~/.profile Non login shell - ~/.bashrc But now according to the doc [1], they are not recommended anymore. ...
0
votes
1answer
255 views

Why does my shell script only execute in execution mode “Display output”?

I wrote a bash script (here) for extracting EXIF GPS coordinates from an image and displaying those coordinates as a pointer in Google Maps. It works perfectly when used like this in the terminal: ...
8
votes
3answers
16k views

How to access the last return value in bash?

Simple scenario: I'm looking for a wsdl file lost in the middle of a project. $ find -name '*.wsdl' ./some/very/very/long/way/to/some/lost/directory/filename.wsdl Now that I know where it is, I ...
2
votes
1answer
927 views

Bash command-line in vi mode - command-line find/replace [duplicate]

New to linux :-) In my .bashrc I have set -o vi. That way when I'm in the terminal I can press CTRL +{ and then use VI commands to navigate, edit and search the command history. One thing I cannot ...
1
vote
3answers
28k views

./configure no such file or directory even after installing build essentials

I'm trying to install Java SE 7 on my ubuntu 13.04. I have already downloaded tar.gz file and extracted. But when I wrote in terminal: ./configure I saw this message bash: ./configure: No such ...
0
votes
1answer
505 views

Removing specific characters in string

I am currently writing a bash script and I have obtained a list of file locations. However I have notice that some file locations have spaces in the file name such as eg. : /1 2 3.txt Such files ...
1
vote
1answer
144 views

How to do tab completion with files that starts with special characters

I am unable to open a pdf file which starts with (. For example: (3311) M3N78-EM.pdf Are there any arguments to be given? I have invoked with evince command. When I type evince (and press tab, nothing ...
1
vote
1answer
123 views

How does Linux know how to execute shell vs machine code?

./something How does Linux know how to execute this if it's a shell script, or compiled machine code? I understand how the shebang works, but there doesn't seem to be anything like that here.
0
votes
2answers
53 views

Something that should seem simple

As mentioned in the title, this should be something simple, but for the life of me I can't get it to work right. I am writing a small executable script that will take care of entering the ...
0
votes
0answers
20 views

adding directory to path environment variable doesn't remain in path [duplicate]

I have been trying to get a program called "passenger-memory-stats" to run as the super user. The program is installed in the following directory: /usr/local/rvm/rubies/ruby-1.9.3-p327/bin/ruby . I ...
0
votes
2answers
225 views

enter path written in a file

I'm writing a code with fortran and I have several different output saved in different directory. During the Do cycle I saved the temporary PATH of the output in a file.txt Now I'm trying to plot ...
3
votes
2answers
1k views

How Do I Log USB Modem AT Command Output?

I want to be able to send the command "AT+CSQ" to /dev/ttyUSB1 every 5 seconds, and log out response to a text file. I can do it manually via screen (screen /dev/ttyUSB1 and type in AT+CSQ and see the ...
1
vote
1answer
111 views

get the resident memory of indivdual threads of a process using bash shell

If I want to find the resident memory a process uses, I might use something like "ps aux | grep apache2" or "sudo pmap -d 1130". However, I have one process that has 25 threads, and I would like to ...
0
votes
1answer
672 views

How to launch Dolphin file manager from command line or bash script (and give it a path)?

I want to open a Dolphin window from a bash script. It may not be relevant to the question, but I will be connecting to an SFTP location in Dolphin. First I tried this command from my script: ...
2
votes
1answer
4k views

Configure / Add a FQDN to /etc/hosts?

I'm trying to set up iRedmail 0.8.5 and I keep getting this error. root@danielbts11:~# cd /home/iRedMail-0.8.5 root@danielbts11:/home/iRedMail-0.8.5# bash iRedMail.sh hostname: Name or service not ...
3
votes
2answers
7k views

How to rename all files in folder with name ending with “_backup”

I have a bunch of images that were somehow renamed from myimage.jpg to myimage.jpg_backup, so the images on my website don't load anymore. How would I recursively find all images ending with _backup ...
1
vote
2answers
9k views

Change the terminal prompt [duplicate]

This can be really trivial,but it helps in ways of making it more comfortable while coding and sending commands to terminal. My terminal source/bash/root name(my apologies, I dunno which is the right ...
60
votes
10answers
32k views

Why do I need to type `./` before executing a program in the current directory?

While executing a C program, a.out, using the Ubuntu terminal, why do I always need to type ./ before a.out, instead of just writing a.out? Is there solution for this?
0
votes
1answer
122 views

Why won't my script work?

umm my script isn't working and I don't know why, it gives me the error "update1.run: line 187: syntax error: unexpected end of file" Here's my code http://pastebin.com/4W4AwuY5 I would really ...
1
vote
2answers
307 views

Always use `-P` flag with `cd` command

How can I set -P flag to every cd command? I do that every time. There are LS flag environment variable which I could use for ls command so I wonder can -P be set as default?
5
votes
3answers
17k views

Proper way to add a user account via bash script

Here's the script code I'm using now: getent group $MYGROUP if [ $? -ne 0 ] ; then sudo su -c "groupadd $MYGROUP" fi sudo su -c "useradd mynewuser -p mypassword -m -g $PRIMARYGRP -G $MYGROUP" ...
1
vote
3answers
5k views

Run .sh script on Ubuntu without using terminal

I'm using Ubuntu and I've created a simple script file: #!/bin/bash cp /home/guilherme/pictures/*.jpg /home/guilherme/backup When I run it on terminal typing the command "./script.sh" it works ...
0
votes
0answers
23 views

Where to set environment variables for all users [duplicate]

Apologies in advance if this question is very simplistic! I have Ubuntu 12.04. I manually installed Maven by downloading the binary tarball file and extracting it to the /opt/ folder. I then set the ...
6
votes
1answer
380 views

Bind byobu window to Ctrl+Shift+T shortcut

Ctrl+Shift+T shortcut runs the gnome-terminal by default. I have installed byobu, and I want this shortcut to open the latest used byobu session. When pressed multiple times, I should still have just ...
0
votes
1answer
570 views

Does anyone know about avconv scripts?

I want an avconv script which automatically scans some of my directories and then checks for .avi files and then converts them to .mp4 and then deletes the .avi files when finished. I am not a bash ...
2
votes
2answers
136 views

How do I log out specific sessions?

I have read this these generic instructions to log users out, but I want more detail. When I run the command users I see multiple instances of the same user. IE: Joe Joe Joe Joe Joe How do I know ...
1
vote
2answers
2k views

find out the location of where a process was executed

I have a number of ruby processes running: ps -A | grep ruby 3518 ? 00:00:12 ruby 10316 ? 00:00:00 ruby 22400 pts/5 00:00:45 ruby 23332 ? 00:00:07 ruby I get the pid ...
4
votes
1answer
4k views

wait for dd command to fully write to the disk

I'm using the dd command to create a bootable usb from iso file: sudo dd if=~/Desktop/ubuntu.iso of=/dev/sdx bs=1M After pressing enter it momentarily exits and gives me: 915+0 records in 915+0 ...
2
votes
1answer
158 views

Function to change title doesn't work when run in script

I've got a simple command that sets the term title: # Allow the user to set the title. function title { PROMPT_COMMAND="echo -ne \"\033]0;$1 ($PWD)\007\"" } export -f title I'd like to access ...
1
vote
2answers
1k views

Can't find where scheduled task is set

I have a production server running a scheduled task that I simply can't track down. It seems that it is running dbdump.bash on a daily basis, but none of the cron files have a reference to that or ...
5
votes
3answers
231 views

Using popd without removing last value

How can I get the behavior of using popd without actually popping the last directory off of the stack? In other words, I want to navigate back to the last directory that I set with pushd, but I want ...
1
vote
2answers
440 views

Show just two lines in lm-sensors

I want to add lm-sensors to my conky setup, but it always shows this: coretemp-isa-0000 Adapter: ISA adapter Physical id 0: +41.0°C (high = +82.0°C, crit = +102.0°C) Core 0: +41.0°C (high ...
0
votes
1answer
59 views

Controlling a loop and saving the output for each event

How can I control a loop and read live feed from a usb port and save each of the output when the usb is inserted or removed. I know the code below can be improved, please assist. #!/bin/bash ...
1
vote
1answer
102 views

Compare files script

I am using this script to find information stored in one file using other file as a source for variables to look for: #!/bin/bash clear ...
1
vote
1answer
2k views

Launch rails webrick server at startup

I want webrick running at startup. So I execute this command in terminal: crontab -e Then added this line to the end of the file @reboot /home/myname/.rvm/rubies/ruby-2.0.0-head/bin/ruby ...
4
votes
1answer
751 views

Arrow keys in Terminal shortcut don't work

I am new to Linux and am using Ubuntu 13.04. I have a C++ program named "dictionary" (full path: /home/anmol/Desktop/c++/dictionary), which I compiled with Code::Blocks IDE (and GCC version 4.7.3). ...
11
votes
4answers
8k views

How do I set the prompt to use two colors?

One thing I liked about Mint was that the terminal would usually show two colors: everything from the left to the $ would be one color, and everything past the $ would be another. Is there a way to ...
5
votes
3answers
2k views

Going to the parent directory of a file with cd?

I am writing a .sh to do some work for me, but I am now at the point where I have to cd to the directory the file /path/to/file.end is in. terminal doesn't allow cd /path/to/file.end bash: cd: ...