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

learn more… | top users | synonyms (1)

1
vote
1answer
21 views

Cron - Check if enabled on boot

I have a script and configuration file. Configuration file contains information about if script will run or not (enabled or disabled). If enabled, script must run in predetermined intervals. I ...
-1
votes
0answers
15 views

Why can't download file from self-made torrent?

To create the torrent for start.mp4 with command: root@localhost:~# mktorrent -a udp://tracker.coppersurfer.tk:6969/announce \ -a udp://tracker.ccc.de:80/announce \ -a udp://tracker.publicbt.com:80 ...
12
votes
11answers
2k views

How to quickly move into and from deeply nested directories through CLI? [duplicate]

We know that using cd <directory> will open the directory, if it exists! Also, cd .. will take us up one level from the current working directory. But, when we have a nested dir with longer ...
0
votes
1answer
38 views

Copy all images on system to one folder

Im trying to create a bash script, that will search the system for images jpg, jpeg, png, gif and copy them to a new location. But I'm having a hard time figuring out how to do this. This is what i ...
69
votes
6answers
145k views

Running programs in the background from terminal

How do I run a program in the background of a shell, with the ability to close the shell while leaving the program running? Lets say my UI is having problems or for some reason, I need to boot up a ...
0
votes
1answer
25 views

Get key name from keycode

I am writing a shell script that uses xinput, and I would like to get a human-readable description of what the user has typed using the keycode from xinput. For example, A generates 38. Ctrl is 37. ...
-1
votes
0answers
43 views

Need help with Bash script!

I want help to form a bash script as I don't know how to do it? Backgroud information: OS: Ubuntu 16.04 LTS Apps partion mounted through NAS: /apps Both processes shall be runing at anygiven ...
1
vote
0answers
27 views

Upstart services work in SSH session, but not in local terminal session

If I open a local terminal, and attempt to start an upstart service I get this error: service rsync status status: Unknown job: rsync But if I SSH in as the same user, it works fine: service rsync ...
2
votes
0answers
28 views

G++ cannot find cc1plus for some users

I am trying to run a PHP script to compile C code through a bash script for an online code submission server. When I run the bash script as root, it all works. When I run it as www-data, the user ...
0
votes
0answers
23 views

Creating A Drag and Drop Bash Script for wipe

WARNING: This question contains dangerous commands. Do not execute these commands on your own computer unless you wish to lose data. I have been using the command like program 'wipe' for ages with ...
1
vote
1answer
23 views

I accidentally canceled 16.04 Upgrade halfway through; dpkg status locked

I was upgrading from 15.10 to 16.04 and I got some prompts about config files having changed, e.g. /etc/xdg/autostart/at-spi-dbus-bus.desktop. So I type D to see the diff, but then accidentally hit ...
0
votes
2answers
41 views

ctmconv, zenity and filenames with spaces

I'm making a little conversion script in Zenity, but have noticed that ctmconv won't allow spaces in a filename. Can I get rid of spaces in the input filename? #!/bin/bash cd ~/Desktop file="$(zenity ...
1
vote
1answer
34 views

How to run a function for every specific received packet?

I am doing an experiment for my master thesis. I want to run a function (e.g. multiply two numbers) when a specific packet is received (e.g. a packet with destination TCP port 6666) and then forward ...
0
votes
0answers
9 views

Terminal is closing upon opening [duplicate]

Terminal is closing immediately after opening. I managed to open an alternative terminal with: env SHELL=/bin/sh gnome-terminal When I type ''bash'' in the alternative terminal: # bash ...
4
votes
5answers
5k views

bash: alias: alias: not found

When I log in, I see the error: bash: alias: alias: not found If I source my .bashrc file, the message appears again. What is causing this?
0
votes
1answer
9k 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 (arm-...
1
vote
1answer
23 views

Zombie process (kill both child and parent process)

Question: I want to make sure that both child and parent process are killed and echo if successful or not. I'm new on using bash script and having issue with my output. #!/bin/bash for p in $(ps ...
0
votes
0answers
10 views

run virtualenv in new terminal tab automatically

I am using virtualenv, so to start I have to say source some/long/path/bin/activate Sometimes (very often, in fact) I want to create another tab in terminal, to edit another script, or to run ...
1
vote
1answer
14 views

Need bash script output on one line - curl and >> produces 2 lines

I am running this bash script: #!/bin/sh date +"%Y-%m-%d %H:%M:%S " | tr -d 'n' >> /home/test_a5gh/Pub_IP.txt curl http://checkip.amazonaws.com?newline -s >> /home/test_a5gh/Pub_IP.txt ...
0
votes
1answer
1k views

How to set a permanent environment variable? [duplicate]

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: /opt/apache-...
0
votes
0answers
21 views

Can't convert *.flac to mp3; “no such file or directory” [duplicate]

I am trying to follow this previous question and this associated wiki page to convert flacs to mp3s with a bash script. I have tried it with avconv and ffmpeg, with *.flac and ./*.flac, and I keep ...
7
votes
0answers
49 views

No tab completion with asterisk *

I am not able to tab complete from the command line in gnome-terminal when I have an asterisk in the command line. Default shell is bash, using gnome-terminal. For example, This works to copy a ...
0
votes
1answer
23 views

Delete all hidden files recursively in current directory [duplicate]

I have a directory which contains hidden files and by that I mean, not just the files whose name starts with . but also the files whose name contains ~ character at the end like somefile.txt~. I want ...
0
votes
1answer
27 views

Ubuntu alias rename directory issue

I have Ubuntu 14.04 Trusty Tahr installed in my system. I have created following alias in my '~/.bashrc' file to make renaming directories recursively in current folder, as easy to use short command. ...
51
votes
6answers
521k views

How to copy files via terminal?

I have read about copying files with terminal but these examples will help me a lot. So here is what I want to do: Examples: I have a file in /home/levan/kdenlive untitelds.mpg and I want to copy ...
9
votes
2answers
585 views

How can I toggle the touchpad depending on whether a mouse is connected?

I want to have my touchpad disabled automatically when an external mouse is connected and enabled when there is none. I have tried using touchpad-indicator but that fails in cases when the computer ...
1
vote
4answers
7k views

Run .sh script on Ubuntu without using terminal

I'm using Ubuntu and I've created a simple script file: #!/bin/bash cp /home/guilherme/pictures/*.jpg /home/guilherme/backup When I run it on terminal typing the command "./script.sh" it works fine....
-1
votes
1answer
51 views

Joining streams

You normally can pipeline the operations a | b | c where b takes input from a and sends it to c. It has only one input, generated by a. But what if I want to replace a header in file b. I therefore ...
0
votes
2answers
30 views

Are log files written to when a buffer fills or in 'realtime'?

I have a script running which pipes its output through another script; that wrapper script adds a timestamp to each line of the log. However the data is being written to the log file in chunks of ...
0
votes
0answers
48 views

Extract data from logfile from only the previous 24 hours, with bash in a shell script

Using the Ubuntu 14.04 trusty and transmission log for the log file. What is the best way to extract the last 24 hours of log entry's? I have attempted using sed awk grep I cannot seem to get the ...
7
votes
5answers
846 views

How to use syslog for else output ( show up with whois - query )?

There is log-file /var/log/syslog with the output of ip-addresses like e.g. SRC=10.158.0.1. I want to scan from this file every printed address in SRC= ... and then to make query with whois (SRC= ...)...
2
votes
2answers
64 views

STDOUT and STDERR redirection for nc

I am trying to make a watchdog bash script which has to check if the port is open, based on the exit status, otherwise should start the daemon. Problem is I can't manage to avoid the script outputting ...
0
votes
2answers
35 views

I can not access to normal terminal [duplicate]

I modified my bashrc via terminal and now when I open a terminal I can not do nothing either via Ctrl+Alt+F1, Can anyone help me to fix this. In both cases appears this: # ~/.bashrc: executed by ...
2
votes
1answer
305 views

Problem with tmux startup displaying running config. (powerline)

I just installed powerline using this tutorial: http://askubuntu.com/a/283909/408189 Now, the first thing I see when I open tmux with the command tmuxis what looks like the running config. What I ...
4
votes
2answers
6k views

terminal closes immediately after open

I rebooted recently, and now terminal fails to work. If I click the terminal shortcut or use Guake or ctrl-alt-T, the terminal opens briefly with no prompt, then immediately closes again. I installed ...
0
votes
1answer
48 views

I messed up the ~/.bashrc file and now terminal doesn't open ubuntu 16.04 [duplicate]

I just installed Android Studio on my ubuntu 16.04 machine and as I didn't want to go to its own home directory and now every single time I try to open the terminal, it tries to start android studio (...
0
votes
0answers
15 views

Sudo /bin/bash -c 'some command' does not load /etc/environment content, not set the env [duplicate]

I've got a bit confused When I do log in via sudo su - I get full environment loaded $ sudo su - # env SHELL=/bin/bash TERM=screen-256color LC_ALL=en_US.UTF-8 HTTPS_PROXY_HOST=myproxy.com ...
-1
votes
1answer
33 views

Rename file under sub-directory in bash [duplicate]

I would like to know how to change the name of a txt file inside a directory. I know that I can mv test123 test456, but that only changes the name in the current directory. What if I want to change ...
1
vote
1answer
33 views

APK versionName grep

Im trying to retrieve the VersionName of a bunch of apk files i have in different folders and store them in an array , but its not working ... I've tried pretty much everything but it only loops 1 ...
5
votes
3answers
105 views

Update brightness level depending on the power source on 16.04 LTS

I recently migrated to 64 Bit 16.04 LTS from 32 Bit 14.04 LTS on my Toshiba L645 laptop. In 14.04 LTS system, I had a script that automatically updated the brightness level depending on the power ...
4
votes
0answers
54 views

How to set a new home directory at every login?

I'm in the process of building a kiosk system and need to give the guest user a new temporary home directory at every login. I wrote a little bash script that takes care of that but when it tries to ...
3
votes
3answers
392 views

How to trim user input in bash script?

OK, here is a given user input : $ myscript.sh file-name.txt I would like to trim "file-name.txt" to retrive 'file' in bash script #!/bin/bash FILENAME=$1 # trim text after '-' from user input '...
18
votes
5answers
8k views

How to debug bash script?

Is there any way to debug bash script without using echo and logging? I'm talking about using breakpoints and stuff like that.
0
votes
1answer
20 views

How to make oh-my-zsh recommend uninstalled packages like bash? [duplicate]

I want zsh to recommend packages to install if I insert a command whose package is not installed like in Bash. Like
1
vote
0answers
32 views

Syntax for sending notification hint using gdbus or python's dbus module

I'm trying to update a previous notification (which displays the screen's brightness after being changed using a progress bar) with gdbus, as notify-send does not support updating. Previously I use ...
1
vote
0answers
44 views

Log in to ssh slow for one user, but not another

I'm running a server at home with Ubuntu 14.04. I have two users on the machine, say user1 and user2, each able to ssh into the box. While user1 logs in very quickly, user2 takes about 20 seconds to ...
1
vote
3answers
57 views

String Manipulation

var="<string> 1.11 </string>" I want to get rid of <string> and </string> How can I do it? For now i got this: var=${var:9:4} 1.11
3
votes
0answers
44 views

Script on reboot

So, I programmed a simple script to alert on slack whenever the server is rebooted. What I did: In /etc/rc6.d/R99reboot-slack: (I tried with R01reboot-slack) #!/bin/sh /scr/msg.sh "Server restarting.....
4
votes
1answer
79 views

Terminal Closes Immediately on Open 14.04

I tried to follow other answers on here that I found but I cannot stop my terminal from closing as soon as it opens on Ubuntu 14.04 LTS. Here are my profile files. .bashrc .profile /etc/bash.bashrc /...