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

learn more… | top users | synonyms (1)

0
votes
1answer
24 views

Configuration for green tty's foreground and boot text after grub menu

I have set up my system (Ubuntu 14.10) for a text boot up. I need to configure my ttys and boot in such a way that it shows green font for boot messages and ttys.Right now, after the grub menu(which ...
0
votes
0answers
20 views

Typing the command too long eats up the prompt when using the promptline theme

I am using the edkolev/promptline.vim theme(just installed it) for customizing the bash prompt. The biggest problem is that whenever I type long comments it replaces the prompt instead of continuing ...
32
votes
2answers
343k views

How to copy files via terminal?

I have read about copying files with terminal but these examples will help me a lot. So here is what I want to do: Examples: I have a file in /home/levan/kdenlive untitelds.mpg and I want to copy ...
0
votes
0answers
25 views

awk add certain colum if two columns are similar

First at all I apologize, but I am a newbie in scripting, and I try to learn something. I have a file which looks like this: 1 A 84.54 47355 1281 1 A 80.16 47355 761 1 A 81.63 ...
0
votes
1answer
18 views

keep track of multiple terminals from shell script

I am writing a quick start shell script to automatically set up my development environment for a current project. However, none of the commands in the shell script can be executed after my server ...
-2
votes
1answer
24 views

Bash regular expression

I need to write a regular expression in bash to find the words with 5 characters where the last character is 'c' and the words contain a '.' (dot). And also to write a unix command to get a list of ...
1
vote
3answers
69 views

How can I get rid off fork bomb?

I tried the fork bomb code : :(){:|:&};: and closed the PuTTy. Now it is not accepting the new connections(Denial of Service attack). How can I recover from that ?
0
votes
1answer
22 views

exit shell script when a process check is failed

i need to exit from shell script when TESTEXCHANGE process is not running on a host.How can i handle this: I have a script processcheck which checks if the process is running. I call that to the ...
0
votes
0answers
24 views

Start bash script from another script

I have two scripts /etc/init.d/script_1 and /opt/script_2. I need to call script_2 from script_1. In script_1 i write: /opt/script_2 And it works. But there is small option with script_2 - it must ...
0
votes
1answer
28 views

Bash Script for Running Command in Root in ADB Shell

I am trying to dump the partitions of Android devices with netcat. I have created 3 bash scripts for supporting the process. I have trouble on the second which to dumpt the specific partition ...
0
votes
1answer
36 views

read file names from files for command line

I want to run a program requiring comma-separated arrays of files as follows: program -input1 A.txt,B.txt,C.txt -input2 D.txt,E.txt,F.txt -out out.txt My bash attempt: I'm running command from a ...
0
votes
0answers
14 views

Blueman terminal commands

I'm having trouble with blueman conflicting with my wifi drivers and want to create a bash script that turns blueman off, restarts network-manager and then turns blueman on. The problem I'm running ...
0
votes
2answers
461 views

How can I get Subliminal to work and then integrate it with a file manager?

I have downloaded Subliminal which is a program that downloads movie subtitles.But there are several problems: (1) when I test it at the console with a movie that I know has an English subtitle, I ...
1
vote
2answers
24 views

Copying exact amount of files via scp

I'm copying pictures form my iphone via scp, where filenames looks like this IMG_3134.JPG. And let's say I'd like to copy files from IMG_3094.JPG to IMG_3134.JPG. Using special characters like * or ? ...
1
vote
1answer
30 views

bash alias with parameters [duplicate]

I would like to swap from csh to bash, then I have to set the .bashrc with the commands I use. Translating alias with parameters seems to be not easier as I believed. csh: alias gr 'xmgrace -legend ...
42
votes
14answers
127k views

How can I create a select menu in a shell script?

I'm creating a simple bash script and I want to create a select menu in it, like this: ./script echo "Choose your option:" 1) Option 1 2) Option 2 3) Option 3 4) Quit And according to ...
13
votes
6answers
35k views

How to round decimals using bc in bash?

A quick example of what I want using bash scripting: #!/bin/bash echo "Insert the price you want to calculate:" read float echo "This is the price without taxes:" echo "scale=2; $float/1.18" |bc -l ...
0
votes
1answer
21 views

Ubuntu 14.04 VPS - How to keep process running in background and periodically make sure that it is still running

I have an Ubuntu 14.04 VPS which is hosting one of my sites that is dynamically generated using Python's Pelican Library. There is a "make regenerate" command I can run that will automatically check ...
12
votes
3answers
3k views

How to do: underline, bold, italic, strikethrough, color, background, and size in Gnome Terminal?

How to do: underline, bold, italic, strikethrough, and color in Gnome Terminal? Bold Italic u̲n̲d̲e̲r̲l̲i̲n̲e̲ s̶t̶r̶i̶k̶e̶ ̶i̶t̶ ̶l̶i̶k̶̶e̶ ̶i̶t̶s̶ ̶h̶o̶t Color background font < (its mono ...
14
votes
4answers
4k views

How do I redirect command output to vim in bash?

I am trying to redirect the output of a bash command into a new file. If I try the pipe as below : ls -la | vim Bash shows me the errors : Vim: Error reading input, exiting... Vim: preserving ...
0
votes
1answer
26 views

List all commands that Alt-F2 offers

I'd like to obtain a list of all commands that can be run via Alt-F2. So for shell commands this would be: compgen -c I need something similar, but only for graphical commands. So e.g. rhythmbox ...
1
vote
3answers
212 views

Shell script If syntax error

if ($(ipcs|grep test|wc -l)=630); then echo "Shared Memory check passed" fi I get below error: ./Test1: line 25: 636=630: command not found
2
votes
4answers
263 views

Parse lines with specific pattern out of file

I have a file that looks roughly like this : [25]:0.00843832,469:0.0109533):0.00657864,((((872:0.00120503,((980:0.0001 [29]:((962:0.000580339,930:0.000580339):0.00543993 ...
0
votes
1answer
66 views

Installing YADR on Ubuntu 14.04 error - prezto: old shell detected

I have a fresh install of Ubuntu 14.04 on VirtualBox, and I am trying to install YADR (https://github.com/skwp/dotfiles), which works really well on Mac OS X. However, after I finished installing and ...
1
vote
4answers
2k views

Keyboard shortcut to a sudo-script

How do I create a keyboard shortcut to a script that needs sudo privileges? I tried to create shortcuts via Ubuntu Keyboard Settings GUI to scripts "sh script.sh" "sudo sh script.sh" They ...
2
votes
0answers
28 views

Execute prelogin scripts for SSH

I would like to know how I can execute a local server script, for instance send a mail using mailx, when a ssh session is opened, pre-login stage. When a ssh connection comes into the server, I ...
1
vote
2answers
4k views

How to add the logs to a crontab with time stamp

In crontab, I scheduled a daily backup script. Now when the cron executes the script the status are logged to a log file as shown below. 0 0 * * * /home/backup.sh > ...
1
vote
0answers
14 views

incrontab IN_CREATE event fires four times

I was looking into incrontab and tried it out as follows: /tmp/incron.sh : echo "$1 Content: `cat /tmp/test/a`" >> /tmp/incron.log incrontab -l: /tmp/test/a IN_CLOSE_WRITE /tmp/incron.sh ...
6
votes
3answers
13k views

Using up arrow to run previous command

What setup do I need to use up-arrow to run previous command? With Mac, I can use up-arrow to rerun the command that I just run, but it doesn't seem to work with my bash shell. I use 8.04 (I can't ...
2
votes
0answers
15 views

Print the last error message from stderr?

I have a script which deploys a web service, and I found this little helper to exitWithMessageOnError. exitWithMessageOnError () { if [ ! $? -eq 0 ]; then echo "An error has occurred during ...
2
votes
2answers
116 views

How can I copy the path to the currently opened file in gedit to the clipboard?

I am trying to write a custom command in Gedit which copies the currently open and active document's path(both upto parent dir & upto file) to clipboard, as I couldn't find any gedit-plugins or ...
1
vote
2answers
71 views

How to paste the text selected from gui mode after switching into cli mode?

I have set up ubuntu-14.10 to boot up in text mode (cli) and I start gui with the command sudo service lightdm start then toggle between gui and cli mode with Alt+ctrl+F1 (to get into cli) and Alt Gr ...
0
votes
1answer
18 views

Configure date to UTC format

There are a few answers to this that help with the gnome taskbar date-time display, and one answer that gives me exactly what I want, namely, date +%Y-%m-%dT%T which I've incorporated into .bashrc ...
3
votes
2answers
72 views

Where are file properties stored on the actual file system?

I am creating a program that takes a hexdump of a file, so that I can then transmit that somewhere, and have the file reconstructed, however the hexdump is only of the file contents, I also need to ...
2
votes
1answer
41 views

rsync multiple IP's using bash script?

I am trying to use rsync to synchronise remote files with local server. It works great but I want to do it on multiple remote servers to sync with on daily basis. sshpass -p "xyz" rsync -avz ...
0
votes
1answer
59 views

Copy standard output to file

Script1 uses echo (and other commands) to standard output. Script1 also runs other scripts, which also use echo (and other commands) to standard output. Script1 is called by a scheduler that stores ...
0
votes
0answers
50 views

Execute jar file when user mount a loop block device linux

I successfully created and mounted a loop block device using these commands. dd if=/dev/zero of=my_fs bs=1024 count=30720 losetup /dev/loop0 my_fs mount -t ext3 /dev/loop0 /mnt/fs_mount_location/ ...
0
votes
1answer
20 views

Added wrong path to $PATH variable but can't find old varaible to delete it

I'm trying to install virtualenv and virtualenvwrapper to set up and IDE for Python, following a tutorial for this on Ubuntu I accidentally entered the wrong path to the virtualenvwrapper. When I try ...
0
votes
0answers
32 views

ElementaryOS Freya Installing RVM and ruby problems [closed]

Hi i have problem installing RVM and Ruby itself with ElementaryOS freya. I have installed RVM but when i try to install ruby running. rvm install 2.2 i get this. Searching for binary rubies, this ...
31
votes
3answers
30k views

How do I add environment variables?

I'm running Ubuntu 11.04. I use the terminal to start a bash session, and I want to add an environment variable: $r@hajt:~$ env THEVAR=/example But it's not working. It shows all the variables with ...
6
votes
3answers
8k views

using grep with pipe and ampersand to filter errors from find

I am using cygwin to find a file on the cygdrive. However I need to suppress the permission denied messages (otherwise the results get hidden in the error messages). The following command works: ...
1
vote
1answer
155 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 ...
0
votes
0answers
28 views

Can't execute an executable binary file

I have an executable file on my Ubuntu 12.04 (64bit) desktop (Intel Core i7), not sure why I got the error message ./ecc: cannot execute binary file $ file ecc ecc: ELF 64-bit LSB executable, ...
0
votes
3answers
94 views

Problem with “while read” and paste

I have 69 files called *.sites.pi. For instance, OC9.sites.pi, cu27.sites.pi, etc. The prefix of each file (that is before the .sites.pi) is in a file called ind_list. $ cat ind_list OC9 Ocu27 ... ...
0
votes
0answers
22 views

rc.local commands execution

The general idea is: I have developed a script.sh (in java) that take a value from a .txt where a python code is saving data from a sensor, (with a specific range of time). This value is up to the ...
4
votes
4answers
7k views

bash profile works for user but not sudo

I've modified my .profile to include a folder if a flash drive is plugged in. When running the command as the user it works fine but tells me the scrip must be run by sudo (this is what i want). ...
1
vote
1answer
43 views

How do I run this script with sudo from the command-line? [duplicate]

I have the following script in my user's bin directory; let's pretend the filename is 'myScript': #!/bin/bash python3 /myPath/myProgram.py "$@" From the commandline, if I type myScript, it ...
1
vote
2answers
74 views

The foreground color changes after `ls` command

I change shell's foreground color with echo -ne '\e[1;31m' command but when I execute ls command the foreground color reverts back to the original previous color. This weird behavior doesn't occur ...
1
vote
2answers
4k views

Cannot run bash script from crontab when it works from command line bash

I have a strange problem of being to able to run a bash script from commandline but not from the crontab entry for root. I am running Ubuntu 12.04. * * * * 1-5 root ...
1
vote
2answers
38 views

Cronjob bashscript help

I've looked through a bunch of cronjob troubleshooting guides, but I can't seem to find what I'm doing wrong. This script runs just fine if I run it manually. Running it from crontab just isn't ...