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

learn more… | top users | synonyms (1)

0
votes
1answer
1k 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: /opt/apache-...
0
votes
1answer
22 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 ...
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
38 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
0answers
15 views

How to create keyboard shortcut form terminal/shell script

I've already known that I can add custom keyboard shortcut via setting >> keyboard >> shortcut >> custom shortcut. But i want to do it from terminal or shell script which i can't find a way to do ...
0
votes
1answer
19 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
24 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. ...
0
votes
0answers
12 views

when I perform service privoxy start in bash, I can't find the binding port 8118

I have modified the configured file about privoxy in /etc/privoxy/config file. listen-address 0.0.0.0:8118 forward-socks5 / 127.0.0.1:1080 . When I perform sudo service ...
51
votes
6answers
518k 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
578 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
1answer
22 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 10-digit) when a specific packet is received (e.g. a packet with destination TCP port 6666) and then forward ...
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
50 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
44 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
845 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
60 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
34 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
44 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
32 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
91 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
49 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
388 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
18 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
27 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
42 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
-1
votes
1answer
21 views

i kann open my pc dual boot win 8.1 ubuntu 16.04 [closed]

After I deleted a partition and rebooted, the screen displayed: GNU GRUB version 2.02-beta2-32ubuntu3 Minimal BASH-like line editing is supported for the first word, TABlist possible ...
3
votes
0answers
39 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
78 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 /...
1
vote
1answer
47 views

Creating a bash script [closed]

Alright so, just for a little heads up, I literally just learned what bash script was today. Anyways, I have this series of voice recognition programs wrote in python, and I wanted to make a voice ...
0
votes
1answer
4k views

Curl request not working

Can some help me out in this.? I tried making a curl to random web pages it works fine. This address mentioned below i tried via browser it also works but when i try this via shell it does not work. ...
0
votes
1answer
34 views

Run my bash script on login and SEE terminal [duplicate]

i need your help :) I have some script that start on login (I set it on Application launcher preference) but i can't see terminal. One script it's easy and make light on on my CMstorm keyboard and set ...
0
votes
0answers
18 views

Creating A Drag and Drop Bash Script for wipe

I have been using the command like program 'wipe' for ages with a set of options. When I want to delete some files securely I use this command in terminal wipe -fciqr And I drag and drop the files ...
12
votes
4answers
23k views

How to replace a string on the 5th line of multiple text files?

I want to replace the 5th line of multiple text files (file1.txt,file2.txt,file3.txt,file4.txt) with the string " Good Morning " using a single terminal command. All the text files are located on my ~...
-1
votes
1answer
49 views

Store file list of current directory to a file [duplicate]

How can I get a list of all files in the current directory and store that to a file named mycurrent using the command-line?
1
vote
3answers
1k views

How to temporarily disable sleep and hibernate from the command line

It seems like there are many ways in which a Ubuntu's settings can be permanently manipulated to sleep when desired as long as predetermined conditions are met. However, these are more permanent ...
0
votes
0answers
19 views

How to change python+filename.py auto-complete to anyfilename

This questions may seems silly as I am a new Linux user on Ubuntu 16.04. I am learning python now. As the command python x+tab will only auto-complete xxxxx.py instead of xxxxx without .py. How ...
1
vote
0answers
10 views

Slideshow of Image Folder whose files increase

I am trying to stream video from my webcam to a series of images, process these images through a bash script that uses convert (imagemagick) and then output them to a folder. I have been successful ...
1
vote
2answers
53 views

Cron Job doesn't execute

I created a cron job as root with the command: crontab -e Then I added 0 4 24-31 * 4 /home/backupscript.sh after the last line. The output of crontab -e looks like this: # Edit this file to ...
76
votes
11answers
506k views

How do I run .sh files?

Whenever I open a .sh file, it opens it in gedit instead of the terminal. I can't find any option similar to Right Click → Open With → Other Application... → Terminal. How do I open this file in the ...
2
votes
1answer
37 views

How to write efficient script to have memory (RAM) peak?

I have a network with some PCs. I wanted to have peak of the memory for each system. I wrote a script to check the used memory and writes the peak in a file in /tmp; and I've set the script to run ...