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

learn more… | top users | synonyms (1)

0
votes
5answers
660 views

Is deleting my entire home folder contents like resetting everything to where it was during install?

Or does Kubuntus install process generates something in there that is not generated like it is now after I deleted everything. Sidequestion that led me to this is. Does 13.04 don't have the ...
11
votes
1answer
824 views

How can I programmatically determine if a system is a desktop or a server?

Is there any way to distinguish between Ubuntu Server and Ubuntu Desktop? I have a Bash script (shameless plug) that I use to set up lightweight web servers, and I've noticed that when I run this ...
0
votes
1answer
37 views

Prevent option popup when launching a bash application

when I double click on my bash (.sh) application Ubuntu asks me if I would like to reun the application in the terminal, just run the app or display its contents. How canI prevent this popup from ...
0
votes
1answer
534 views

Bash - How to execute a Terminal command without opening the Terminal GUI

I am trying to execute a Terminal command in bash, but I don't want the Terminal GUI to open. Here is my code: #!/bin/bash gnome-terminal -e "java ABC" Any suggestions? Thanks!
4
votes
2answers
23k views

How to make terminal autocomplete when there are several files/directory?

If I have several directories, like: afoo abar sometimes my terminal will refuse autocomplete when I press tab (e.g. "cd a" then tab), and print the list of directories instead. Sometimes it even ...
5
votes
1answer
163 views

I Recently Installed Ubuntu Desktop GUI Over My Ubuntu Server Install and I Broke Some Bash Commands

I have been running a virtualbox of Ubuntu Server for web development and have been getting along quite nicely. I decided to install Ubuntu Desktop via "sudo apt-get install ubuntu-desktop" so I can ...
5
votes
2answers
861 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/ ...
8
votes
1answer
2k views

How to package a simple bash script

The below bash script was written in ~10 sec, but packaging it would take me hours of skimming through big walls of text so I ask my self if there is an easy way out there that I don't know about. ...
3
votes
2answers
918 views

Can I reload monitors.xml without restarting LightDM?

I was writing myself a short script to turn off my laptops monitor in order to only use the bigger external monitor, as I don't always want to use Unity GUI. But after turning the laptop monitor back ...
1
vote
2answers
279 views

Installing packages remotely via bash script in ubuntu

I am trying to install firefox packages to all my linux hosts remotely using a bash script. But when ever i execute the script i get the following error. How do i enable DISPLAY in bash script? ...
1
vote
3answers
847 views

how to set up sublime text 2 as environment variable sublime

I just installed sublime text 2 on Ubuntu 12.10 and would like to be able to run it as its own environment variable. Example $ sublime somefile.js how do I add custom variables?
9
votes
2answers
3k views

Why .profile (and not .bashrc) appends ~/bin to path?

Since .bashrc is more "generic" (in the sense that .profile sources it), why "include ~/bin to path" procedure is not inside .bashrc? Why the user would not want it in a non-login shell? (Especially ...
23
votes
1answer
19k views

Bash: delete word ahead of cursor

Consider the following bash prompt, where ^ denotes the prompt location: svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue" ^ I'd like to commit a different ...
4
votes
1answer
1k views

How can I mark all packages with installed dependents as “Automatically Installed”?

There are some similar questions, but here is precisely what I would like to achieve and the dots which I am having trouble connecting: Query a list of "Manually Installed" packages (apt-mark ...
0
votes
0answers
285 views

Execute BASH script on shutdown [duplicate]

I have a KVM switch (Trendnet TK 409) that helps me switch between my Ubuntu laptop and Linux computer. The switch use a hotkey for switching (numlock+numlock). Unfortunatly, that only works on ...
0
votes
1answer
296 views

.profile file not getting updated in Ubuntu 12.04, trouble installing mysql

I'm trying to install mysql in ubuntu to run ruby on rails. I was going through the tutorial at Lynda. I have successfully installed ruby, gem & rails. ruby -v ruby 1.8.7 (2011-06-30 patchlevel ...
2
votes
1answer
646 views

Is there a “Super” break key for bash?

When using terminal sometimes you need to break the program. Sometimes you press Ctrl-c sometimes Ctrl-x and sometimes Ctrl-z In some circumstances, it might simply be closing a quote or pressing ...
1
vote
1answer
534 views

execute script when network interface is up

i have this piece of bash script : internal=$(/sbin/ifconfig $adapter | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}') $adapter="eth0" i want to execute this until internal has the ...
3
votes
1answer
3k views

running gnome-terminal with no window border on startup in xubuntu 12.10

I created a script to launch a session of gnome-terminal when I log into xubuntu. I specifically wanted it in a specific position on the window, and with no window borders (surprisingly, there's no ...
4
votes
1answer
2k views

LXTerminal and XTerm Resize Command

I want to execute a command in a bash script that will resize the terminal window. In xterm xterm -geometry=30x30 will create a new xterm window, and lxterminal --geometry=30x30 will create a new ...
4
votes
1answer
169 views

Help Debugging Backup Script

Every 3 hours the script will run and backup a folder "SOURCE" and it will save it along with the other backups of the current day in the folder "month-day-year" e.g. "03-24-13". When a new day comes, ...
6
votes
2answers
9k views

How to protecting cd command to deal with parentheses?

I asked here how to make cd protect spaces. Tab completion is great, but sometimes you paste the path from the clipboard so this is useful. The solution breaks with parentheses however. No matter how ...
75
votes
5answers
104k views

How to list all variables names and their current values?

Including not only $HOME, $PWD etc but any other you have defined.
2
votes
3answers
101 views

How to see available commands that end with a certain string?

If you start typing and pressing tab the console tries to expand and show all commands, functions and executable scripts that begin with what you have started to write. Is there a way to see which ...
5
votes
1answer
133 views

How to get select statement choices into If statements?

I'm very new to programming on Ubuntu. And I'm trying to do a simple bash script. I have a select menu working but I want the choices made in that to go into a number of if statements, corresponding ...
3
votes
1answer
849 views

Locale warning while executing adduser

I just tried to add an user to a group $ adduser someuser sudo perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:en", LC_ALL = ...
5
votes
1answer
175 views

Can I create a new script and chmod it in one command?

When writing answers on here, it's often necessary to create a new script and chmod +x it to make it executable. I won't go into whether this is a good thing or not, but explaining to people that they ...
0
votes
1answer
3k views

Open file with terminal and close terminal afterwards

I want to open a file using the terminal on ubuntu. To have it independent from the terminal, I use gnome-open: gnome-open text.pdf And since I'm lazy, I also have this alias in my .bashrc: alias ...
1
vote
1answer
116 views

Bash escape from script

I have a simple app launcher script used to open a few apps in a ceratain folder on a certain workspace: #!/bin/bash if [[ -n "$2" ]] then wmctrl -s $2 fi terminator ...
2
votes
1answer
850 views

Can't redirect all output of program

I am attempting to redirect all output of a program (Steam) to /dev/null so it doesn't show up in the terminal. Here's what I've tried: steam & > /dev/null 2>/dev/null and steam & > ...
11
votes
1answer
865 views

Bash comparison and expression operators

I'm new to bash programming. I've read two good, long guides, but they made a mess in my head about operators and keywords. Which are more commonly and widely used? I don't know when to use which ...
2
votes
1answer
173 views

awk quoting program text

I just came across a gotcha in awk, and I would like to know if anyone can explain to me why this happens. The following 2 lines behave differently if I run: # grep -Rl BASE_DIR --exclude-dir=.svn * ...
0
votes
1answer
19 views

Permissions depending on parameters passed to application

I have a java app that writes to a very important table I have. This is sudo protected, but this app takes a parameters for where the output should go. The default is the REAL DEAL but the "output" ...
1
vote
2answers
241 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
4k views

Bash script that convert any output (text) to json form

I want to create bash script that it converts output of other scripts (Normally simple text) in a valid json form. How can I do this ? Example: awk '/^Mem/ {printf("%u%%", 100*$3/$2);}' <(free ...
1
vote
2answers
3k views

Why is setting alias in .profile not working?

I have this as the last line in my .profile: alias gl="cd /home/jrenner/glances/glances" yet even after reboot I get command not found when typing gl. What is happening? I am logged in as the ...
2
votes
1answer
3k views

Problem sourcing variables inside Upstart

I'm trying to use the variables defined in /etc/environment in an upstart script running on 12.04. I'm able to export the variable to the child process but for some reason I not able to use them in ...
2
votes
2answers
5k views

killall doesn't kill all and rarely kills, what is the command for then?

I occasionally use the killall command to kill processes. The reason why I say ocassionally is that in some cases it hasn't worked for me. A recent example was with thunderbird where there were about ...
3
votes
2answers
2k views

How to pause a running aria download

When downloading big files it necessary to pause the download many times. A big file can be downloaded by using wget. First start download, then kill wget, then resume download by wget -c. I want to ...
0
votes
1answer
266 views

how to use expect with bash

I Have created a shell script as given below.This script will login to a remote server as a normal user then switch to root user for creating a directory.The script is as given below. ssh -t ...
6
votes
1answer
2k views

VLC “:rate=2.0” - Where do I put this in command-line?

I figured out a way to transcode my videos so that they would play at double speed using the GUI as "Convert/Stream" --> "Show More options" and adding ":rate=2.0" after ":file-caching=300" in the ...
1
vote
1answer
124 views

How to use ' and " (quotes) as an argument

Intro In a script I want to run a command in a separate window so that output of the command will show in a new window (which is an output stream like top) and they do not interfere each other. For ...
2
votes
1answer
1k views

Permission Issues with command in rc.local

I am using a command to start a screen session and run a bash script for a user. /bin/su username -c "/usr/bin/screen -dmS test bash -c '/home/username/test.sh; exec bash'" When I boot, I am seeing ...
34
votes
2answers
9k views

Bash: delete from cursor till end of line with a keyboard shortcut

Consider the following bash prompt, where ^ denotes the prompt location: # git commit -am "[bug 123456] Do this and that with the bug" ^ Suppose that I want to commit ...
2
votes
0answers
165 views

Running bin file in bash script [closed]

I want to build a bash script that runs a bin file. However the question is: how to continue the script even after bin operation is completed to perform other commands?
3
votes
2answers
895 views

How do I run a py file with pico in the terminal?

I got this when I tried to open a .py file on the terminal line I edited in pico: lightning@rigel5:~$ ./hello.py bash: ./hello.py: Permission denied How can I easily open a .py file from the pico ...
3
votes
2answers
4k views

Copying from mount share drive to local folder through script

This is my first time trying to work with Linux Scripts so this may be something obvious. Here is what I am trying to do: Remove all contents from local folder - rm /home/user/Documents/Exercise/ ...
2
votes
2answers
74 views

How to port the bash settings?

I want my own bash environment vim tmux and so on, that I can customize for my develompment needs. Then upload it to github and install whenever I set up my computer new. Any HowTo's how to proceed?
3
votes
2answers
631 views

Using read without losing the TAB

Im using read in a while loop to automatically change a makefile after download. Here is part of the script, while read a; do if [[ "$a" = "FCOMPL=g77" ]] then echo "FCOMPL=gfortran" ...
4
votes
1answer
9k views

Why does “if [ 0 ]” execute the “then” statement in bash script?

This guide says: An if/then construct tests whether the exit status of a list of commands is 0 If I execute 0 in the bash, it says: 0: command not found So its exit status is not 0, and [ 0 ] ...