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

learn more… | top users | synonyms (1)

0
votes
1answer
65 views

How to check for any activity on a physical disk?

I have an SD card that's connected via a USB interface. The output of fdisk -l indicates the following: Disk /dev/sdb: 3965 MB, 3965190144 bytes I have a script that re-initializes multiple ...
0
votes
0answers
57 views

Bash script environment can't get exported variable from user

I have a user daniel, from which I'd like to retrieve an exported value as root. So I did some research and came up with this command: $ su - daniel -c '. ~/export_script; echo $EXPORT_PATH' > ...
0
votes
1answer
79 views

Help me remove this Bash error

The bash error below keeps popping up each time I open a new terminal, why is that? How do I fix the bash error below? bash: /home/yonas/.rvm/scripts/rvm: No such file or directory
0
votes
1answer
96 views

Code works in Terminal, but not when in a script

I have: This is my zip file.zip in path $dec If I manually copy this code over to the terminal window, I get the correct output. But, if I take the same exact code and put it into a .sh file and ...
1
vote
1answer
296 views

Differences between md5pass and md5sum

This question may be insane ,but due to definition of hash algorithms, hash algorithms are some kind of functions that accept variable length input and make it encrypted and the output always has a ...
-1
votes
1answer
155 views

“Command not found” after running a file compiled on the same directory [duplicate]

I don't know what is going on... d@d-SVF15A17CDB:~/University/CSC209/a1$ gcc -o remvocals remvocals.c d@d-SVF15A17CDB:~/University/CSC209/a1$ dir remvocals remvocals.c ...
0
votes
0answers
53 views

IF statement not traversed correctly in script responsible for unpacking zip files

I've been working on an IF statement for a couple days now and have been unsuccessful at getting it to run correctly. All of the embedded code seems to work when I manually paste it in Terminal, but ...
0
votes
1answer
25 views

Implementing an if clause in simple bash script

I've got a bash script that makes use of cal -m $v where v is number . The user is prompted for v's value at the beginning of the execution . In case the user presses ENTER instead of introducing a ...
0
votes
1answer
960 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
38 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} ]]; ...
-2
votes
1answer
154 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
33 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
79 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
25 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
208 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
62 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
142 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
78 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
310 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
144 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
118 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
51 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
130 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
100 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
317 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
78 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
346 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
69 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
78 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
78 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
64 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
67 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
64 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
151 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 ...
19
votes
3answers
2k 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 ...
2
votes
3answers
481 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
37 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
128 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
334 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
106 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
284 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
199 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
128 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
76 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
69 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. ...
3
votes
2answers
6k 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
195 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
64 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
202 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 ...