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

learn more… | top users | synonyms (1)

0
votes
1answer
146 views

arecord flac format

I am playing with scripts that use the google speech-to-text api. The api requires flac encoded files so the recording part of the script looks like this: arecord -q -t wav -d 0 -f S16_LE -r 16000 | ...
0
votes
4answers
31 views

How would I create an alias to run a game?

How would I accomplish this? I want to type in runmc to run the command java -jar /root/.minecraft/launcher.jar. I already put the following into my .bashrc file alias runmc ="java -jar ...
0
votes
0answers
14 views

How to run an alias command with sudo

I created an alias called runmc that allows me to start up a java program. But I noticed that when I type in "sudo runmc" (It needs root access to work properly.), it will display "runmc: command not ...
2
votes
1answer
34 views

How can I run a script when the power supply is plugged-in or -out?

For some reason, my laptop's screen brightness does not update when I plug-in or plug-out the power supply. I've looked at quite a few solutions for that problem, but none of them seemed to work well. ...
0
votes
1answer
32 views

Script wont print my echo statement (Also need to suppress the warning)

I am trying to write a very simple shell script in Linux. The Scenario I am trying to achieve is: Creating an user account and giving it a password internally (No interaction with user allowed for ...
4
votes
1answer
154 views

How to prevent output from '&' and '>' operator (send to background operator and redirection operator)

I have tried various combinations of gedit, &, >/dev/null 2>/dev/null. When gedit is used with the other two it always prints something to the terminal. I understand that the numbers are ...
-2
votes
0answers
44 views

How to replace first string before first space [on hold]

NC_009925.1_13653 [754389 - 754574] Acaryochloris marina ATTCCTGATTCTCTTGATGAAAGTAACATTATGGATCAT... TATGATCCATTCAGGCATGATGCAAGGCGCTACCCCCAA... 110311 2992101 2992319 len=219 ...
10
votes
3answers
701 views

How to display the name of file which I am currently editing with vim on terminal title?

I am editing multiple files located in the same folder, in multiple tabs, on a single terminal. pwd(directory in which I am currently working) is displayed on the top of the heading of the terminal, ...
0
votes
3answers
42 views

Shortcut to execute shell scipt? [duplicate]

I'm trying to create a shortcut that will run a .sh file deep in some directory without having to navigating to the absolute path. I have tried using aliases, which did not work as. Using soft/hard ...
0
votes
0answers
8 views

Failure to contact privoxy proxy on ec2 node

I'm trying to set up a tor node following http://sickbits.net/creating-a-personal-privoxytorproxy-ec2-instance/ using ubuntu 14.4 lts on ec2. I'm using git-bash on win7. Following the directions, I ...
1
vote
1answer
25 views

bash script errors in ubuntu 14.04

I wrote a script whilst on ubuntu 12.04.5 which ran through fine however after upgrading to 14.04.2 to fix another issue i am now having issues with the script. It is halting at the first set of ...
0
votes
1answer
32 views

Problem with sudo via ssh

I'm using the following script to execute a update script on a certain number of servers in my network. Here is the part, which I think that is relevant. ### Actual Work ### if [[ $manual == 1 ]]; ...
3
votes
1answer
2k views

Typing commands into a terminal always returns “-bash: /usr/bin/python: is a directory”

I think I messed something up on my Ubuntu server while trying to upgrade to Python 2.7.2. Every time I type in a command that doesn't have a response, the default from bash is this: -bash: ...
0
votes
0answers
17 views

Pngquant returns error in Crontab [duplicate]

I have created a small script to compress all the images using pngquant in Ubuntu 14.04. The script is as follows: #!/bin/bash find /home/ghosthut/wp-content/uploads -mtime -2 -iname '*.png' -print0 ...
12
votes
2answers
646 views

Why “which” returns none on some commands I can run? [duplicate]

I used which to tell the location of a runnable file. For example, which pwd returns /bin/pwd. However, I found which alias or which compgen etc returns nothing. What are commands like alias? Aren't ...
0
votes
1answer
40 views

Excluding hidden files in locate

We have a Ubuntu NAS sharing SMB and Netatalk with some Macs and I often use locate to find my files. Unfortunately since installing Netatalk it has written tons of .AppleDouble cache files to share ...
0
votes
1answer
17 views

Cross fading several audio files using sox

I'm trying to cross-fade several audio files together with a 3 second cross-fade and join them together in to one file with sox. I can join several files together by the command below but not sure ...
1
vote
2answers
71 views

Wait for PID - shown in ps

I am using the command below in a script to wait for a PID and then do something when that process finishes: while ps -p [pid] > /dev/null; do sleep 1; done; [cmd] where [pid] is the PID of the ...
1
vote
0answers
21 views

If you install anaconda, how can you inactivate the anaconda environment?

I'm currently using Anaconda to get access to a "standard" set of packages on nearly any platform. The issue is, on the linux side of the house, my current approach is to tell the installer to ...
2
votes
1answer
27 views

Some error messages displayed when I start terminal (both as root and as normal user)

I recently installed Android Studio , and to make the changes permanent I changed the PATH environment variable in .bashrc file, as shown in Second answer of this link. I get following error ...
0
votes
0answers
18 views

Long view for tab completion?

Is there any way to show a long view (e.g., timestamp, permissions, filesize, etc) for tab completion of filenames in bash?
0
votes
1answer
29 views

Terminal shows black screen Ubuntu 14.04

When I open the terminal in my Ubuntu 14.04 LTS, it shows a black window with no buttons. Nothing's visible, not even the minimise or close button. However all the commands that I type, work ...
1
vote
0answers
38 views

Altering command to start application by mouse click - how to

I have Google Earth installed on my Ubuntu 14.04 (Trusty Tahr) and, in order to display clamped polygons on it, I have to start it with the command LIBGL_ALWAYS_SOFTWARE=1 googleearth. I would ...
0
votes
2answers
508 views

Image optimization with imageOptim using bash. How to get a summary

I am using imageOptim to optimize images on my server. It took me quite some time to learn rudimentary bash scripting to able to optimize all images in all my first level directories. My script looks ...
1
vote
0answers
25 views

Randomizing host name and mac address on boot

I'm trying to set up a startup script to randomize my hostname and mac address on boot. Here is the script http://pastebin.com/qatdtbVH The random mac address is working fine, but the hostname ...
2
votes
1answer
34 views

What mean numbers in output of history

Output of history command looks like this: 1975 mkdir adrnln/work_dump 1976 ls 1977 code What does numbers on the left side mean? Is it true that commands entered for example on Monday will be ...
0
votes
2answers
44 views

Sleep time variable from file?

I am wanting to know is it possible to have sleep in a bash script have a variable time that is read from a file? I am wanting to perform operations in the script that vary in length that will have ...
0
votes
2answers
37 views

Compare names of files in two directories in command-line

Is it possible to compare names of files in two directories? I need to get information about how many similar and how many different names of files in directory some_directory and other_directory
2
votes
1answer
8k views

Tomcat Installation startup.sh not working

So I've followed the list of steps on : https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04. When I try to run the startup script, I get this message: ...
7
votes
5answers
4k views

How to compare two files

So basically what I want to do is compare two file by line by column 2. How could I accomplish this? File_1.txt: User1 US User2 US User3 US File_2.txt: User1 US User2 US User3 NG Output_File: ...
0
votes
1answer
19 views

error when processing package bash

When upgrading I keep on encountering an error with the bash package. This is the result I get. dpkg: error processing package bash (--configure): package is in a very bad inconsistent state; you ...
1
vote
3answers
14k views

Bash - 'if' statement: compare two strings

I would like to make a script that deletes a directory with rmdir after confirming with a password using read to set the variable. So far I have this: #!/bin/bash -x echo "Password:" read -t 30 S1 ...
1
vote
0answers
34 views

How to automate configuration of legacy wireless drivers during installation

Perhaps the most common roadblock in deploying Linux on donated machinery is getting them to access the wireless network, due to the known issues with supporting legacy Broadcom drivers. Instead of ...
3
votes
1answer
174 views

Bash script works from command line, but not if started by upstart

I have a script that listens on port 12 and invokes xbmc when receiving a wol packet. It works perfectly fine when I launch the script directly from the command line, but nothing happens when I let ...
1
vote
0answers
16 views

How to compile Zoneminder source files

I'm trying to make a video surveillance system with my Raspberry Pi (running raspbian) using Zoneminder. Default action of Zoneminder is only to send an e-mail but I want also to run a script which ...
1
vote
1answer
21 views

Why I cant see password prompt when .profile executes?

I want to use keychain for SSH cron jobs. I've found this good answer. I've add command keychain --nogui id_rsa in .profile And when I reboot and login I have to enter password. But I don't see any ...
0
votes
1answer
30 views

Sourcing a script from another script fails

I have a script in a file - install.sh - with this content: #!/bin/bash wget https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.sh sh kvminstall.sh source ~/.kre/kvm/kvm.sh Everything ...
49
votes
2answers
16k views

What is the difference between “source” and “.” in bash?

As the question says, what is the difference between executing a script with source command and with . , i.e.: source /some/script and . /some/script
54
votes
5answers
37k views

Which one is better: using ; or && to execute multiple commands in one line?

In tutorials and how-to's I often see commands combined. For instance, sudo apt-get update && sudo apt-get install pyrenamer There seem to be four possible connectors: &, &&, || ...
0
votes
2answers
46 views

Custom Daily and Weekly Cron Jobs Not Running

I created a script to back up my databases and my websites. It runs fine if I run it straight up but it's not running at all as a cron job. I created a symbolic link to the script: lrwxrwxrwx 1 root ...
3
votes
1answer
31 views

I want to print a user specified number of labels without opening Libreoffice

I'm using Ubuntu in a restaurant. In this case I'm using a Brother label printer to print "Use By" date labels. To print one I can use the command libreoffice -p ~/Desktop/TestLabel.odt I have this ...
3
votes
2answers
996 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 ...
0
votes
2answers
33 views

.sh command not working in a desktop launcher

I'm using a desktop launcher to run a.sh script. In a.sh I'm calling another script b.sh using another user using this command sudo -u userB /home/userA/Documents/b.sh. But for some reason it's ...
0
votes
0answers
26 views

Running cron scripts with php and node

I've gone through many posts for cron jobs, but still was unable to run it on my Ubuntu 14.04 environment. I have a file test.sh in /tmp/test/. The test.sh contains several other scripts in PHP and ...
7
votes
2answers
3k views

How to replace a string on the 5th line of multiple text files?

I want to replace the 5th line of multiple text files (file1.txt,file2.txt,file3.txt,file4.txt) with the string " Good Morning " using a single terminal command. All the text files are located on my ...
0
votes
1answer
38 views

Text appearing on top whenever I open terminal

Whenever I open my terminal I get this text at the top: bash: export: ...
1
vote
1answer
23 views

Awk variable passing question

This is the code I wrote to resolve DNSs and output to a file. Is there a way to forgo the while loop entirely and just write in awk? It works perfectly but it seems very cumbersome and inefficient, ...
0
votes
2answers
38 views

App is accessible through Unity Launcher but can't access through terminal

I had installed Sublime Text 3 a few months back, and using some online resource I had made it accessible through Unity Launcher(unfortunately, I don't remember which resource, or how I did it). So, ...
0
votes
1answer
40 views

SOLVED prefix command error

When open Terminal I get this error ERROR: Directory [=] does not exist. The prefix script allows you to manage multiple installations of a set of software installed on the same machine. It helps ...
1
vote
2answers
9k views

How to get line number from grep?

the fallowing grep grep -r -e -n coll * will display fullpath/filename: <tag-name>coll</tag-name> I would like to know what line has the fallowing text, I tried adding -n, but it ...