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

learn more… | top users | synonyms (1)

2
votes
1answer
95 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
571 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
577 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
97 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
267 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 ...
4
votes
2answers
95 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
207 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
0answers
153 views

Tab completing directories when exporting variables in bash 4.2

I will start by mentioning this is a different issue (but perhaps related) to the escaping of dollar signs when tab completing variables. What I am trying to do is this. When exporting a variable ...
0
votes
1answer
44 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 ...
0
votes
1answer
83 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
1k 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 ...
3
votes
1answer
357 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). ...
7
votes
4answers
983 views

How do I set the prompt to use two colors?

However, 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 (green, I think), and every then past the $ would be ...
3
votes
2answers
2k views

Explanation of the chcon command

Hi could somebody explain this command. chcon -R --reference=/var/www/html/ /var/www/html/install I have read the explanation given in the book But I am unable to understand it clearly. Please use ...
4
votes
3answers
403 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: ...
0
votes
1answer
461 views

Zenity progress bar and output

I wrote this little script: response=$(process ...) | zenity --progress --pulsate echo $response I want read the response of the process, whatever it is, and show a pulsating progress bar in the ...
0
votes
2answers
285 views

Why syntax error near unexpected token `fi' is coming

This is my simple script but it is saying that syntax error near unexpected token `fi' mysql --user=root --password= erpint -B -e "select * from user_info;" | sed ...
0
votes
1answer
584 views

cryptsetup luksAddKey pipe

I hope this is the correct place to make this question. Anyway... I was trying to create a script to add a passphrase by piping it to the command luksAddKey with a script. When i try to pipe the "old" ...
5
votes
1answer
2k views

Open Terminal with multiple tabs and execute application

I am new to linux shell scripting. I want to write a shell script which will open terminal with multiple tabs; it should run rtsp client app in each tab. For this, I have gone through question here ...
0
votes
1answer
603 views

Script to email files content

I have created a shell script that takes backups everyday and emails its execution as successfull or unsuccessfull. Now I want that it send the contents of log file it creates with the mail as well. I ...
1
vote
2answers
2k views

bash command for each file in a folder

I have a set of files on which I would like to apply the same command and the output should contain the same name as the processed file but with a different extension. Currently I am doing rename ...
0
votes
2answers
316 views

Where should I add/modify environment variables?

I would like to edit my .bash_profile file. However it appears that in Ubuntu (and perhaps other Debian distros) this is named as .profile. However I cannot seem to find the expected variables like ...
2
votes
1answer
449 views

Why don't custom upstart job names tab complete in the service command?

I'm used to create upstart services with a file in /etc/init/<service>.conf and it works perfectly fine, the only thing I'd like to is to have tab completion the same way that every service in ...
0
votes
1answer
1k views

when I run a bash file manually, it works, but crontab can not run it?

This is my sh-file: http://paste.ubuntu.com/5816543/, that I use this to download youtube files in a specific period per day. when I drag the file (y.sh) into the terminal and press return key, it ...
2
votes
2answers
824 views

How can I run sudo gedit as gksu gedit

I'm looking into ways of automatically loading Gedit as gksu gedit when I enter sudo gedit by mistake? I have found that I have made a number of files unreachable by using gedit and I have only just ...
0
votes
1answer
443 views

How do I start bash in 13.04?

I have a bash script that I need to execute. It seems that I can't run in in my terminal because it has a slightly different syntax. I could run the first file like bash ./configure but it produces a ...
3
votes
2answers
580 views

How to create (via installer script) a task that will install my bash script so it runs on DE startup?

I've been reading for the last couple hours about Upstart, .xinitrc, .xsessions, rc.local, /etc/init.d/, /etc/xdg/autostart, @reboot in crontab and so many other things that I'm totally confused! ...
0
votes
1answer
178 views

Help with “advanced” shell scripting | how to create an image preview of a pdf

First of all, sorry for my english: i'm not british/american. Here is my problem. I've got a folder named pdf with lots of files pdf inside it. I've got another folder named thumbnail, which is ...
2
votes
2answers
3k views

Proper way to let user enter password for a bash script using only the GUI (with the terminal hidden)

I have made a bash script that uses kdialog exclusively for interacting with the user. It is launched from a ".desktop" file so the user never sees the terminal. It looks 100% like a GUI app (even ...
3
votes
2answers
226 views

rm if there's a file with same basename

Say I have the following files: foo.coffee foo.js bar.js Is there an easy way how to rm *.js if there's a corresponding .coffee file? In the example such a command would remove foo.js leaving: ...
0
votes
1answer
2k views

How to reset .bashrc file which edited before to set PATH ANDROID sdk

bash: export: `/home/entw/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local /bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/bin': not a valid identifier bash: /home/entw/.bashrc: line 111: ...
1
vote
1answer
178 views

Cron job bash script to restart desktop sharing?

I'm having trouble with desktop sharing crashing while during remote sessions. Is there a way to set cron to check and restart, if necessary, the desktop sharing application with a bash script?
1
vote
3answers
136 views

Rename music files so they alphabetically follow a playlist

I have a bunch of mp3s I've organised into a playlist for a party. What I'd like to be able to do is easily rename these files so that they start with the position in the playlist: 001.Track.mp3 ...
0
votes
4answers
77 views

Minutely cron job is not running

I added the line */1 * * * * /home/zach/test.sh to my crontab, where the contents of /home/zach/test.sh are as follows: touch /home/zach/test.txt Yet, no file test.txt is being created in that ...
2
votes
2answers
433 views

How to move unknown files to unknown directories based on folder name?

I am trying to write a script that will search a directory for a folder, and move the folders contents one directory up from their location. this is what i have so far: find ./localFolders -name ...
2
votes
2answers
97 views

Why usage of '*' doesn't always work on zsh?

I ran the following command on zsh sudo apt-get install rhythmbox* It produced an error, when I ran the same command in bash it worked. Why does this happen? How can I make the above command work ...
0
votes
1answer
315 views

Can I safely store and display a master password file with AES-encrypted file plus a few simple bash scripts?

I would like to set up a couple of bash scripts to encrypt and decrypt a master text file containing passwords for banking, work, etc. for the purpose of editing it and displaying the entries when I ...
1
vote
2answers
691 views

Why does cp not copy files?

$ ls -la /tee/mysql total 28675 drwxrwxrwx 1 root root 448 Jun 25 13:52 . drwxrwxrwx 1 root root 2896 Jun 25 12:12 .. -rwxrwxrwx 1 root root 18874368 Jun 25 13:19 ibdata1 -rwxrwxrwx 1 root ...
0
votes
1answer
100 views

AMD different ways to install drivers

I do not want to know how to install drivers but what the differences between 2 ways and which one is better. building deb files from *.run file sudo sh*.run --buildpkg Ubuntu/precise installing ...
3
votes
2answers
451 views

How can I make a list with most used commands in terminal?

How can I make a list with most used commands in terminal? I know that this question may be unuseful for any future proposals for some of us, but even like this, the list can be useful when we don't ...
0
votes
2answers
114 views

How to set environemt variable without rebooting Ubuntu?

Problem: During Android development, in order to add ADB path to environment variable; I did following things in short- gedit /etc/environment - Added my desired path in the file such as ...
0
votes
2answers
487 views

PATH-variable gets always reset. How to fix that?

A little time ago, I found out, that I can create custom commandterminals with expanding the PATH-variable. Unfortunately, it gets always resettet, when I close the terminal and opens it again. Do ...
13
votes
4answers
381 views

How to get shared bashed history among different tabs

I used the answer in http://unix.stackexchange.com/a/1292/41729 to enable real-time shared history among separate bash terminals. As explained in the answer above, this is achieved by adding: # avoid ...
1
vote
0answers
162 views

javac cannot found, even after adding non-standart path to it in $PATH

Ubuntu 12.10, 32bit Problem too damn simple: I have a NTFS partition and unpacked from .tar.gz jdk on it. All I need from bash, is to see javac compiler, that is located in directory ...
10
votes
1answer
846 views

How do I show a message with username and date at login?

How to show the message "hello $username, today's date is $date" as soon as you login to Ubuntu.
0
votes
2answers
1k views

Bash Script for custom message

I'm trying to send an email using bash script. I tried using the following in the bash script with no success as I execute the script it asks for CC: #!/bin/bash recipient="tarun@gmail.com" mail -s ...
1
vote
1answer
243 views

Stopwatch for command prompt?

Is there a stopwatch, so that I can measure time taken for different commands for BASH shell?
0
votes
0answers
211 views

Unable to launch vmware-view client at startup

I have written a script to launch vmware-view client at start-up and have followed the below steps and still it wouldn't launch. Please suggest. Please note that I am able to launch the app by adding ...
0
votes
1answer
339 views

problem with PATH when using $su

OK, I'm having a bit of an issue with PATH and running a process as another user under Ubuntu. First, we check where the bin is: root@host:~# whereis start-stop-daemon start-stop-daemon: ...
0
votes
2answers
1k views

Ubuntu adding path/Environment variables

I am trying to install apache maven 3 in Ubuntu 12.04 lts. What I did was open the terminal then I typed the following commands export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.5 [Then ...