0
votes
0answers
12 views

Temporarily switch Java version in bash script- Ubuntu Linux

I'm using the Java keytool as part of a larger bash script. I need to pass in a password to create a keystore, so used the command keytool -importkeystore -deststorepass:file ${somefile}. This ...
0
votes
1answer
27 views

Ubuntu equivalent command to Windows tasklist command

I have a couple lines in PHP to check if a specific process is currently running on my server. If the process is running, I include a script that is used in to interact with said process. Below is the ...
0
votes
1answer
17 views

.bash_history does not exist

Working in AWS I created an instance of Ubuntu 14.04 and noticed the history was not preserved between login sessions. Further investigation showed the .bash_history file did not exist. Why was a ...
0
votes
1answer
23 views

bash auto-complete separates strings

Let's say I'd like to cd to the directory containing all albums by the artist "The Ghost of a Saber Tooth Tiger" so I start typing cd ~/Music/The\ Ghost and hit [TAB] [TAB]. At this point bash ...
0
votes
2answers
50 views

How do i get the playing song details(title - artist- album.. etc) in ubuntu

When i play a song in ubuntu whether from banshee or spotify or any other music player, the song shows up in the sound indicator menu. How can i get the details of the playing song from the ...
0
votes
2answers
37 views

Is there any reason this cronjob would fail in cron, but not on the command line?

I have written a little one liner that will email me when a list of files changes - I used sha512 to generate a list of hashes and then periodically check that those hashes still match. */5 * * ...
0
votes
1answer
46 views

Enter response once prompt returns?

It's neither a secure idea nor one I'd recommend elsewhere, but I have a situation when occasionally it takes a while for my Ansible ad-hoc command to respond. I'd love to pipe or args or whatever is ...
0
votes
2answers
36 views

Files listed by bash but unaccessible

What would cause the following behavior on an Ubuntu 12.04 system? I've SSHed into a machine as the "ubuntu" user. Running ls -lah /data/* shows dozens of non-empty files (e.g. file1.txt, file2.txt, ...
1
vote
1answer
31 views

Run sed as a one-off ssh command

I would like to substitute a string with another in a file on a server of mine. I've tried doing this: ssh $REMOTE_HOST sed 's|export ${KEY}=${VAL}|export ${KEY}=${NEW_VAL}|' "$ENV_FILE" And a ...
2
votes
1answer
38 views

Hook into “command not found” handler in Ubuntu

I want to hook into the handler for command not found wim@SDFA100461C:~$ thing No command 'thing' found, did you mean: Command 'tping' from package 'lam-runtime' (universe) Command 'thin' from ...
0
votes
1answer
69 views

screen capture full webpage rendered with firefox or chrome

i'm trying to think of a solution that will let me take full page screen shot of a website via a bash script. so far i have tried gnome-web-photo but it doesn't render the webpages correctly. next i ...
0
votes
0answers
28 views

Start terminator terminal in a free spot on my screen

When I start the default Ubuntu terminal, it automatically puts the new terminal in a spot on the screen where no other terminals are there. Now I set terminator as my default terminal. But whenever ...
1
vote
1answer
59 views

How can I determine via command-line if VBox Guest Additions has been installed?

In particular, I need to know in order to write a bash script to prompt the user to install VBox Guest Additions on a Ubuntu client if it hasn't already been installed.
1
vote
1answer
51 views

Detaching from a GNU Screen suddenly clears the terminal

I feel so stupid for asking this, but here goes: I updated my Ubuntu (Server) install today from 13.10 to 14.04. Before the upgrade detaching from screen did not clear the terminal and now it does. ...
0
votes
1answer
25 views

Removing files and directories that already exist in other directories

I need a help writing a script. So basically I have directories named by current date, like 01-06-2014 02-06-2014 and so on each of these directories has files and subdirectories inside. But sometimes ...
0
votes
1answer
59 views

How can I install my script into the user's $HOME/.bin (or $HOME/bin) directory and make sure that is in their PATH?

Edit: places where I said $HOME/.bin I should have written $HOME/bin or any equivalent is fine. So I have a bash script which I am distributing as a client for my API. Current version installs like ...
1
vote
1answer
133 views

sequential SSH command execution not working in Ubuntu/Bash

My requirement is I will have a set of commands that needs to be executed in a text file. My Shell script has to read each command, execute and store the results in a separate file. Here is the ...
0
votes
1answer
47 views

Error mounting in fstab Ubuntu

'm working on a bash class project which needs me to create 2 partitions in Ubuntu and make them be automatically mounted each time the systems boots with fstab. I got the following file which ...
0
votes
1answer
200 views

How to get xterm-like split windows in Debian (ubuntu)

I'd like to achieve this effect in Linux. Essentially I'd like to have vim open on the left and have a command line on the right to perhaps tail an error log. Ubuntu 14.04 on my desktop, but CentOS ...
1
vote
1answer
40 views

Execute dynamic command into all screen sessions

I am working on setting up a minecraft server network in ubuntu server 14.04 LTS. I have several screen sessions each with their own process running in them There are screens on: 2471.LobbyServer ...
1
vote
3answers
114 views

How can I restore my /bin/bash file?

I am facing a problem with my terminal (Ubuntu 12.04 LTS) . I was making some changes in the /bin/bash , but I have kept a backup of bash.rc in case of something went wrong. Anyway today I have tried ...
2
votes
1answer
33 views

Can you delete all users but specified accounts in Ubuntu?

I am trying to find a way to quickly delete all user accounts except for the ones I specify in Ubuntu. Is there a good way of doing this? Perhaps a bash script that could do this function? I ...
1
vote
1answer
47 views

Find last 24 hours executed commands per each user in bash

How can I find last 24 hours executed commands per each user and mail them the result? I have Ubuntu GNU/Linux. I find out that I need a package named 'acct'. I have already installed and enabled that ...
1
vote
1answer
43 views

Need help in the shell script - gunzip and file command

This is on Ubuntu 12.04. I have a custom webkit based application where "browser" saves bunch of cache files. When triaging the problems, I have to inspect the cache. The cache directory holds many ...
1
vote
1answer
39 views

bash does not work when cd to a particular directory, read and write permissions denied

Trying to run a Perl's script in Linux Ubuntu 11.10, but when Cd to the path, says : no such file or directory, but i can clearly handle the files inside the path. when trying to change the ...
1
vote
4answers
89 views

Find all files where other files with different extension dont already exist

I want to use the find command, to find all files with a certain extension (avi), where the same filename with another extension (mp4) does not already exist. so considering these files: a.avi a.mp4 ...
1
vote
0answers
254 views

IDE for Bash shell scripting on Ubuntu? [closed]

I'm probably looking for the Holy Grail here, but I figured I'd ask. Is there an IDE for Bash shell scripting on Ubuntu (Ubuntu 12.04 in my case)? Something with a code editor that lets you set ...
-1
votes
2answers
109 views

Unable to boot Windows 8 after an interrupted Ubuntu installation attempt

I have a Sony Vaio notebook with Windows 8(UEFI) installed,after trying to install Ubuntu 12.04 LTS(I cancelled the installation and restarted the pc) from a usb sticky,every time i turn on the ...
1
vote
0answers
21 views

Path slashes disappear on coloured bash prompt

So in my .bashrc, I set my prompt to be colourful by setting PS1 to \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ For some ...
0
votes
1answer
53 views

Java command only working in command line not in sh files

I have recently attempted to install java on ubuntu server 12.04 LTS. I wgetted the tar.gz file and extracted it to /opt/java and then added /opt/java/bin to the path variable. This all works ...
1
vote
1answer
125 views

Upstart script that displays errors to the console?

I have a simple upstart script that runs a process and respawns it if it crashes. The problem is if it crashes I want the user to be alerted that it crashed (because they may need to take an action to ...
2
votes
1answer
124 views

Bash script that execute command only if port is free

Hi I have a bash script that needs a conditional execution of a few lines of code based on whether port 80 is already in use: sudo git fetch origin; sudo git checkout master; sudo git pull; --- if ...
0
votes
0answers
36 views

Copying .bashrc and .profile does not change anything?

I have a root bash profile setup which has autocomplete and all the nice colours, but there is nothing setup for my actual user (non root). So I decided to copy the files .bashrc and .profile from ...
0
votes
1answer
31 views

Live CD: Script doens't work correctly after login

I have a PXE/NFS Server (192.168.1.10), a client PC and a diskless PC. I installed base ubuntu 12.04 to client PC. I wrote this script (update.sh) to work after login to client PC. ...
0
votes
2answers
187 views

Creating a simple custom apt-get/config script

As I play more and more with Ubuntu, I'm starting to see how I can automate the majority of the repetitive commands that I perform whenever I reinstall the operating system. Thus far, it's just one ...
3
votes
1answer
89 views

Paste a URL in terminal using bash script on Ubuntu

I'm on Ubuntu 12.04. I need to write a Bash script which would automatically paste a URL to the terminal without having to press CtrlShiftV on the keyboard. The script contains the command: wget -O ...
0
votes
1answer
287 views

Solution for automatic VPN-Connection on Ubuntu 13.10

I am searching since ages for a solution to connect to VPN-Servers automatically in my Ubuntu 13.10. It should connect on startup and reconnect on connection-drop. I tried several things: ...
1
vote
3answers
1k views

Why does this script fail when run from cron, but works when run manually?

I have a relatively simple bash script that works great when invoked directly, but fails when run by cron. Why does this fail and how can I make it work via cron? #!/bin/bash apt-get update -y ...
0
votes
1answer
102 views

Fail to redirect log to /var/log/syslog

I have an upstart script that does the following start on runlevel [2345] stop on runlevel [06] respawn pre-start script exec >/dev/kmsg 2>&1 REPO=git@github.com:blabla/bli ...
1
vote
1answer
289 views

Awesome WM: execute my aliases via run prompt?

I have aliases in my bashrc for a few programs. One example is: alias chrome='google-chrome --disk-cache-size=1000000000' How can I call this alias from the run prompt (modkey+r)? Im running ...
0
votes
1answer
44 views

Expand bash variables inputted from the read command

I have a tab delimited file like this: table_a "where id IN ($IDS)" table_b "where fk_id IN ($IDS)" table_c "where fk_id IN ($SOME_OTHER_IDS)" And I'm trying to write a script like: ...
0
votes
0answers
54 views

Ubuntu: `env -i bash --norc`, but include essential variables such as HOME, DISPLAY? (where are these set?)

Is there an easy way to isolate a session of bash so that only essential variables (HOME, USER, DISPLAY, etc.) are preserved? (essential in that many programs fail if HOME, DISPLAY, TERM, SHELL, etc. ...
0
votes
1answer
250 views

Why does this bash script give an error on Ubuntu but not OSX

#!/usr/bin/env sh export $NODE_CONFIG_DIR=/Users/full/path/to/script/config cd /Users/full/path/to/script /usr/local/bin/node main The script runs locally on OSX (if I adjust the paths for the local ...
4
votes
3answers
7k views

command not found when using sudo

There are a few question on the site that seem related to my problem but I could not find a solution in any of them. My operating system is Ubuntu 12.04. I have mvn installed in ...
0
votes
1answer
35 views

Ubuntu How to delete files older than certain file?

There are several files, How to delete files older than certain file X (order by last modified date)?
0
votes
0answers
43 views

Why can a non-root user not access Sublime soft link

I like using Sublime text as a VIM replacement i.e. opening from the terminal with an argument. I installed Sublime into /opt/sublime_text/ and within that is the executable I need. I then soft-linked ...
3
votes
2answers
667 views

Bash script to run “pecl install oci8”

I am trying to create shell script that will do the initial provisioning of a vagrant vm (running Ubuntu 12.04). Everything (installing php, apache, oracle instantclient, etc,) works fine, except for ...
1
vote
2answers
119 views

Change the default shell of gnuplot

My question is: How can I change the default shell of gnuplot? I want to change it in order to send stdout to bash. This should be pretty easy, but I'm giving up. Here's why. I'm running gnuplot ...
0
votes
3answers
186 views

Problems with Bash 4.2.45 on Ubuntu

I am using a remot server running Ubuntu 13.10 with Bash 4.2.45 installed. My home system is OS X Mavericks with Bash 3.2.51 (Darwin build) installed. I haven't used bash much in the past but I've ...
0
votes
1answer
71 views

Log IP address obtained by DHCP Server-Ubuntu Desktop

Would there be a way I could write a script that records the dhcp IP's that the computer running Ubuntu obtains everytime it obtains a new IP?