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

learn more… | top users | synonyms (1)

1
vote
1answer
268 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
377 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
203 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
2answers
624 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
332 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
898 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? I'...
0
votes
1answer
421 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
162 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. ...
7
votes
2answers
16k 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
658 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
95 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
327 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
169 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
120 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
1k 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
483 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 ef.JpG....
5
votes
1answer
1k 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
646 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: http://...
4
votes
2answers
859 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
4k 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 /sys/bus/pci/...
11
votes
2answers
1k views

Re-run an application script when it crashes?

I have some applications that need to run on my laptop all the time. I use a bash script to start these applications. In my script I have a loop that looks similar to this: while true; do ...
2
votes
1answer
432 views

Locate the id of input device and change the value of its property

I learned from this post that you can set mouse speed by the following: $ xinput --set-prop 10 "Device Accel Constant Deceleration" 4 where 10 is the id of the target device, which you can obtain ...
0
votes
2answers
84 views

/usr/bin/ or ~/bin/ priority

Here's a hypothetical situation....There are two binaries with the same name. Lets call them charles. One charles is in the /usr/bin/ directory and the other charles is in ~/bin/. Assuming that ~/bin/ ...
0
votes
2answers
209 views

Best way to schedule script, crontab or other options?

I never use crontab, and while it ask me for root password, I am careful. So my question is, I have to run periodically (let's say every 30 min)a simple script for analyze the text file, which is ...
0
votes
1answer
1k views

Is it possible to use variable in sed command in unix bash script [duplicate]

I trying to solve following problem. With great helps of others here, I can write and understand simple do loop in bash scripting. Now I try to do this: In "mein_directory" directory I need ...
3
votes
1answer
2k views

Alternatives for [variable = string substitution] in bash

I am learning bash and trying to understand the different ways of making a substitution and assigning it to a variable. Specifically, I'm changing Unix slashes ('/') to Windows ('\'). References: ...
0
votes
1answer
112 views

What does 'history | grep cp -r ' do?

I typed this commands by mistake in my shell and then my shell was filled with all the text . I don't know what it does .Please someone explain it to me .
1
vote
1answer
2k views

Ubuntu / Bash recognising “export PATH=$PATH:~/…” but not “export PATH=$PATH:/home/…”

So I've been using ubuntu since 09.04 but have limited experience with sys admin. I now want to get into web development and as part of installing the Play Framework, I had to add the activator path ...
1
vote
1answer
342 views

Unable to add repository key to local keychain

I want to install Docker application on my Ubuntu, but i can't execute a command to add Docker repository key to my local keychain. Here's this command: sudo apt-key adv --keyserver hkp://keyserver....
6
votes
1answer
6k views

Bash Tab Completion: '-bash: unexpected EOF while looking for matching `)' -bash: syntax error: unexpected end of file

I'm trying to go into an irb session with specific environment variables from a file with this command: $ env $(cat env.sh) irb But when I try press Tab after I type env. to complete it, I get this ...
0
votes
1answer
54 views

Unable to append quote sign in terminal out put for offset sequence

I have following offset addresses saved inside a file placed at desktop. eagle@max-pc:~$cat ~/Desktop/offset.txt 0x00000000 0x00000419 0x0000073d 0x00000a24 0x000011cf 0x0000139c ... Now I want to ...
1
vote
2answers
202 views

how to fix my keyboard after a bash script messed it up

Okay, I was stupid. I ran a bash script I got off of some forum on the internet, github I think it was, that said a cool matrix would appear in the terminal, which did happen, but it also messed up my ...
0
votes
1answer
246 views

Used sudo command that I don't understand, want to undo it

I recently installed Ubuntu 14.04 for the first time, and I've been wrestling with various aspects of it since (mostly successfully), however in attempting to fix and issue with Firefox not playing ...
-2
votes
1answer
50 views

How does this lowercase expression works in bash

I want to convert a vaiable value to lower case. To do this, I am doing following lower_case_var=echo ${var,,} Above expression works fine. However, I am wondering that how it works?
1
vote
0answers
147 views

Errors in update checking script (cause: repositories not available)

I have a scripts that tests if updates on my 14.04 server are available, and send me a text message if that happens. The bash script begins with: IFS=';' read updates security_updates < <(/usr/...
0
votes
1answer
193 views

Writing a bash script to run a server

This is how I launch the server in the terminal: ~$ cd meteor/writer10 && meteor I have to do that every time I start Ubuntu so I thought it would be nice to write a bash script so automate ...
0
votes
2answers
75 views

Deleting first letter of each line

I have a file and I need to delete its first letter of each lines. I tried this: for i in do if [ $5 -eq cat harfler | grep `head -n i harfler | head -c 1` ] then echo "succeded" tr -d `head -n i` fi ...
1
vote
3answers
539 views

How to create a script to sync notes to files using Geeknote

The problem I want to create a directory with my notes from Evernote in files with the Markdown format. I found out that this can be made using Geeknote, but for each notebook every time. How to ...
1
vote
0answers
14 views

Packaging bash file .deb [duplicate]

How can a (with very simple instruction) make a .deb file continent some .desktop files and shell bash files
2
votes
0answers
37 views

When should (( )) be preferred over [ ] for specifying conditions? [closed]

In bash shell scripting, when should we prefer (( )) over test command for specifying conditions? Moreover, what is the difference between the two?
0
votes
2answers
109 views

Stuck in a loop after login in 14.04

I am a Linux beginner so bear with me please. I used a bash script to automatically re-connect to OpenVPN. It worked fine when I ran it. http://www.gabsoftware.com/tips/automatically-reconnect-to-...
0
votes
2answers
159 views

Send a twiter message from the terminal

Is there away to send a message form the terminal or write a shell bash file that fill send a message to twiter.
1
vote
1answer
316 views

Auto-complete in Ubutnu 14.04 terminal

How can I replace TAB with CTRL+SPACE for auto-complete in Ubuntu terminal?
2
votes
4answers
963 views

Why is this Bash script not working?

I wrote a small Bash script so that the image in the folder becomes the wallpaper: for f in *.jpg do gsettings set org.gnome.desktop.background picture-uri file:$f The error is: ./wall.sh: ...
1
vote
1answer
428 views

How to use source command for exporting path?

I am trying to set the path of few libraries using source command but its not working and says dsbisht@dsbisht-ThinkCentre-E73:~/Workstation$ source .list bash: .list: No such file or directory My ...
12
votes
1answer
661 views

How can I find the command history if a user used a space before the command?

Do we have any way to find out the command history if the user uses space before any command in the bash, because if user uses space before any command it won't show in history?
1
vote
2answers
68 views

Can't add the exec option to my data partition in Ubuntu 14.04

I'm using an HDD as a external drive, it has 3 partitions and one of them is for my Ubuntu Documents. I'm trying to compile my programs and it gives me the msg: bash: ./qt-opencv-multithreaded: ...
4
votes
4answers
497 views

Command to create sequentially numbered targeted directories and batch move files

I'm creating a timelapse video by splitting a video into individual images, using G'MIC via the command line to average every 7 frames, then output the results to new images which will result in the ...
5
votes
1answer
5k views

Why isn't .profile sourced when opening a terminal?

Just installed Ubuntu 14.04.1 LTS. According to .profile, # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash, if ~/.bash_profile or ~/.bash_login ...
2
votes
1answer
456 views

14.10 gnome classic metacity unable to hook up keyboard shortcut to binary

I am trying to get the Aero Snap effect working on an Ubuntu 14.10 using Gnome Classic Metacity. I found a command that works if I execute in on a terminal window: wmctrl -r :ACTIVE: -b remove,...