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

learn more… | top users | synonyms (1)

1
vote
1answer
43 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
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
3answers
62 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
0
votes
0answers
26 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
votes
1answer
50 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
0answers
13 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
64 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 ...
2
votes
1answer
42 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 ...
1
vote
1answer
56 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
23 views

Problems understanding how set works

Can someone please help me understand the following code segment? set -- ${BACKUPDIR}/backup-???.tgz lastname=${!#} backupnr=${lastname##*backup-} backupnr=${backupnr%%.*} backupnr=${backupnr//\?/0} ...
4
votes
1answer
55 views

Extract multiple 7z files with auto rename

I have a bunch of 7z files, some of which contain files that have the same name. Therefore, I would like to do auto rename. I can do something like find ./all -exec 7z x -pabc123 -oall/xml {} \; ...
0
votes
1answer
38 views

help understanding sudo -s [duplicate]

I was trying out a command yesterday that put my computer into hibernation mode. The first line in the command sequence was sudo -s which made my command line go from userName@computerName:~$ to ...
9
votes
2answers
525 views

bash -c “v=value; echo $v” displays nothing

Executing the following from a comand line screen: bash -c "v=value; echo $v" displays nothing. It's ok? How can I assign a value to a variable inside this kind of execution?
1
vote
1answer
43 views

Problem when I changed Fish to default shell

So I tried to make Fish my default shell with the command: sudo chsh -s /usr/bin/fish 'myUsername' Now I get this every time that I launch my terminal: Unable to open universal variable file '/...
1
vote
1answer
47 views

How to change the default shell of at command

when I want to delay the execution of a program using at, it precise me that warning: commands will be executed using /bin/sh How the change this default shell, to bash for instance ?
0
votes
0answers
36 views

Command “sudo su” is not working [duplicate]

By mistake my bashrc has changed (using source command to a .com file). Now sudo su command is not working. To use root I have to give bash command. How can I return previous stage? Or use sudo su?
0
votes
1answer
148 views

-bash: export: not a valid identifier

Whenever opening the terminal, I always end up with this same error. -bash: export: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/...
0
votes
1answer
16 views

having trouble installing canopy 1.7.2 on my ubutu 12.04 amd64 computer

I am having trouble installing the canopy installer 1.7.2 on my Ubuntu 12.04 amd64 computer. I have downloaded the software in the "downloads" folder but I get the following error: $ bash canopy-1.7....
7
votes
1answer
252 views

Shorter way to apt-get install php7.0-{some modules}

I am currently installing php7.0 and was wondering if there is an shorter way to install the modules. normally I type: apt-get install php7.0 php7.0-fpm php7.0-mbstring php7.0-mcrypt php7.0-...
2
votes
0answers
40 views

bash.bashrc damaged..ubuntu log in loop and no interactive programs working from terminal

I have accidentally deleted the content of /etc/bash.bashrc and now I cannot log in as it gives me a loop and I cannot run any interactive programs from the terminal. When I try, I get this error: ...
3
votes
0answers
57 views

Python virtualenvwrapper problem running the initialization hooks

On a fresh install of 16.04, I am trying to install virtualenvwrapper by following this great answer by Gerhard Burger. after configuring the .bashrc, whenever opening the terminal displays bash: /...
0
votes
1answer
61 views

How do I keep the cursor in the middle of the console?

As we know when the command line hits the bottom of the terminal, the input cursor stays at the bottom of the terminal, which makes it a little uncomfortable to see. So I want to make the line with ...
1
vote
1answer
30 views

How to Create a cron job to backup ghost blog directory

I installed dropbox_uploader and set it up. I've successfully created a backup from the command line, now I'd like to make it a script and make it run at midnight daily. Can someone help me create a ...
1
vote
1answer
27 views

Unsure of grep output because of bash wildcards

I am trying to get a better understanding of bash commands. ls /usr/include/ | grep \.h It is supposed to list all the files ending in .h (C libraries) but it outputs more than expected. ...
1
vote
2answers
66 views

How to input chinese character in bash console?

My system is lubuntu,all chinese character can be displayed correctly,and it can be input correctly on gedit , leaf ,firefox. It can't be inputed on my bash console,how to fix it? locale LANG=zh_CN....
3
votes
5answers
567 views

How can I sum numbers on lines in a file

I have a file which looks like this: 1 3 4 1 4 3 1 2 How can I find the total of this (i.e. 1+3+4+1+4+3+1+2 = 19)?
0
votes
0answers
25 views

Bash cannot execute binary file (no longer) [duplicate]

I have some executable files related to the licensing system of Autodesk Maya that I can no longer execute. No longer because I used to be able to run them (a few months ago). I reinstalled the files ...
1
vote
1answer
65 views

Can a script modify an environment variable of its calling shell? [duplicate]

I am setting my JAVA_HOME in my ~/.bashrc file. Now, I need to create a script that will change the JAVA_HOME just for the current terminal, so that I can start an app that needs java 5. I have ...
0
votes
1answer
44 views

Reloading .bashrc after setting variables — shell script

I have a simple script that sets up a CVS repository (and other things) for work. The script has a function which should set up the repository, but it does not properly reload .bashrc. The code is as ...
0
votes
2answers
32 views

Is there a way to make some entries in history “sticky”?

I use the history / CtrlR thing quite a bit, but from time to time either a command I use regularly (but not regularly enough, apparently) "fades out" behind my command history threshold, or some ...
3
votes
3answers
429 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 '...
0
votes
1answer
84 views

strange command prompt error

Whenever I have two command prompts open I always get this script coming up after I execute the commands. Just to clarify the commands execute and output correctly but after the out put before the ...
1
vote
2answers
42 views

Add the next command line after validating the first command [duplicate]

Is it possible to enter the next command line like this: command1 ; command2; After validating command1? For example I do: make And it takes a long time! I want to say: after this command: do ....
1
vote
1answer
32 views

Ubuntu bc weird behavior

There is a weird behavior in Bash script. Trying to run following lines in two different systems. Script: cpuIdle=$(mpstat 5 1 | grep Average | awk '{ print $12 }') cpuUsage=$(bc <<< "100....
4
votes
1answer
38 views

Using CLI, how do I change the user's profile picture?

A similar task for changing the desktop background, can be achieved using the following script: FILE="/backgrounds/background.png" gsettings set org.gnome.desktop.background picture-uri "$FILE" ...
1
vote
1answer
60 views

Changing desktop background in bash

I wanted to make a bash script that takes a random picture from a folder and sets it as the desktop background. I figgured out the algorithm (it's not hard) but i can't find a command that would ...
0
votes
1answer
65 views

Non-jailed SSH user getting /bin/bash permission denied

I've set up a number of different users which each have their own jail directory. Inside this jailed directory they each have all the binaries and libraries they need copied over. SSH access is ...
2
votes
1answer
86 views

Bash /proc/sys/net/ipv4/ip_forward: Permission denied

I tried to run echo 1 > /proc/sys/net/ipv4/ip_forward It says Access denied from bash, I then did: sudo chmod 1+x /proc/sys/net/ipv4/ip_forward and now it says Operation not permitted. How ...
0
votes
1answer
35 views

Script won't Start on Logon of Raspberry Pi 3 [closed]

I am wrote a Bash script that will be run on log-on for the Raspberry Pi running Kali Linux. The issue lies when the linux system starts up, I have to physically SSH into the terminal for the script ...
1
vote
1answer
70 views

Change filetype using zenity

Having zero experience with scripting of any sort, I apologise if this question is too simple to be allowed here. I have discovered zenity, which I think is very useful as my memory is hopeless, so ...
3
votes
1answer
83 views

Where to put export LC_ALL=C? [duplicate]

I ran it once, but my terminal native language went back to Finnish. I've tried unsuccessfully .bashrc and .profile. I have followed the thread here about How to set all locale settings in Ubuntu. I ...
1
vote
1answer
51 views

Limit to bash script execution time with interactivity?

I typically record my steps when deploying systems, and I often will duplicate the server during its initial testing. For example, if I get a little too far in the weeds while I'm testing, I simply ...
3
votes
1answer
21 views

Display images in a loop using bash

I'm trying to display images one after the other automatically using bash. However if I use a command like this. It doesn't close the last image before opening the next. while read p; do eog $...
1
vote
1answer
41 views

Save commandline commands for Python [closed]

I have a tool that's in Python- it resides in a git repository. Whenever this tool is started (say, $mytool start is the command that starts the tool)- I want to save all the following command line ...
1
vote
1answer
34 views

Command history count stuck at 2000

I have custom PS1 bash prompt which includes command history count. It has work flawlessly for weeks, but today I noticed it's stuck at 2000. When I execute command, it gets to 2001 as it's supposed, ...
1
vote
0answers
15 views

passwd : Authentication token manipulation error (Different than other questions)

I'm trying to change password with single command. The command is, echo -e "current_password\nnew_password\nnew_password" | passwd Here's the Output of the command... Changing password for adarsh. (...
0
votes
0answers
60 views

How to resolve ERROR: virtualenvwrapper could not find virtualenv in your path

Other such posts didn't solve my error. I followed this post to install virtualenv and virtualenvwrapper . Now when try running mkvirtualenv Addon-Tests in my project's root directory, I get an error :...
0
votes
1answer
27 views

Why can't my user see environment variable?

I have a .sh file with some environment variables under /etc/profile.d/vars.sh. Its content looks like this: export PORT=8080 This is an Ubuntu 14.04 running on AWS EC2. When I log in via SSH with ...
0
votes
0answers
35 views

Combining Bash Script and Script Resources into One Executable

When trying to execute a bash script, it is often execute inside some directory, and requires access to local resources. I was wondering if there was a way to combine both the bash script and the ...
1
vote
1answer
24 views

Get exit status from Pipe contained in brackets

How do I get the exit status of a command in a pipe contained in brackets: (bzcat File_Here | pv -n --size "Size_in_Bytes" | dd of=/dev/sdX) 2>&1 | zenity --title="SD Utility - Write" --...