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

learn more… | top users | synonyms (1)

0
votes
2answers
13 views

Why does cp not copy a specified folder

let's say that I have a following file structure: ~/DIR1 -fileA -DIR2 --fileB Then, being in ~, I run this script: cp DIR1 NEWDIR2 And just an error happens: cp: omitting directory ‘DIR1’ I ...
1
vote
1answer
18 views

“cd” redefinition causes infinite loop in bash

I redefined "cd" in my .bashrc to: function cd() { builtin cd $* pwd } This worked for a while, until I mistyped cd *2 as cd *(2 When I did that, bash prompted me, I went "d'oh", and when ...
-1
votes
0answers
9 views

Shell scripting for date intervals

How can write a shell script (e.g. bash) that calculates the difference between two entered dates?
1
vote
1answer
37 views

Permission denied [on hold]

I am using Ubuntu 14.04 linux and 64 bit pc. Whatever I try to install through terminal am getting the following error bash: /home/vinod/android-sdk-linux/tools/android: Permission denied
0
votes
1answer
43 views

What does cd [-L] [-P] [-e] [-@] do?

Out of curiosity I typed cd --help to see if there were any extra things you can do with changing directory, and it came up with cd: usage: cd [-L|[-P [-e]] [-@]] [dir] What does each option do? I ...
0
votes
2answers
27 views

Bash Syntax error while using 'source' command in Ubuntu 14.04

The error message displayed in my terminal has been pasted below. sarvotham@ramanPC:~$ source("http://bioconductor.org/biocLite.R") bash: syntax error near unexpected token ...
0
votes
0answers
17 views

How can I truly clear a terminal window? [duplicate]

When I run clear in the terminal, the tab appears to be cleared of text, with only a fresh command prompt visible in the top left corner. However, the scrollbar is still active and if I scroll up, I ...
0
votes
2answers
41 views

How to create the command in bash? [on hold]

Are there ways to create my own command in bash, except copy of the script in the /bin and create an alias?
2
votes
2answers
112 views

Pipe file to gnome-open command

For example I want to open a specific book from Books directory. To find it I do ls | grep -i 'book_i_want' Ideally I would like to add next pipe with command, like this: ls | grep -i 'some_book' | ...
0
votes
1answer
33 views

How to Perform operations on files or directories with dashes or hyphens? [on hold]

My question is that I was trying to rename a file named 12F-XYZ.pdf to 13F-XYX_ABX.pdf. Now the problem that rises is that both of hyphen the original and the required names have hyphens I know that ...
0
votes
0answers
20 views

Bash cursor graphical bug in ubuntu 14.10

For the past few weeks (I'm not exactly sure on the timeframe, but I think it coincides with me upgrading to Ubuntu 14.10) I've had an issue with my terminal where, while typing, the white cursor ...
2
votes
1answer
104 views

Bash script, arithmetic with floating point variables / strings that represent them

I'm trying to create a simple script that takes an average load percentage of the CPU each minute. I'm doing this by using the sar command from the sysstat package. Here is my current code: ...
1
vote
1answer
17 views

Alias for gnome-open to open different files

I want to make alias for gnome-open so I be able to open files with command opn somefile.doc How can I pass filename with this alias?
3
votes
1answer
141 views

How to find a place where a constant is defined in Bash

I need to find at least a file where $JAVA_HOME is defined (exported). Is there any smart way to do that besides text search in files?
0
votes
1answer
19 views

How to get help on a specific option of a command [duplicate]

I guess the title says it all. I know I can get help on a specific command, for example wget, like this: wget --help But how can I get help on some specific option of that command? For example, I ...
8
votes
3answers
328 views

Pre-define colors for Terminal?

I was trying to remember how I could pre-define colors inside of .bashrc file so they could be called on when I do ${RED} for example. I can't remember if this was the right way of doing it, but it ...
0
votes
0answers
14 views

see how much virtual memory is assigned to a process-bash

I have written a script which assigns virtual or "simulated" memory to a process that I have created. What I want to know is, how can I then list how much memory the process has? I want it to return ...
0
votes
0answers
9 views

Cloning Ubuntu 14.10 installations

I need to use a range of Cloud VPS providers to run servers across the world. The first batch of providers is Vultr, DigitalOcean and DimensionData. Each of them offer the ability to create ...
1
vote
1answer
65 views

Is it possible to run stress at the same time as vmstat/iostat etc?

I have written two scripts-one to stress the system and one to run vmstat etc. I am able to get the file outputs for vmstat etc but am not able to get the ones for stress as it tells me that the file ...
2
votes
1answer
34 views

Execute a shell script only for LiveCD session [on hold]

I want to execute a shell script on startup but only for LiveCD session not for harddisk installation. Which directory should I put my shell script? For example Ubuntu somehow detecting LiveCD ...
0
votes
1answer
12 views

Having trouble running setup-environment (YOCTO) in a ubuntu 32-bit VM

I am running a 32-bit Ubuntu in VirtualBox on my i7-64 bit System and was following steps to build YOCTO; In the process, I have to run the following command $ MACHINE=smarch-samx6i ...
0
votes
0answers
21 views

How to run an alias command with sudo [duplicate]

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 ...
0
votes
4answers
44 views

How would I create an alias to run a game? (Minecraft)

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 ...
3
votes
1answer
50 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
34 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
159 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
45 views

How to replace first string before first space [closed]

NC_009925.1_13653 [754389 - 754574] Acaryochloris marina ATTCCTGATTCTCTTGATGAAAGTAACATTATGGATCAT... TATGATCCATTCAGGCATGATGCAAGGCGCTACCCCCAA... 110311 2992101 2992319 len=219 ...
0
votes
3answers
45 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
11 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
27 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
33 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 ]]; ...
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 ...
0
votes
1answer
41 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 ...
1
vote
2answers
75 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 ...
0
votes
1answer
20 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
0answers
22 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
30 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
35 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
32 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 ...
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
39 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
35 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
46 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
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
0answers
37 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 ...
1
vote
1answer
23 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 ...
1
vote
0answers
18 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 ...
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 ...
0
votes
2answers
48 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 ...