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

learn more… | top users | synonyms (1)

0
votes
0answers
30 views

lightdm.conf command not echoing to file

# LightDM - light Display Manager # # The display manager service manages the X servers running on the # system, providing login and auto-login services # # based on gdm upstart script description ...
0
votes
1answer
33 views

[Edited/include]man: bash. \e and bash shell “enter” token

This is kind of a 2 part question and you'll understand why when done reading. To start, I was trying to figure how to cause an "enter" action inputted into standard output so that the script can ...
0
votes
1answer
69 views

Upstart not running .sh script

The information on the web regarding upstart, init and .conf files is rubbish. A lot of different places show completely different ways of doing things. Anyways, I have a script file ...
0
votes
2answers
35 views

Scrot and Imgur uploader bash script

I have once known how to do this, but totally forgot about it. So I use scrot, i.e 'scrot '%d/%m-scrot.jpg'. I know I can pass an -e argument to execute a program, but that's where I got stuck. I ...
2
votes
2answers
122 views

Run script on login (script with sudo) or startup

#!/bin/bash ids=$(xinput list | awk '/SteelSeries Sensei Raw Gaming Mouse .*pointer/ {print $8}' | sed 's/id=\(.*\)/\1/') if [ -z "$ids" ]; then exit 0; fi read -a ids_array <<< $ids ...
1
vote
2answers
55 views

Display image in fullscreen from command line in Ubuntu

I would like to display from the command line an image in full-screen. I tried to use xli with the following command : xli -onroot -fullscreen logo.gif But it does not display anything. And when I ...
15
votes
4answers
2k views

What is the meaning of the `|` symbol in the shell?

What does the | symbol mean in sudo ps -ef | grep processname command? Also can anyone please explain this command? I have used this command only for getting the PID and killing that process, but I ...
0
votes
0answers
15 views

How to remove java 7 & eclipse version appropraite with java 1.6?

I'm new to java, and I tried to uninstall java 7 using this command: sudo apt-get purge oracle-java7-installer Then tested it by: sudo dpkg --list |grep -i jdk And got: bash /usr/bin/java no ...
0
votes
1answer
51 views

Unicode characters are displayed wrong in bash

I'm using powerline-shell as my bash's PS1. But as you can see in the screenshot, the unicode characters aren't displayed correctly: How do I make unicode characters be printed correctly in Bash? ...
2
votes
2answers
31 views

Finding a string within a variable in bash

I have the following in bash: string="/opt/directory/" Then when I do the following: if [[ $string != *"directory"* ]] it interprets as if the directory is not within string. Why? How can I ...
4
votes
1answer
118 views

Shell variable doesn't change with pipe-while-read combination

Consider case 1: $ COUNT=0 ; while [ $COUNT -ne 3 ]; do echo $COUNT; COUNT=$(expr $COUNT + 1 );done 0 1 2 $ echo $COUNT 3 By the end of the loop COUNT variable is 3, as expected Consider case 2: ...
1
vote
2answers
30 views

set command line parameters

how can i set a "variable" as command line paramter for some cli program. i used to do that in centos this way: set var = "-x" someprogram $var --other-parameters how can i do this on ubuntu? ...
23
votes
2answers
4k views

How new is ctrl+r?

I'm wonderering when this command was introduced and if it is part of some offical linux or is it ubuntu-specific ? How do I search my command-line history for commands I used before?
0
votes
3answers
74 views

How to compare two strings (from user input) in a bash script

Here comes my script, i know i'm doing something wrong so please help me! #!/bin/bash # Description of the script echo "Enter first word " read test1 echo "Enter second word " read test2 cmp $test1 ...
0
votes
1answer
23 views

install by bash

I install mysql-server by bash. But i can't make it auto enter password for root (this image below). enter image description here And here's my code. #!/bin/bash cd /home/userver2 sudo apt-get -y ...
0
votes
1answer
45 views

How to write a script that does collectstatic for django

I want to do an automatic collectstatic script for my django application. I tried various things but it did not work. My last attempt is to call an expect script within a normal script: ...
0
votes
1answer
38 views

How to do more with an expect script than just a log in

I have an expect script that logs into my Beaglebone: #!/usr/bin/expect -f spawn ssh debian@192.168.7.2 expect "debian@192.168.7.2's password:" send "temppwd\r" interact ...
1
vote
1answer
41 views

Disabling Guest account bash script

Hey I'm working on this all purpose script to tighten a ubuntu computers security and one of the things in it is to disable guest account through lightdm.conf. The way my script is setup or at least I ...
0
votes
0answers
17 views

How to automate these cleanup commands using bash(?) [duplicate]

I wanted to know how to automate these commands: echo "Cleaning Up" && sudo apt-get -f install && sudo apt-get autoremove && sudo apt-get -y autoclean && sudo apt-get ...
24
votes
2answers
1k views

What does the “-” in “bash -” mean?

What does bash - mean in the following bash shell code? It seems to be used to take the output the last code as the input. If so, can I just write it as bash or xargs bash? curl --silent --location ...
0
votes
0answers
48 views

Terminal stops working on ubuntu 14.04

My terminal works fine for a while and then it just shuts down. No matter what command I type in and hit enter. It shows nothing but keeps me in wait. On pressing ctrl+c, it gets stuck. The only way ...
1
vote
1answer
93 views

determine the total number of the user's input

echo -n "##### WHICH YEAR OR YEARS? #######" read year How I can check the total number of the user's input (year)? For example user's input as follows; 2013 2014 2015. Then, total number of the ...
0
votes
0answers
87 views

Start a background process, write to stdin and read from stdout without blocking

I have a program which reads from stdin and writes to stdout. In my example it is cat. I want to have three scripts to do something like the following: start.sh cat would create a background process ...
0
votes
0answers
14 views

ubuntu 14.04 after reboot I lost last history of commands [duplicate]

I have Ubuntu 14.04 and I observed that whenever I reboot or had to force reboot (power off) the machine, I lose the history of commands. Normally I lose most or all previous session commands. This ...
1
vote
1answer
38 views

Save apt- dependencies to text-file

I would like to save the list with dependencies for installed programs into a text-file. The reason I would like to do that is for example if I am to install a meta-package, which in turn would rely ...
2
votes
2answers
108 views

How to insert multiple lines with sed

I want to add this #this ##is my text before the line the specific line I tried this sed -i '/the specific line/i \ #this ##is my text ' text.txt but it only adds in 'text'. I also ...
0
votes
1answer
29 views

What is the meaning of -bash?

I typed the command echo $0 in tty1, and it returned -bash, why not bash?
0
votes
1answer
28 views

Newbie grep question… output is doubled

I have been teaching myself bash scripting and I wanted to write a script that makes a txt file with specific hardware information. I figured that 'grep' would be a great tool for pulling the info I ...
0
votes
2answers
51 views

How to make a command execute once a certain command terminates?

What I want to do: Whenever the apt-get install command is run and terminates, run another command immediately without any involvement on the user's part. In my case I want to run a script, but since ...
3
votes
2answers
141 views

How to include/exclude many different files/folders using terminal

I am doing a search for files that have been edited in the last day using the find . -type f -mtime 0 function in terminal. I want to exclude some files and folders in the query, such as .DS_Store ...
0
votes
2answers
66 views

Replace part of filename with string in subdirectories and current directory

I want to be able to do this: rename string1 to string3 and add string2 to the beginning. Sth like Fish renamed to Great_Bear if string Fish is found and Great_ = string2. So far I have this: ls ...
0
votes
0answers
132 views

openvt: “Couldn't get a file descriptor referring to the console”

I try to run openvt -- ls -l but I get the following error: Couldn't get a file descriptor referring to the console What does it mean, and how to solve it?
1
vote
1answer
65 views

Redirecting output from an Oracle console application in a named pipe

I'm currently developing a plugin to compile Oracle code in my text editor. The folks that developed SQL Developer recently added a command line version sqlcl. The problem is, this a Java application ...
0
votes
0answers
34 views

Byobu won't launch on login

I've recently started using byobu instead of tmux but I can't get it to launch on any of my ubuntu 14.04 AWS servers. My steps have been: sudo apt-get install byobu byobu-enable This gives this ...
2
votes
0answers
44 views

Cannot run make - Bash vs Dash

I am on Ubuntu 14.04. 64 bit. I have a C++ source code with a makefile. As per the provider of the code, all I am supposed to do is to go to root directory for the code and type make, which is ...
1
vote
1answer
49 views

When is $TERM replaced from “dumb” to “xterm”?

I added a line to $HOME/.profile just for interest. echo ${TERM:-"\$TERM isn't set."} > $HOME/term/.profile After the next login, I saw a word dumb in $HOME/term/.profile. $ cat term/.profile ...
1
vote
3answers
288 views

How to execute commands in gnuplot using shell script?

What I want to do is write a script which first launches a program and then tells it to execute a bunch of commands and then quit. Lets go with an example. I wrote this script myscript.sh and it ...
1
vote
1answer
46 views

How to run the following command in Ubuntu and which path it is referring to?

Following is my set of script that I need to run but I am not sure about the path it is referring to ? and should I put the whole script in .sh file and then run, or something else to execute the node ...
4
votes
1answer
138 views

Search files content for possible BTC key strings

I have 4 BTC addresses on two of my drives that I cant bloody find. I saved them under stupid name so they would be hard to find if someone had access to my system. Now I cant find them. Is there a ...
3
votes
3answers
134 views

Remove specific lines

I'd like to remove a few lines from a csv file. The rules are simple enough (Keep line if): It's the first line in the file. The first value is different from the first value of the previous row. ...
3
votes
2answers
53 views

copy files by date

How can I copy files in a folder based on when the file was last edited? Lets say I want to copy all my files that I last edited today from c: to my folder bak. How can I achieve that? I know that a ...
0
votes
1answer
16 views

Service won't start when using the service utility but works when calling the init script directly

I'm trying to run Mule on Ubuntu 14.04 as a service. I created the following init script (/etc/init.d/mule) #!/bin/bash JAVA_HOME=/usr/lib/jvm/java-8-oracle PATH=$PATH:$JAVA_HOME/bin # Set Mule ...
0
votes
1answer
27 views

Error: Unable to install any program through Ubuntu Software Center

No matter the program, I get an Error: The file "home/..." could not be opened. I was able to install VMware using gksudo bash command; however it does not work with any other programs. I have also ...
14
votes
9answers
2k views

How to print “-n” without issuing a newline?

I'm trying to print -n using the echo command. But if i simply type echo -n, it only issues a newline, not show up -n, instead it issues a newline.
3
votes
2answers
29 views

Run 1 function of bash script

Is it possible to run only a part of the bash script on startup of ubuntu server? if so how can I achieve this?
1
vote
2answers
31 views

Program not working, any help please?

my program is suppose to print out files that are readable and writable, print out the amount of files (that are readable and writable), print out the total amount of files and finally list all files ...
0
votes
0answers
23 views

Keyboard shortcut not working

I want to execute a command from terminal which uses the output of another command as an argument, so I used $ operator as in sudo arpspoof -i wlan0 $(/sbin/ip route | awk '/default/ { print $3 }') ...
0
votes
1answer
127 views

running bash script on server to execute multiple MATLAB scripts

I'm not a programmer, just a chemist. I'm writing a bash script, which I want to run on the server and expect it to do the following: Open a terminal Loop over folders slave_1, slave_2, ..., slave_N ...
1
vote
2answers
97 views

Pipe users to change their passwords

I am trying to make a bash command change all user's passwords to x. awk -F: '$3 >= 1000 && $1 != "nobody" {print $1}' /etc/passwd Can I pipe the users that are returned to passwd? I ...
4
votes
3answers
99 views

How to set session-wide environment variables and PATH?

I have seen other people on the Internet also having this problem but the solutions have been non-conclusive, so I wanted to bring it to attention again. According to this page in Ubuntu wiki: ...