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

learn more… | top users | synonyms (1)

5
votes
3answers
7k views

Ubuntu 14.04 not running Bash scripts in /etc/cron.daily

I have a few scripts (that currently run in a CentOS system) I have moved to a new Ubuntu 14.04 system. These scripts are in the /etc/cron.daily to run once a day. These scripts are to run at the ...
0
votes
1answer
20 views

how to write c program code to display directories in linux terminl

i want a c program to get all the directories from bash terminal.also i need to color different types of files in different colors. eg:-executable files should b displayed in green color, ...
0
votes
1answer
14 views

MySQL Crontab Check

I have a serverpilot.io server running from digitalocean (1gb Ram), MySQL will crash once a week, the stats say the server is using ~256 mb out of 1 gb, but mysql will crash saying out of memory.... ...
2
votes
3answers
169 views

How can I discover where apt-get has installed applications?

I have installed 2 development tools named maven and ant using this command: sudo apt-get install maven ant How can I discover what are the installation directories for these tools on my system?
0
votes
0answers
20 views

.desktop launches app with custom icon. why not shell?

I have a .desktop file that launches an app, and it uses the .desktop icon: [Desktop Entry] Name=My Ro Type=Application Comment=Web Application Exec=/path/to/myapp -test Icon=/opt/giteye/icon.xpm ...
0
votes
3answers
50 views

Use of the Rename Command

I have a two part question. I have a series of files with the names "file.pdb.#", where # is an integer. 1.) How can I script to rename all the "file.pdb.#" to "file_#.pdb", where the integer is ...
2
votes
2answers
38 views

How to set JAVA_HOME for all users for “elasticsearch” program?

I'm trying to set JAVA_HOME for elasticsearch but no luck till now. I tried to set it in .bashrc, etc/environment, etc/.profile all fail. this is the command I use to run elasticsearch: sudo ...
68
votes
6answers
130k views

How can I decode a base64 string from the command line?

I would like to write a bash script to decode a base64 string. For example I type decode QWxhZGRpbjpvcGVuIHNlc2FtZQ== and it prints Aladdin:open sesame and returns to the prompt. So far I have tried ...
0
votes
1answer
20 views

Bash Script to search a webpage

I've Googled my problem, and it's getting more confusing. I want to write a bash script that will search this page for a specific string and echo if it's found. For example, if I wanted to search ...
0
votes
1answer
20 views

How to set a permanent environment variable?

I am not yet a Linux guy and I have some problem trying to add a new permanent environment variable. So I have to set a new environment variable named CATALINA_HOME with this value: ...
1
vote
2answers
4k views

How to use Bash Script to open URLs in a different profile with Firefox?

Working on a script to automate some tasks in Firefox. These tasks should run through a clean Firefox profile, so they are fast and don't interfere with any of my regular surfing. #!/bin/bash # ...
0
votes
1answer
23 views

Rotate binary files

I'm trying to solve a problem with rotating binary files. I have video files which are recorded from IP camera, and I want to delete oldest files when I have less then e.g. 10 Gb of free space. ...
1
vote
0answers
9 views

Automatically switch to Singstar Microphones when they're plugged in

I am running a media computer for my sharehouse and since singstar has been so popular I want to run Ultrastar for everyone too. The problem is that getting the microphones set up can be finicky and ...
0
votes
0answers
33 views

Script for Opening Two Terminals and Execute Three Consecutive Commands [duplicate]

I intent to open two terminals and execute three consecutive commands in bash script. Basically, the first terminal will execute first command, second terminal will execute second command, and back ...
0
votes
1answer
61 views

A bash script to show logged off users [on hold]

Please help me create a bash script to show logged off users. It's easy to know which users are logged into a PC, the problem is to see those who are not, I have some time looking online, without ...
0
votes
1answer
5k views

when building u-boot /bin/bash: arm-none-linux-gnueabi-gcc: command not found

I am currently running Ubuntu 12.0.4 on a 64 bit machine. I have an AM335X development board. Along with the kit came the compressed kernel (linux 3,2), rootfs, u-boot, and ARM cross compiler ...
1
vote
0answers
28 views

Different results of 'ps aux | grep x' if entered manually and done via script

It was probably a bad method, but I was running ps aux | grep x | wc -l as part of the if statement in a script. When I ran this from the command line as a regular user, the result would be 1 if the ...
0
votes
0answers
17 views

Sorry, user is not allowed to execute X as root on lt

Whenever I try to run a command from the termainal as sudo, I am now getting the error: Sorry, user {user} is not allowed to execute {command} as root on lt. lt is the name of my computer. The only ...
11
votes
2answers
437 views

Non-sudo alternative to /usr/local/bin for common scripts

I'm used to putting common scripts in /usr/local/bin so that I can execute them from anywhere with the terminal. For example, I make a shell script named 1, make it executable with chmod +x 1 and put ...
2
votes
1answer
31 views

How can I be sure “apt-get install” successfully finished its work?

I have Ubuntu 14.04 and I intend to download Skyrim. So I put the command into the terminal sudo apt-get install playonlinux. Everything was loading fine and it seemed to be working, however before ...
0
votes
0answers
33 views

What is wrong with my code so far? [on hold]

I'm attempting to make a DNA translation script in bash that will take an input file, iterate through the file, and convert every three characters into the proper protein code it corresponds to. Thus ...
0
votes
0answers
10 views

Installing YADR on Ubuntu 14.04 error - prezto: old shell detected

I have a fresh install of Ubuntu 14.04 on VirtualBox, and I am trying to install YADR (https://github.com/skwp/dotfiles), which works really well on Mac OS X. However, after I finished installing and ...
0
votes
0answers
12 views

Standard LXC Container configs for shell scripting in Ubuntu?

I would like to do computation in neutral environment. I got a tip about Linux containers here. I am not sure how this project about Linux containers is managed, like who is the central board. ...
3
votes
1answer
92 views

How to have a video player resume from where I last left off?

I'd like to be able to launch a video player (VLC, SMPlayer) via Terminal, using some command like resume_media and then it will automatically find the most recently played media file (.mkv, mp4 etc.) ...
1
vote
1answer
35 views

Shell script to remove unity launcher(if present in Ubuntu 14.04 ) and/or the xfce panel (in the case of xubuntu)

Just want shell script to remove unity launcher(if present in Ubuntu 14.04 ) and/or the xfce panel (in the case of xubuntu). If anybody has idea about the same then please let me know. Thanks
1
vote
3answers
37 views

Remove whitespace from all array elements

I have a array called arrayvar . Which is being defined as arrayvar=( $(awk '/'"$vovar"'/,/}/ {gsub("'"$vovar"'"," "); gsub("}"," "); gsub("{"," ");gsub(","," ");print}' temp1 | tr -d '\n' | sed ...
1
vote
1answer
30 views

Storing some strings in a array

I have this sCSISmart1 TRAP-TYPE ENTERPRISE cyclone VARIABLES {cycHostAdapterNumber, cycHostAdapterID, cycManagerID} DESCRIPTION ...
-1
votes
0answers
24 views

Script does not run properly under cron - restart OpenVPN

I have a OpenVPN Server, that I connect via a VM (Ubuntu 14.04). In this VM I have the following script, that checks if the connection is up, and then if it's down, it restarts the openvpn service. ...
2
votes
1answer
380 views

How to remove element from gsettings array in script?

Array in dbus/gsettings has a format [element1, element2, element3, ...]. Gsettings' interface allows only replacing existing array with another, so for instance, adding another item element can be ...
0
votes
0answers
10 views

I want to allot ip adress using script file [on hold]

I want to allot ip adress using script file in my C Program ,i.e. by writing the ifconfig command in the bash file and calling it. Pls help how to achieve this.
0
votes
0answers
17 views

How to set environment variables for GUI program?

I am using texstudio, a latex editor, on Ubuntu 14.04. When I start it from bash $ texstudio, and click the compile button, it works fine. However, if I start it by clicking the icon in the launcher, ...
1
vote
1answer
24 views

How to use shell variables after doing sudo su

I am writing a script to fix a missing 'F' letter in a mail log file. The mail log file is continuously updating. I am getting a file name, after that I am doing 'sudo su' to get superuser access. ...
8
votes
5answers
3k views

How to alias 'git' to 'g' so that bash-completion rules are preserved?

If I do this: alias g='git' I loose all completion rules (i.e. branches and remotes are no longer being automatically completed when I hit TAB after typing, for example g push o).
0
votes
0answers
25 views

Using sed to remove all lines containing special characters , numbers, and spaces

So I'm fairly new to using shell--bash specifically--and I'm in the process of writing a script which will translate files containing DNA sequences into a more useful format. Unfortunately, many of ...
0
votes
1answer
6k views

“Text File Busy” when running a simple script on bash

When I make a simple script, I get "Text File Busy" when I try to run it. dbell@det-ui-supergbe:~$ cat > test2 ls ^Z [2]+ Stopped cat > test2 dbell@det-ui-supergbe:~$ chmod a+x ...
0
votes
3answers
45 views

Add particular strings to an array sed/awk/grep

I have this ciscoFlashCopyStatus OBJECT-TYPE SYNTAX INTEGER { copyOperationPending(0), copyInProgress(1), ...
1
vote
1answer
24 views

core file size with ulimit

My question is probably not related to Ubuntu in particular, but since my desktop running this OS, I came to this forum. I am trying to change the core file size using ulimit -c command as follows: ...
2
votes
2answers
124 views

How do I write a Bash script for this scenario?

I have these files in the directory home/acs. TBBN027162G_38d8-2f08-0c40 TBBN027605G_38d8-2f08-1518 TBBN027941G_38d8-2f08-0d1c TBBN027923G_38d8-2f08-35e4 I want to read TBBN027162G as service_id ...
2
votes
2answers
177 views

How to cancel next job in order after rsync

If two jobs are entered into bash command line separated by semicolon: $ job 1; job 2; How do I cancel the second one? If I press CTRL+c, the first one will be canceled and 'job 2' would start, I ...
2
votes
1answer
24 views

Passing Variable into awk gsub

I have this command Here vovar=OBJECTS prvar="$(awk '/'"$vovar"'/,/}/ {gsub("$vovar"," "); gsub("}",": %s,"); gsub("{"," ");gsub(",",": %s,");print}' temp1)" Contents of temp1 ...
6
votes
5answers
269 views

How do I delete everything after second occurrence of quotes using the command line?

I have this store in a variable sCellEventTrap-03-28 TRAP-TYPE -- CAC Code: 00 ENTERPRISE compaq VARIABLES { scellNameDateTime, scellSWComponent, ...
0
votes
0answers
20 views

Ubuntu 14.04 desktop goes to sleep when issued “poweroff” command while lid closed?

My ubuntu version is 14.04 LTS. I used the following command to shutdown the system after a certain process was completed (This process takes a long time to complete, so I needed a way to ...
7
votes
1answer
97 views

How can I send commands to specific terminal windows?

I'd like to write a script for opening multiple programs (servers) simultanously in separate terminals - doesn't matter which one - and assign different commands to different terminals with commands ...
4
votes
3answers
262 views

How can I pipe the output of a bash or shell command to the clip board? [duplicate]

In order to minimize mouse usage (accessibility and health reasons), how can I pipe the standard out to the OS clip board? That is, I'd like to do something like: $ drush uli | ...
0
votes
0answers
11 views

How can I tackle a pager formatting trouble with (certain) man outputs?

I ran into something that made me suddenly 25 years younger today. (Wish this could happen more often.) That long ago it was troff that occasionally did this; now see: $ man man -> normal output to ...
0
votes
0answers
14 views

Getting Rid of Autojump

I just removed autojump and I still get this line whenever I access my command terminal: bash: /usr/share/autojump/autojump.sh: No such file or directory I used sudo rm -rf autojump as my primary ...
0
votes
2answers
47 views

create scatter plot

file (1. arg) will create (scatter plot) for n. column (x-axis, 2. arg) and m. column (y-axis, 3. arg) function is called myfun sourcefile 1 3 for scatter plot of 1. and 3. column from file ...
0
votes
2answers
20 views

appends n-th line from the file x at the end of the file y

I have been asked to write a command that appends the n-th line (MYN) from a file (x)to another file (y). Here's what I've done so far: MYN=4 hey=$(awk 'NR==$MYN' x) echo "$hey" >> y But why ...
2
votes
1answer
45 views

Print characters behind the digits

function/script, that for argument in format (alphas and digits) afa5hgt3tt, errerew9ax66w, prints characters behind the digits many times as value of digit, e.g. hgthgthgthgthgttttttt ...
0
votes
2answers
38 views

How to make a script delete a directory after checking for its existence?

How might one make a bash script which when run will check for the existence of a file/folder and if the file/folder is there remove it?