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

learn more… | top users | synonyms (1)

1
vote
1answer
153 views

Run script in Terminal via context menu (Open with Terminal)?

this question is simple about "Open/Run in Terminal".... Looks Ubunutu doesn't support bash/shell-scripts the way we know from KDE and any other OS: I tried the obvious: Right click in file ...
1
vote
4answers
36k views

How to write the path of a folder with space in it's name? [duplicate]

I can't figure out how to write the path of a folder that includes spaces in its name (in Terminal). I tried: cd /path/path/path/"A Folder"/file cd /path/path/path/'A Folder/file cd ...
1
vote
2answers
681 views

setting up a script to rotate scren Lenovo Yoga Thinkpad S1

I am trying to set up a Lenovo Yoga Thinkpad S1 to rotate the screen with the touch of a button but I am having a little trouble with the script that actually does the work. I have found the scripts ...
1
vote
2answers
10k views

Ubuntu adding path/Environment variables

I am trying to install apache maven 3 in Ubuntu 12.04 lts. What I did was open the terminal then I typed the following commands export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.5 [Then ...
1
vote
2answers
4k views

How to use Bash Script to open URLs in a different profile with Firefox?

Working on a script to automate some tasks in Firefox. These tasks should run through a clean Firefox profile, so they are fast and don't interfere with any of my regular surfing. #!/bin/bash # ...
1
vote
2answers
235 views

Deleted /bin instead of /android-project/bin

An android project has its /bin directory and what I wanted to do is to deleted this. What I actually mean is delete /path/to/android-project/bin not the /bin directory. So I executed this command, ...
1
vote
2answers
542 views

Creating a directory of recently created files

On a system I have, files are uploaded through a series of various mechanisms into one central "incoming" directory. Once a day those files are processed and they are moved off to where they need to ...
17
votes
1answer
2k views

Why does bash thinks that 010 is 8?

Why does bash think the number 010 = 8? x=010 echo $x 010 echo $(( x+0 )) 8 echo $(( x-2 )) 6 I thought it might be binary, but 010 = 10 = 2. So why does it get 8, and how can I make it think ...
12
votes
5answers
1k views

Using cd command to navigate directories in Ubuntu which have special characters [duplicate]

When I want to navigate into directories having special characters in their names I get an error message. For example: aman@desktop:~/Aman$ cd !)e$!gn&(reate bash: !: event not found ...
8
votes
3answers
153 views

How to run a script when a directory is changed by another user?

I know has been a bit of discussion about topics similar to this. But here is what I am basically trying to do. I have a watch directory called watched and whenever a file is added to that directory, ...
8
votes
1answer
292 views

How to execute a terminal command every time the firefox windows closes

I need to execute this: rm -rf ~/.wine-pipelight/*; rm -rf ~/.wine-pipelight/./.*; cp -a ~/viewright_backup/. ~/.wine-pipelight every time the Firefox window closes. But not necessarily when all ...
8
votes
1answer
23k views

How do I get the parent process ID of a given child process?

How to get parent pid from a given children pid? I know I can mannully check it under /proc, I am wonder if there is a smart/better way to achieve this in Ubuntu. Note the parent may or may not be ...
7
votes
5answers
442 views

How do you output the filename in find command while using -exec?

I use the following line to find all sub-directories of the PWD and run svnadmin verify on each directory (I already know that they're Subversion repositories) find ./* -maxdepth 0 -exec svnadmin ...
7
votes
2answers
658 views

What is the difference between `VAR=…` and `export VAR=…`?

What is the difference in doing $ MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m" to doing $ export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=384m" and is there any side-effect of doing either in an SSH ...
7
votes
2answers
6k views

How to find the version of an Ubuntu machine remotely?

I have more than 60 to 80 systems running Ubuntu. Some of them are with version 8.04 and some of them are with latest version 10.10. Now we are in the process of upgrading all older Ubuntu version to ...
6
votes
2answers
318 views

Bash prompt doesn't print until I interact with console again

I don't even know where to begin to diagnose this one. Usually, when a command finishes, the prompt prints itself for the next command. However, that is not happening. Hard to explain with words, I'll ...
6
votes
1answer
157 views

Conflict between variable substitution and CJK characters in BASH

I encountered a problem with variable substitution in the BASH shell. Say you define a variable a. Then the command $> echo ${a//[0-4]/} prints its value with all the numbers ranged ...
6
votes
2answers
6k views

How do I remove all metadata from a quicktime movie file?

My camera takes .mov files as movies. How can I remove all metadata from them so I can feel confident sharing them on youtube without accidentally sharing when/where they were filmed, what type of ...
6
votes
3answers
11k views

Daily cron job not running

A quick overview: I have a script that will daily backup my source code repository from SVN into a tarball for that day. I have tested the script and it works very well as long as I run it as sudo, ...
5
votes
1answer
261 views

How to automatically install a program bash suggests I install?

I am thinking of the use case of this output: The program 'tiger' is currently not installed. You can install it by typing: sudo apt-get install tiger How can I get it to prompt me to install that ...
5
votes
2answers
187 views

useradd doesn't allow the user to log on

On an Ubuntu 14.04.2 LTS the following command: adduser fu and then entering a password bar and just pressing Enter on all other questions, creates a user that allows me to log on and has the ...
5
votes
3answers
149 views

To which directory should I install a program from a bash script?

I want to install Netbeans 7.0.1 with a bash script from the Netbeans website. The default directory chosen by the installer is /home/geoffrey/netbeans-7.0.1. But I do not think it belongs there.
4
votes
3answers
157 views

How I can monitor new files in a directory and move/rename them into another directory?

A program generates output textfiles, named output.txt, after every 15th iteration of a certain process. Doing so, it overwrites the last output.txt. I want to keep the files however, and I can't ...
4
votes
1answer
2k views

How to check in a bash script if passed argument is file or directory?

I have to write a simple bash script in Ubuntu which would allow me to pass it some arguments and I want to check if these arguments which can contain spaces are files or directories. How can I do ...
4
votes
4answers
4k views

segmentation fault when using su or sudo

example of the problem: $ su Segmentation fault $ sudo ls Segmentation fault I tried to compile sqlite3 from source earlier. I don't know what libraries it installed. This may be the reason why ...
4
votes
2answers
9k views

Bash Tab Auto-complete not working for apt

apt-get install and apt-cache policy do not complete package names. I have double checked /etc/bash.bashrc, no irregularities. Googled for answers but none suffice. Any help/advice?
4
votes
4answers
10k views

Does executing sudo su and su root do the same thing?

What are the technical differences between the two? The only thing I noticed is that sudo su requires you to enter your own password (assuming you're not root) While su root requires you to ...
3
votes
2answers
458 views

copy to clipboard current path from console with no mouse [duplicate]

I'm wondering if it possible to copy to clipboard output of pwd command. I often need to copy some path and I have to select it with mouse, do several clicks and that is annoying for me. What I want ...
3
votes
1answer
1k views

How to execute a script before login screen?

I would like to know , how can I run scripts before the login screen.I mean My script should start running before login screen will appear.How can I achieve that?. I am the root user of that PC. ...
3
votes
1answer
4k views

Using sudo aptitude/apt-get update does not work

Trying to update via terminal via aptitude or apt-get is not working. There is no other package management program running in the background or any other user. I tried both, sudo aptitude update ...
3
votes
1answer
302 views

link key to a bash script

I'm trying to link a button (now without function) to a bash script that I have made on UBUNTU. I'm using a clevo W150HNM/Sager NP5160 I want to use 1 or 4 for this(see photo on ...
2
votes
1answer
313 views

14.10 gnome classic metacity unable to hook up keyboard shortcut to binary

I am trying to get the Aero Snap effect working on an Ubuntu 14.10 using Gnome Classic Metacity. I found a command that works if I execute in on a terminal window: wmctrl -r :ACTIVE: -b ...
2
votes
1answer
8k views

Run bash script from php

I want to run a shell script within a php webpage to check some processes running on my system (Ubuntu 12.04). Googleing I've found about shell_exec() but I can't manage to run the script when loading ...
2
votes
2answers
9k views

Execute sh script from *.desktop file?

What I want to do at all, is that: Create script that has icon on it. So I know only one way - file.desktop file with icon. Settings icon on it was successful, but I have no luck setting EXEC value :/ ...
2
votes
1answer
889 views

Replacing some characters in the previous command

Sometimes, being rushed, it is possible to type some characters wrong in a command-line. If the command is long, the mistake correction may be cumbersome (using arrow keys). So the problem is: how can ...
2
votes
1answer
346 views

How to stop bash prompt colours from escaping

I'm trying to configure bash to display the current git branch, based off the example here, but I can't figure out how to get bash to stop escaping the colour strings. Everything I try results in the ...
2
votes
2answers
2k views

Ubuntu 12.04 Can't Login-Tty Console said: -bash: /usr/bin/byobu/-launch: no such file or directory

I face problem in login to Ubuntu 12.04. I think it's caused by accessing super user (if not wrong). I type sudo nautilus to put a background to burg, but i fail x_x. After reboot, i can't login to ...
2
votes
2answers
2k views

gnome-terminal and logging

Is there any way to log every that was displayed in gnome-terminal? for example I have a complex command doSomethingThatPrintoutsAlot ; doSomethingThatPrintoutsAlot2 ; doSomethingThatPrintoutsAlot3 ...
1
vote
4answers
411 views

Change directory structure from /YEAR/MONTH/DAY/ to /YEAR-MONTH-DAY

I need to change my directory structure for my photos from /YEAR/MONTH/DAY/ to /YEAR-MONTH-DAY I know this can sort of be done with exiftool, but it will only work on files containing EXIF-tags, and ...
1
vote
1answer
233 views

How to add element to the gsettings array at the specific location (given by index)?

I want to write a script that translates devilspie's window rules into compiz' rules. Compiz settings can be changed by gsettings keys in path org.compiz.profiles.unity.plugins.place. There are three ...
1
vote
3answers
5k views

Run .sh script on Ubuntu without using terminal

I'm using Ubuntu and I've created a simple script file: #!/bin/bash cp /home/guilherme/pictures/*.jpg /home/guilherme/backup When I run it on terminal typing the command "./script.sh" it works ...
1
vote
5answers
4k views

How to execute a .sh file when the session starts?

I have a .sh file that I execute just going to the containing folder and writing ./file.sh. I want to execute that file when the session starts, so i create a symlink in /etc/init.d. I expected it ...
1
vote
1answer
3k views

How to get nicer error-messages in this bash-script?

I'm trying to catch any error when run a command in order to write a log-file / report I've tried this code: function valid (){ if [ $? -eq 0 ]; then echo "$var1" ": status : OK" ...
0
votes
1answer
989 views

/var/log/secure not present in 14.04 ,is there any alternative?

While reading about Linux ,especially about sudo I got:: A message such as the following would appear in a system log file (usually /var/log/secure) when trying to execute sudo bash without ...
0
votes
1answer
607 views

Using for loop to create a flexible radio list in a dialog box from a shell script

I want to create a little Program using Dialog to play logfiles created with Script. The problem is that I can't get a dynamic radio list that automatically adds a row if a new logfile is created. So ...
0
votes
2answers
1k views

Logging of commands executed in Bash

Sometime back, we had a requirement to log commands run on the terminal in the Bash shell. This was solved by means of a startup script with essentially the following contents: #!/bin/bash ...
0
votes
2answers
1k views

Batch command that reqiures output redirection

When I want to process a bunch of tex files, I use for f in *.tex; do latex "$f" ; done; What do I do when I need to redirect output to another file, like in case of catdvi? The following does not ...
0
votes
2answers
2k views

How to append text to file every morning?

I would like to append current date to text file every morning at 7am. if the computer is turned off I would like it to be executed after its turned on.
-1
votes
2answers
15k views

Bash return permission denied error when I redirect the output of ls to a file [duplicate]

I'm currently studying shell commands, one of the exercises consists in creating a structure with various directories and subdirectories. I wrote ls -laR > hello, it was supposed to create a text ...
12
votes
2answers
3k views

Why does Ubuntu's default ~/.profile source ~/.bashrc?

These are the contents of the stock ~/.profile that came with my 13.10 (commented lines removed): if [ -n "$BASH_VERSION" ]; then if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi ...