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

learn more… | top users | synonyms (1)

1
vote
1answer
37 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
93 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
220 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
35 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: ...
0
votes
0answers
17 views

Juju config-changed with GUI returns undefined

I'm writing a charm where I want to allow users to set the name via the GUI. However every time I use the GUI the name is saved as undefined. Setting the config option with the command line gives no ...
3
votes
0answers
38 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
52 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
25 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
26 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
59 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
556 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
votes
0answers
33 views

backup to s3 bucket on shutdown script not working in ubuntu 14.04

I edited shutdown-hook.conf via vi /etc/init.d/shutdown-hook.conf The content is description "run at shutdown" start on starting rc task exec /bin/bash /etc/my_service/uploads3.sh Then i changed ...
1
vote
1answer
59 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
37 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
30 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
392 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
72 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
39 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
28 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
25 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
52 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
58 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
56 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
31 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
68 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
53 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
43 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
16 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
40 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
33 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
14 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
36 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
24 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
33 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" --...
2
votes
1answer
20 views

How to feed multiple options to a command from a file?

I want to feed the list of options sitting in a local file to a command Example1: path of files to be deleted are in a file. How would you feed these paths to sudo rm -rf ? ** Example2 list of name ...
0
votes
0answers
23 views

Error when running ssh: -bash: exec: cd: not found

Here is the output on the terminal when I run ssh, not sure what is wrong. Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-86-generic x86_64) * Documentation: https://help.ubuntu.com/ 10 packages ...
1
vote
1answer
17 views

Cant set HISTSIZE lower than 1

For some reason, I cant set HISTSIZE smaller than 1 $ export HISTSIZE="2"; echo $HISTSIZE 2 $ export HISTSIZE="1"; echo $HISTSIZE 1 $ export HISTSIZE="0"; echo $HISTSIZE 1 $ export HISTSIZE="-1"; ...
0
votes
0answers
39 views

Comparing integers in bash doesn't work

Why this doesn't work: #!/bin/bash if (( 3 > 2 )) then echo "EXPECTED RESULT!" fi Output: test.sh: line 3: ((:  3 > 2 : syntax error: operand expected (error token is " 3 > 2 ") ...
1
vote
3answers
72 views

How can I create a command with arguments and a configuration file? [closed]

Directly to the point, I want to give the user the flexibility to pass arguments to a command in order to control how the commands should run, something like: pcap -d 30 -w 2 In other words: I ...
2
votes
0answers
32 views

How to start several applications with one command to open in a specific workspace?

Since Ubuntu has no options to save and restore desktop sessions on shutdown of the computer, I want to write a shell script which helps to setup a customized workspace on a single command. I've found ...
1
vote
1answer
32 views

Why am I still unable to run a script on NTFS partitions after remount with suitable perssimions?

I use a mobile hard disk in ubuntu and I want to run scripts on the disk. At first, the permission is denied. Therefore, I followed the advices in this answer How do I use 'chmod' on an NTFS (...
1
vote
1answer
33 views

Loop trough all folders recursively end execute make command when Makefile present

I really suck in bash scripting, so i'm hoping on your help guys. I need a script which will loop trough all folders, sub folders, sub sub folders, etc. inside folder /home/work and if there is ...
11
votes
2answers
2k views

CPU temperature embedded in Bash command prompt

I was wondering if it would be possible to obtain the CPU temperature and embed it into the command prompt. This is my output for sensors: $}-sensors coretemp-isa-0000 Adapter: ISA adapter Physical ...
6
votes
4answers
791 views

renaming folders using a .txt file

I'm working in my terminal using bash trying to rename the folders: 1 2 3 4 5 I'd like to rename them according to a.txt file: a 2 c 3 d 5 e 1 b 4 The order in the .txt file is completely random....
0
votes
2answers
43 views

Messed with my /etc/profile and now an error pops up every time I log in

I am fairly new to Ubuntu, and did a little more messing around than I should have. I was reading a guide on downloading the Oracle 8 JDK and it said to change the last few lines of the /etc/profile ...
0
votes
1answer
20 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