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

learn more… | top users | synonyms (1)

-2
votes
1answer
64 views

How to combine ls and grep to list only files and using ls to count dirs

I have some troubles with combining ls and grep. The thing is that I have to use only ls and grep to list all files in home directory. Ive tried multiple of combinatnions but with no effect. I think i ...
0
votes
1answer
23 views

Syntax for regex in IF statment

I'm trying to come up with the syntax for a regex in an IF statement, but I'm not quickly having success... Can anyone lend a quick hand please? if [[ "$path/$file" =~ .{txt,doc,docx,xlsx,rtf} ]]; ...
-1
votes
1answer
90 views

The program 'sed' is currently not installed. You can install it by typing [sed: not found]

I was trying to create my own program in the /usr/local/bin. During the process I messed something up and now anytime I press enter or type anything in the command line, I get this stupid ...
0
votes
1answer
24 views

A problem when invoking a function in a bash script

I've written the following bash script to find a driver's name, I'd make it better but for now I just want to know why this script doesn't work ? #! /bin/bash ## the driver's name ...
0
votes
2answers
45 views

How do you create a shell script?

I need to create a shell script that will create a user then put it into a group. How do I do it?
0
votes
1answer
21 views

A bash scripting problem

In advance , I'd say I know the basic syntax of bash scripts but the following statement is not recognized for me : if [ ! -f /etc/debian_version ] could you help me what this condition going to ...
0
votes
0answers
53 views

how do i achieve executing a python script ON TERMINAL via a shell script in nautilus folder by the right-click>Script way?

Using nautilus i am writing a script which will run the python script which invoked it. So to run a python script i just need to right-click on it>goto scripts>select appropriate script and it will ...
1
vote
0answers
42 views

Desktop Environments Incorrect After SLiM Install

I am working on making an automated install based off of Lubuntu using Debian Installer so that the install is as automated as possible (a few inputs at the very beginning). So far I am mostly pleased ...
1
vote
1answer
40 views

PATH is not getting exported by default in Ubuntu 12.04

When i run su on command line and enter root password, I am getting error as mentioned below: Command 'lesspipe' is available in the following places /bin/lesspipe /usr/bin/lesspipe ...
0
votes
2answers
63 views

A strange problem about terminal or command environment

Two weeks ago I was learning Python and Flask. I followed step-by-step the steps in The Flask Mega-Tutorial, Part I: Hello, World!. While I was following the tutorial, I had problem in "virtualenv", ...
1
vote
1answer
60 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
1answer
59 views

Why isn't Roundcube's Upgrade Shell Script Working?

I am trying to upgrade my Roundcube installation from version 1.0.4 to 1.0.5 and I cannot get the upgrade script working properly. According to Roundcube's upgrade documentation, the following command ...
0
votes
2answers
44 views

bash script dollar sign operator $ question - is it incompatible to ~ operand?

I am new to the Linux environment. After a quick search I could not find a helpful question about the $ operator used in bash scripting. I do not know if this question relates more to the Ubuntu (or ...
0
votes
0answers
34 views

Bash puts ':' after each command

I updated my bash_aliases from another system I own, and now, I have found the following problem: If I use a command, bash put : after each command and alias. Why? What can cause this problem? In ...
0
votes
0answers
45 views

Pulseaudio increase volume above 100% per channel

I'm using a bash script to start kodi (aka xbmc) in Ubuntu. The script adjusts the volume per channel for my 5.1 sound system: amixer -D pulse sset Master 90% amixer -D pulse sset 'Master' ...
2
votes
1answer
95 views

Deleting input forward to the next space

When in terminal I can use Ctrl+w to delete a whole word or IP (. is separator for each octet) when going leftward of prompt. However, if I try Alt+d to go rightward of prompt, terminal recognizes "." ...
1
vote
3answers
66 views

One liner ffmpeg (or other) to get only resolution?

I'm not really well versed in the command line so hopefully this isn't too stupid of a question. If I run: ffmpeg -i videofile.avi I get an output such as this: ffmpeg version ...
0
votes
1answer
28 views

SFTP change notifications

I am looking for any solution for my problem. I have SFTP access to client's server and I need some script or something else to watch after new files because they are added irregularly. I need this ...
0
votes
1answer
65 views

Can't call wget from Python script [closed]

I am writing this script that executes a bunch of commands one of which is to download some packages from a certain url. Following is my script #! /usr/bin/env python #! /usr/bin/env bash import os ...
1
vote
1answer
49 views

Editing my Bash prompt

I'd like to put something into my bash prompt, but I'm not quite sure how to do it. I use the Cloud Foundry Command Line Tool to push code up to my servers. The cf tool can be set to a specific ORG ...
0
votes
0answers
34 views

the command argument is not passed to /bin/sh in popen

Here is a scenario where I use popen as FILE* stream = popen("Root", "r"); As per my understanding the Root argument will be passed to /bin/sh and interpretation is done. In my case, Root should be ...
2
votes
1answer
43 views

How to compare two (vague) file lists and print the duplicates?

I have two file lists. backup.txt and backup2.txt Some of the entries aren't exact, so it makes it difficult to find the duplicates with diff or uniq. Example: :::backup.txt::: auser_backup ...
0
votes
1answer
33 views

Match Pattern and write following value as variable

I'm trying to match a pattern and then pull the following information to create a file using that variable. Example (my data may look like either of the 2 examples) "headers": { ...
0
votes
1answer
23 views

What does `printf` do in rc.local?

I've encountered an /etc/rc.local script that gets some data and uses printf on it. My question is: where does that data that is printed go when rc.local is executed on startup? Is there a log file ...
1
vote
1answer
35 views

My script only opens new terminals when the previous command's terminal is closed

Sorry if my title is a little hard to understand, I tried to condense the issue as much as possible. I'm trying to run a bash script which opens a new terminal for each major command, that way I can ...
0
votes
1answer
51 views

gsettings not working from within bash function

Pretty New to bash and only 6 months into ubuntu so please bare with me. Im creating a post installation script https://github.com/jjdemitriUk/relutionDev everything is going well so far its written ...
18
votes
3answers
1k views

How can I wake a sleeping bash script?

Is it possible to wake a process that is paused using the sleep command? As an example, lets say you have this script: #!/bin/bash echo "I am tired" sleep 8h echo "I am fresh :)" After 30 ...
3
votes
3answers
240 views

Sudo command in bash script halts the script

I have an early 2009 iMac with a sensor problem. The ODD and CPU fans run at full speed. To get them down to minimum speed in Ubuntu I need to set the speeds in the Terminal, using this method. Rather ...
0
votes
0answers
14 views

Ubuntu server VM install has limited bash functionality

I installed Ubuntu Server 14.04 in a VM and I selected the VM option during installation since my host has limited memory. I accepted the fact that most features will be disabled in such a system for ...
1
vote
1answer
61 views

Fast change of my ip/proxy in terminal for one command

I need to change my IP for one command in bash command line, so I want use proxy (123.123.123.123:80 format), how can I do it? For example if I write: curl ifconfig.me I get my original IP, so how ...
4
votes
2answers
275 views

Run the file in folder called `python` not the python interpreter

I have a folder. Inside of this folder is an executable called python. When I try to run python from the terminal it instead runs the python interpreter. How can I run the file called python?
1
vote
1answer
83 views

While Loop Syntax Error

I'm attempting a modification of apt-fast to support parallel downloading and installation. I'm having some trouble with this loop: get_install(){ while ((!${pkg}-finished)) do if [ "$CURNUM" -lt ...
0
votes
0answers
16 views

customize ubuntu with bash scripts - never turn the screen off [duplicate]

I'd like to disable the screen from dimming automatically. It is manually done in Settings > Brightness & Lock > Turn screen off when inactive for: Never. I want to do it with a shell ...
0
votes
2answers
105 views

Script to find size of image files

I've got image files scattered all around my computer so I'd like to write a script that receives as input a full path to a directory, display the total size of image (.jpg , .jpeg) files in each of ...
1
vote
2answers
132 views

How can I delete all folders of a specific name without deleting Contents in it?

How do I delete all Folders with a specific name (e.g. 128Kbps_Songs) without deleting its files For example if I have directory "MP3_SONGS" with subdirectories "A", "B", "C" and each subdirectory ...
1
vote
2answers
40 views

How to return default PS1 prompt?

After installing docker (I definitely think this is about docker) I got changed cmd-label. For instance, it was like username@root8hgf858$: your_command to [:/home/username] $. How can I fix it? ...
0
votes
1answer
45 views

Getting a dpkg error when using apt-get upgrade

I am getting this dpkg error when using apt-get upgrade: dpkg: error processing package bash (--configure): package is in a very bad inconsistent state; you should reinstall it before attempting ...
1
vote
1answer
29 views

How do I fill certain percentage by height of an image using ImageMagick commands in ubuntu?

I have an image with around 20% of its bottom filled with white color. But the image has some dots of other colors than white. I have 100s of such images which I would like to remove those dots from. ...
1
vote
2answers
114 views

How to stop and remove the docker

I'm trying to remove a docker/images/containers and all stuff which is somehow connected with docker, but first of all I neeed to stop it. While I'm trying to execute this command: docker stop ...
0
votes
1answer
43 views

Bash Script - Editing Lines on Text From File

I'm using a bash script to read in data from a text file. #!/bin/bash file="/home/nexusfactor/Desktop/inputData(linux).txt" while IFS= read -r line do # display $line or do somthing with ...
1
vote
1answer
36 views

Get window name of byobu session in bash

is there a way to get the byobu window number (or window name) in shell? I want the same code to behave differently depending on the window in which it is running: I am thinking about something like ...
3
votes
1answer
134 views

How to display all services and version that runs on a host?

I am trying to display all services and their versions that runs on a host using ports from 1 to 1023, in this way: ssh, OpenSSH 5.9p1 Debian 5ubuntu1 (protocol 2.0) smtp, Postfix smtpd http, Apache ...
-1
votes
2answers
64 views

bash comparison of integer always returns true?

I have the following simple bash script. for some reason it always returns true. #!/bin/bash service=hhvm status=($(ps -ef | grep -v grep | grep $service | wc -l)) if [[ $status -eq 0 ]]; then ...
0
votes
1answer
22 views

autoremove option doesn't work with apt alias

I have set up an alias for apt-get as apt, for convenience. This works fine, I can do sudo apt install PACKAGE sudo apt remove PACKAGE sudo apt update etc with no issues. However, the autoremove ...
0
votes
2answers
110 views

How to read user last email using a shell script?

Let's say I have two machines A and B On A I have installed and configured a SMTP and IMAP server For example I have user: george with password: 123456 on Machine A I am trying to write a shell ...
2
votes
2answers
79 views

How to use 'if' inside '-exec' attribute of 'find'?

I have a directory with many pairs of files. Each non-text file has a textual description partner. For example a directory can look like this: a.jpg a.jpg.text b.ogv b.ogv.text cd ef.JpG cd ...
3
votes
1answer
86 views

Desktop icon position (programmatically access and manipulate)

I'd like to programmatically access and manipulate the Desktop icon positions, their icons, etc. This is for files and directories that you keep in ~/Desktop . Where is this stuff stored?
0
votes
1answer
28 views

Problem setting up Environment for 'make' command execution

I am trying to set up devkitPro for ARM use, but I continuously get an error while executing the last two commands. The commands are make and make install. The tutorials I am following: ...
4
votes
2answers
487 views

Why isn't this script to delete part of my command history working on my computer?

The script can be found here: http://stackoverflow.com/questions/14750650/how-to-delete-history-of-last-10-commands-in-shell For convenience here it is: for x in `seq $1 $2` do history -d $1 done ...
2
votes
1answer
110 views

QEMU Connect physical disk [closed]

I made a windows virtual machine on my ubuntu pc using the following script (found online). #!/bin/bash configfile=/etc/vfio-pci1.cfg vfiobind() { dev="$1" vendor=$(cat ...