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

learn more… | top users | synonyms (1)

1
vote
1answer
157 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
60 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: /usr/bin/...
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
1k 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
190 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
268 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
444 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 ...
2
votes
1answer
292 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
1answer
1k 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 perfectly....
1
vote
2answers
2k 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
394 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 ...
3
votes
1answer
72 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
1k 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
124 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
0
votes
1answer
55 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
0answers
130 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
339 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
1answer
76 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
111 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 ...
82
votes
2answers
31k 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
0
votes
2answers
1k 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 ...
2
votes
1answer
133 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
2k 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
169 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
1answer
110 views

Text appearing on top whenever I open terminal

Whenever I open my terminal I get this text at the top: bash: export: `PATH-/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ethiojob/workspace/Android/...
1
vote
1answer
65 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
81 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, ...
2
votes
2answers
17k 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 ...
1
vote
0answers
28 views

Ubuntu Server 14.04 - won't run bash script file from desktop [duplicate]

I know there are tons of this question on here already but none of them seem to have solved my issue. I've done a clean install of 14.04 Server and install Unity (I know, boss asked for it so he can ...
0
votes
1answer
243 views

Change bash title to show truncated pwd [duplicate]

I use tilda as my terminal on Ubunut 14.10. The trouble I have is that I want to have the tab bar, since the titles in it are actually useful for navigation, but having username@computer:~/some/folder ...
1
vote
2answers
1k views

How to set and unset a global proxy with only one command

I want to set the proxy for apt-get and the global proxy in xubuntu like here but with only one command. How would it be? What's the problem with this code? I save it in ~/.functions add the line . ~/....
4
votes
2answers
9k views

How to set a proxy for terminal?

I am looking to set a proxy for terminal. What I need is I want to send all terminal communications to the internet through a proxy, say tor. I tried to set a system wide proxy set up. But Terminal ...
0
votes
1answer
57 views

Concatenate a variable onto the end of another variable or string in Bash

I need to create many variables that begin with "precip" followed by a dynamic string which is a read in variable. I read this variable in, let's say its "1971" and then I increment it by 5 a bunch ...
2
votes
1answer
9k views

/bin/bash: g++: command not found error 127

I was trying to install a software quicknet from a tar.gz file. After using ./configure when i tried using make it showed the following erroe g++ -I. -I. -c QN_args.cc /bin/bash: g++: command not ...
0
votes
2answers
66 views

Whitespace Problems With Script and Variables

I'm trying to beat my head against the syntax of this. I'm getting problems with whitespaces and I can't see if there's a better way to do this. vardir=/home/user cd $vardir for i in $(ls "$vardir") ;...
44
votes
3answers
55k views

apt-get autocomplete package name is broken

At some moment apt-get install autocomplete was broken It was very useful to me to see packages name with Tab press How to repair this autocomplete?
0
votes
1answer
208 views

type command in bash

I'm learning bash and while trying the "type" command with an argument like "cd" (type cd)which should return cd is a shell builtin but it throws no such file or directory. What could be the ...
1
vote
2answers
114 views

sudo dpkg fails when trying to install wifi driver (on mac)

I finally created a persistent USB that runs on Mac, after a couple of weeks of failure after failure. However, now, I've run into the problem that the wifi doesn't work (because Ubuntu doesn't have ...
2
votes
6answers
632 views

Concealing long paths in variables in Bash

I have to move files from one folder to another but they reside in totally different paths. The destination path is so long and complicated that I am not able to remember it. Is there any way to go ...
0
votes
1answer
948 views

How to recover a deleted Folder(/Desktop in this case)

I have accidentally deleted(in a way) or I can say dislocated reference to my /home/user/Desktop directory , Is there any way to undo what I have done. The following Describes what I have done $ cp ...
0
votes
1answer
283 views

bash- Control-C behavior (^C) / gksudo vs sudo

This is about how the ctrl+c key press has a different effect when performed to a gksudo instance as opposed to a sudo instance. I executed the following using gksudo to read an installation failure ...
0
votes
1answer
28 views

Partition not loading automatically - Ubuntu [duplicate]

So I store my websites on a partition of my laptops hard drive. Programs and my bash scripts say that this partition does not exist, until I personally open the partition up by clicking the icon on ...
0
votes
0answers
33 views

Adding a file/directory to a specific location (on the Desktop) [duplicate]

I use Ubuntu 14.04.(Unity Desktop Environment) I like to use a specific part of my desktop(the screen) to store files related to my current work, and certain other spaces to store images and others. ...
2
votes
2answers
221 views

bash command starts new process

I have noticed that whenever I just execute the command bash in Terminal that it appears to have executed successfully with no output. I have also noticed that then when I want to close Terminal I ...
1
vote
3answers
490 views

How can I input to a file directly from the terminal

Other than bringing up a text editor, is there a way I can input text in a linux terminal directly to a file? (then enter a control code such as ctrl-c, to end the input) I'm pretty sure there's a ...
23
votes
2answers
24k views

Shell does not show typed in commands, “reset” works, but what happened?

My problem is that the Bash shell stops showing the characters I type into it. It does read the commands though. I've come across this problem quite a few times and I don't understand what causes it. ...
0
votes
2answers
319 views

How to find and replace word or character in paragraph using bash script?

I want to write a script which take input as a paragraph. In that paragraph I want to find and replace a word or a character provide by the user and display the new paragraph with the changes. I also ...
1
vote
2answers
147 views

bash sorting multiple duplicate strings in a file

I have file like below: Personname:Mark Hobby:chess Hobby:tennis Personname:Tom Hobby:swimming Hobby:badminton Hobby:boxing Hobby:music Personname:Nick Hobby:swimming Personname:fabio Hobby:swimming ...
2
votes
1answer
374 views

Can simple scripts use GUI file manager to select file?

I have an extremely simple script that currently executes a command on a file located in the same folder: command ./file_in_folder option output. It would be better if script asks user which file they ...