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

learn more… | top users | synonyms (1)

0
votes
0answers
38 views

getting error in opening py file [duplicate]

I'm installing a software in Ubuntu 12.04 and got the following error: http://paste.ubuntu.com/7638369/ server@ubuntu:~/Desktop/revkit-1.3$ ./tools/gui/gui.py Traceback (most recent call last): ...
3
votes
5answers
4k views

Removing specific part of filename (what's after the second dash) for all files in a folder

I use the command line utility youtube-dl to download videos from YouTube and make mp3s from them with avconv. I'm doing this under Ubuntu 14.04 and very happy with it. The utility downloads the ...
1
vote
1answer
34 views

Translating to Bash Command

So for a project for school I had to install the DPJ extension to the Java language. I downloaded and unpacked a tarball containing the files, and then was told to run the following: setenv DPJ_ROOT ...
4
votes
1answer
298 views

Why my 'at' clause command execute the shell immediately and ignored the time limit?

I wrote a shell named t.sh It's content is: touch 88888 The command I'm using is sh t.sh | at 03:13Jun15 After I execute this command, I got this show on my screen: warning: commands will be ...
0
votes
3answers
3k views

Run script full screen in terminal

How do I get a bash script to run in full screen when it's executed or how can I change the terminal size if I can't make it full screen?
-1
votes
1answer
61 views

Why no shell expansion?

Why might bash not expand *? I want to remove all the sites-* files except for the last one, but I would like to test the expansion before running the command and rm lacks a --dry-run option: $ ls ...
5
votes
2answers
997 views

Recursively apply the msgfmt command to all .po files in directory with find -exec

I have the following directory structure: webiste/ locale/ en/ LC_MESSAGES/ translation.po de/ LC_MESSAGES/ ...
0
votes
2answers
310 views

Cron doesn't execute one of the scheduled jobs

I'm using a lubuntu desktop, distribution Ubuntu 13.10, i686. This is my problem: in the job list scheduled by cron a job hasn't effect, but in /var/log/syslog its execution is traced. This is the ...
1
vote
1answer
851 views

bash script move file to folders based in name

I hope you can help me... I made a perl and bash script to make a backup of my firewalls and tranfers via tftp #!/bin/sh perl /deploy/scripts/backups/10.160.23.1.pl > /dev/null 2>&1 ...
2
votes
0answers
56 views

Script Issue (Incrementation) [closed]

I'm writing a script in bash. My output down below is wrong. The test data I'm pulling from makes it so that all connections allowed and denied should be in time "00" yet for every day I crawl through ...
0
votes
1answer
119 views

How do I enable automatic history expansion for commands using 'magic space'?

I read on a blog somewhere about the possibility to use automatic history expansion before actually executing a command or even pressing the enter key in the command line. It involves the ...
4
votes
2answers
4k views

terminal closes immediately after open

I rebooted recently, and now terminal fails to work. If I click the terminal shortcut or use Guake or ctrl-alt-T, the terminal opens briefly with no prompt, then immediately closes again. I installed ...
3
votes
2answers
441 views

Why does a bash-zenity script has that title on Unity Panel and that icon on Unity Launcher?

I have this small bash script which helps use Infinality font rendering options via a more user-friendly Zenity window: http://gnomefiles.org/content/show.php/Infinality+Style+Changer?content=161984 ...
1
vote
1answer
282 views

text is not appearing at cursor in bash, can I reset it somehow?

This happens sometimes if the VM bumps up against upper limits of memory and has to hit swap heavily for extended periods (a few minutes or more). When this happens and I type asdf at the prompt it ...
0
votes
1answer
6k views

Cannot execute binary file

I am new to Ubuntu and I'm trying to install Popcorn Time. I downloaded 32 bit version and tried to install it but that's where the problem started showing. I double clicked the executable file and ...
1
vote
1answer
214 views

write a bash which open firefox on every ten minute

Is it possible to write an script which do a specific command every ten minute? I do not know if this is a loop? For example Every ten minute delete a file name foo on the home directory? or every ...
4
votes
3answers
621 views

Add “not” to if statement in shell script

I have the following script that should exist if the user does not exist. #check if user currently exists on system if id $User > /dev/null 2>&1 then #user exists no need to exit ...
1
vote
3answers
253 views

Help creating a messagebox notification with yes/no options before an application runs

I started using Ubuntu alongside Windows about 2 months ago. I've slowly been adding all of the programs that I use regularly to Ubuntu, so that I will eventually be able to do everything in Ubuntu ...
2
votes
1answer
439 views

How can one run a shell script just before the desktop session begins?

I want my system to run with 1366x768 resolution. Note that this resolution is not detected by the open source driver. So I created a bash script as follows :- xrandr --newmode "1368x768_60.00" ...
0
votes
1answer
44 views

How to create a script to launch several emulated ROM inside a folder

I would like to create a script to run simultaneously all the N64 Roms that I put inside a folder, reading the names from a text file. Since now I did a script like this: cat ./listN64_full.txt | ...
7
votes
1answer
122 views

How to lists different image-formats recursively in a tree?

How would I efficiently go about searching for .png | .svg | .xpm image-files in a complex and recursively structured hierarchy in one query, using terminal (and if possible | (pipe) tree in the same ...
2
votes
1answer
146 views

Can I open a new terminal with a new binary executing in it?

I tried to write a script that opens a new xterminal with some binary file(not command) running in it.The whole script looks like this: #!/bin/bash XTERM="/usr/bin/xterm -bg WHITE -e ...
0
votes
2answers
1k views

Is it safe to alias rm to safe-rm?

We are happy to use safe-rm as a replacement to rm, but is it considered safe to alias it? e.g. alias rm='safe-rm'
0
votes
1answer
190 views

How to create a new user defined command to kill processes using process name?

Suppose I wanted to kill firefox , I just write pidof fi(press tab)refox (appears on its own) , then I write ' kill 'id given by pidof' ' on terminal. I know that I can write 'kill `pidof firefox` ' ...
3
votes
1answer
752 views

Bash script runs fine, but not in cron

I have a script that's supposed to record a shoutcast stream for an hour, convert it to mp3, and then save it. The script runs correctly when I run it from the terminal, but I can't seem to get it to ...
18
votes
2answers
5k views

Pressing enter produces ^M instead of a newline

For example, if I am tail -fing a file or reading user input, <Enter> will produce ^M in the terminal instead of ending the read or adding a newline to stdout. ^J works fine. I'm sshing into ...
1
vote
1answer
119 views

-ln links to wrong file

I've just installed matlab and want to be able to call it from the terminal. It works fine when I explicitly call it from its directory. I cd to /usr/local/bin and type sudo ln -s ...
7
votes
1answer
3k views

No such file or directory when executing /usr/bin/time

I'm building my own android rom. In order to build it, I need to run mka -j8 bacon However, I wanted to measure the time it took to build it, so I used /usr/bin/time -f ...
1
vote
0answers
106 views

No Tab Bash Auto-Complete for apt in Ubuntu 14.04 [duplicate]

Now Ubuntu 14.04 is released and I upgraded my system a few days ago. One major change was the introduction of a new version of apt. Fortunately, it is possible to do the most common task by just ...
1
vote
1answer
45 views

Print out the amount of times 2 words appear in the syslog. But also have it tell me how many times for each hour

So I'm trying to create a bash script that looks for two words in my syslog file. Then I want the script to print out how many times those two words have appeared. Also I want it to print it out for ...
0
votes
1answer
239 views

What does the 'sudo -s' command do, and how is it used in this example?

I have the following doubt. In a tutorial related to a software installation that I am following say that I have to execute the following commands (I am doing it into an ssh shell, so this list of ...
2
votes
3answers
7k views

build command by concatenating string in bash

I have a bash script that builds a command-line in a string based on some parameters before executing it in one go. The parts that are concatenated to the command string are supposed to be separated ...
0
votes
4answers
8k views

Creating A Simple Bash Script With Multiple Commands [duplicate]

Trying to create a bash script that opens gnome-terminal, and then runs ls to display the contents of a directory, but it just opens gnome-terminal. I will be creating some other scripts that also use ...
0
votes
3answers
295 views

alias/function with command line arguments

I'm tired of typing manage.py startserver 10.211.55.4:4000, so decided to make an alias for that. Only thing is: the port sometime changes. So I did this in bash profile: function runserver() { ...
21
votes
3answers
3k views

Why does “A=10 echo $A” not print 10?

This command: A=10 echo $A prints an empty line. Why not 10? Why doesn't the in-place temporary environment setting work? I want to know the reason and explanation rather than solution. I used ...
0
votes
2answers
93 views

Something is wrong with my bash prompt?

So when I type with my new bash prompt it goes on for a while, but if the command gets to long it loops around itself and writes over bash prompt. Here is my PS1 : PS1='\e[0;34m\A\e[m | ...
0
votes
1answer
229 views

Help writing server script to ban IP's from a list

I have a VPS that I use as an openvpn and web server. For some reason, my apache log files are filled with thousands of these hack attempts: "POST /xmlrpc.php HTTP/1.0" 404 395 These attack attempts ...
2
votes
1answer
345 views

Startup & shutdown scripts for Java servers

I am trying to design a graceful startup/shutdown script (Bash) for a Java app (JAR) that I will be deploying to my Ubuntu 14.04 server. I'm looking for a clean, Linux- and Ubuntu-friendly way of ...
0
votes
2answers
205 views

Redirecting output to std output or /dev/null depending on optional parameter

I have a script where you can run it just like this ./myscript and the output of some commands called inside the script are hidden, just like this: if mvn tomcat:deploy &> /dev/null; then ...
1
vote
1answer
50 views

Changing current directory to directory that have identifier as the substring

My terminal is currently in the home directory, and the home directory contains a directory which have "round" as the substring. Is there any way to directly change to that directory without typing ...
2
votes
1answer
75 views

What do the '?', '.' and '+' symbols mean when I run 'who -aH'?

What does the plus sign (+), question mark (?) and period (.) mean in the idle column when I run who -aH? I tried Google, but the results are all about regular expression and wildcards. EDIT: I ...
6
votes
2answers
3k views

Hiding output of a command

I have a script where it checks whether a package is installed or not and whether the port 8080 is being used by a particular process or not. I am not experienced at all with bash, so I did something ...
1
vote
2answers
153 views

how can i find all files that contain embedded crc32's

how can I find all files that contain embedded crc32's e.g. Mydocument190_[F285E17D].pdf using the find command to clarify the crc32's are always within brackets [F285E17D] and the file names may ...
1
vote
2answers
668 views

Running shellscript with cronjob is making problems, executing manually not. Ideas?

I made a shell script called /home/root/cron_grads.sh (chmodded 755) on my server. In this directory are more grads-scripts like 500hPa_p0.gs (644). My main script creates a temporary file ...
9
votes
4answers
33k views

How to check the process is already running or not

I want to check the particular process in already running or not. I refereed this Q&A. But I didn't get any specific solution. Following is the example that I tried: I have created abc.sh file ...
1
vote
1answer
86 views

Install bashmark on ubuntu 12.04

I followed the instructions at this page: http://www.huyng.com/projects/bashmarks/ to install bashmark on ubuntu. I have not understood what the guide mean with "add source ~/.local/bin/bashmarks.sh ...
1
vote
2answers
444 views

How to create a script which opens the browser and logins to a particular Gmail account?

I have created a bash script login.sh. I want it to open the browser and login to my Gmail account. I tried using the following command to open the browser with www.gmail.com. xdg-open ...
16
votes
4answers
4k views

Why does terminal auto complete sometimes not suggest anything for the `services` command?

Sometimes, when I type a command on the terminal, the terminal's autocomplete does not work, even if my command is not wrong. For example, take look to this: sudo service vsftpd status sudo and ...
1
vote
2answers
124 views

What are the standard Environment variables ($) in Ubuntu?

I know some useful environment-variables like $HOME, $UID, $BASH, $LOGNAME etc. which is useful to get information in terminal/command-line with using echo(ex: echo $LOGNAME) I want to know what are ...
1
vote
2answers
2k views

bash: config.sh: No such file or directory

Whenever I open my terminal, it displays bash: config.sh: No such file or directory followed by the command prompt in the next line. My .bashrc file contains: source config.sh I mainly use Ubuntu ...