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

learn more… | top users | synonyms (1)

0
votes
2answers
3k views

How do I determine the Mime type of a file?

I recently switched to gnome3 and was surprised to find that there was no way by which we could set the default applications. I am writing a nautilus extension using bash. I want to find the mime ...
5
votes
2answers
592 views

Why is there a shell given to user for PostgreSQL?

cat /etc/passwd |grep postgre postgres:x:115:127:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash apt-cache show postgresql Package: postgresql Priority: optional Section: database ...
5
votes
4answers
2k views

How to rename files with count?

I have a directory like this: randomized_quad015.png randomized_quad030.png randomized_quad045.png randomized_quad060.png randomized_quad075.png randomized_quad090.png randomized_quad1005.png ...
1
vote
2answers
291 views

how to reverse the lower case characters in word using only sed

Reverse every word of a line using sed Description ----------- The job to do is reversing every word of a line. that a word is a sequence of lowercase alphabets Raw Input ...
4
votes
1answer
124 views

How can I get the authentification dialog programatically?

Instead of using gksudo in a bash script, I want to invoke the authenticate dialog ( as in screenshot) instead. Is it possible? If yes, how? Thanks.
2
votes
3answers
58 views

Open all files in project with long lines in an editor

I'd like to edit all text files under a certain directory that have one or more lines that are over a certain threshold in length. How can I do that? To keep things simple, let's assume that all the ...
2
votes
1answer
113 views

Why command line completion doesn't work anymore with “:>”?

I've got a file called (for example) myApp.log. On a 12.04 system I could enter :> my followed by the tab key and the rest of the filename would be filled in (or if more than 1 file with a ...
1
vote
1answer
2k views

Terminal not configured - not showing folder, no tab completion, etc

I access via ssh (command line) a linux machine and the user is not configured to do anything. Backspace does not work, there is no tab completion, the current folder does not appear in the terminal ...
0
votes
2answers
402 views

Error while running bash script that moves files

I am new to bash script and want to create bash script that moves some days old files between source and destination as per days defined in script. When I run this script I get error find: paths ...
16
votes
0answers
4k views

How do I set a path permanently? [duplicate]

Possible Duplicate: How to add a directory to my path? I am trying to install the play framework permanently. http://www.playframework.org/documentation/2.0.2/Installing export ...
5
votes
2answers
227 views

How to set default applications non-interactively (e.g. vlc as default for video)?

It's straightforward to set vlc as default using the GUI, but straightforward doesn't mean easy(I have to do the same thing over and over many times each time I install a new system). I just need a ...
0
votes
1answer
903 views

Bash script using eyeD3 to remove extra tags from mp3 files

I found what looks like the perfect script for this but getting errors. Hoping someone can see problem. I am running 12.04 Server. Error is awk: line 0: regular expression compile failed (missing ...
0
votes
1answer
416 views

background process outputs to the console

Suppose test.sh is a bash script that is empty or contains only exit 0. When the script is backgrounded, what is the significance of the 1 and 16320 printed to the console? ...
4
votes
3answers
352 views

bash escaping and find command

I trying to remove boring \-escaping from this command: find . \( -name '*.mp3' -o -name '*.jpg' \) -print by wrapping it in single quotes: find . '( -name *.mp3 -o -name *.jpg )' -print ...
3
votes
2answers
1k views

Bash script won't stay open in background after running through while

I can't get the following bash script to stay open after the first message is received from NC: #!/bin/bash port=3333 nc -l $port | while read msg; do notify-send Alert "$msg"; done After the first ...
1
vote
2answers
576 views

Why does my terminal attempt to execute 'sudo apt-get update' at every launch?

Every time I launch a terminal it attempts to execute sudo apt-get update This happens regardless of which terminal emulator is used - both guake and gnome-terminal do it at least. It also does ...
4
votes
1answer
255 views

Function inside .profile results in no log-in

I've created a custom function in my .profile, and I've added right at the bottom, after my custom aliases : # custom functions function eclipse-gtk { cd ~/development/eclipse-juno ...
5
votes
3answers
2k views

Searching for executable files

Is there a way to search and delete all executables files within folder if there is no extension? e.g Let's suppose I have 4 files with .ubu extension and the following bash does the job I'm asking ...
0
votes
2answers
4k views

How to get samba (computer 1) to show up on windows 7 (computer 2) if both are in the same lan?

Sorry for the newb factor but I have two computers (one linux, one windows). I followed this directions on this website. And have been able to make it past the last step without any problems: ~$ ...
2
votes
1answer
442 views

Bash does not remember programs with non 0 exit status in history

I enter a command. It fails. I press arrow up, modify something and enter it again ... hold it right there. It used to work like that. Now it's more like: I enter a command. It fails. I press arrow ...
2
votes
2answers
109 views

Editing a command-line argument to create a new variable

I have a bash script called test.sh that uses command-line argument: lynx -dump $1 > $name".txt" But I need name to be created from the argument by specific keywords in the argument. An example ...
1
vote
1answer
293 views

Application autostart after system boot for a random interval

Reading 'sleep' mans and googling haven't provide any useful information. I want to run Pidgin after Ubuntu boots, but after some time left. For example, logon is passed, and after interval for 1 to ...
2
votes
2answers
5k views

How do I include a password with SSH command? (want to make shell script)

I'm trying to SSH to a server on startup with a .sh script, but that will require me to enter the password for the account on the server that I'm SSHing to. I did some RTFMing, and I see in "-o" that ...
0
votes
1answer
573 views

Usings xargs in Terminal with a bash script

test.txt has four urls in it. urls.sh: cat test.txt | xargs -n 1 check.sh uses command-line arguments for its url variable. In Terminal, what do I write so that all the urls can be checked with ...
1
vote
1answer
142 views

Unity Icon for a bash ran program

So I downloaded the .tar.gz for eclipse, extracted and set it up. I created a .desktop file so I could dock it in unity. I then want to be able to have a bash script open the program from the ...
1
vote
1answer
561 views

collecting data, saving it into a file and rerun it again in bash script;

I'm new to bash and have written this script to collect data then save it to an automated file. It runs fine til here but as I try to rerun the script to add another details it gives me errors. ...
4
votes
1answer
666 views

How to run a script on each login or once a day if not run that day already?

I've made a custom directory where I've put a couple of my favourite wallpapers. I made a script which examines this directory, counts the number of PNGs, and then randomly sets one image as a ...
3
votes
1answer
195 views

find changes in directory script

I am trying write a script to find all changes (modify,create,delete) in a list of directories for last 24h, as the following : #!/bin/bash LOGDIR=change_log FILETYPE=*.php DIR=www ...
3
votes
1answer
10k views

Can I log in with other user's account?

I would like to ask you about login command in bash shell Ubuntu. I entered #login then it asks me about username and password. Is this a way to log in with other user's account?
1
vote
2answers
4k views

Library missing for executable file

There's an executable I downloaded onto my Ubuntu 10.04 and I can't run because it's missing a library. I have also tried compiling the source with CMake. This is my Terminal output: ...
4
votes
2answers
1k views

How can i make the PC make a 'beep' sound when network cable is unplugged?

How can i make beep sound in the PC when the network cable is unplugged or no network available to any specific interface such as eth0 or eth1? Follow up: $ sudo apt-get install beep $ cat ...
1
vote
1answer
301 views

how to remove environment variables set for QSTK?

I am new to Ubuntu, and I'm having trouble with the terminal application. Every time I open it this message appears: "bash: /home/xxxxx/.bashrc: line 1: syntax error near unexpected token `(' bash: ...
1
vote
1answer
98 views

Lower casing and truncating a variable in a shell script

I am trying to convert a variable to lower case and strip a suffix at the same time. The variable contains a file name and I am stripping the extension: for f in *.shp; do echo ${f%.*};done To ...
3
votes
2answers
5k views

Running commands on boot in 11.10

So I am getting properly confused on how to create a startup script on my Ubuntu 11.10 server. I have read about init-scripts, upstart-jobs and more, but I get even more confused the more I read. ...
4
votes
1answer
2k views

How to detect image dimensions and run commands on them?

I have a directory full of images, some of which are portrait-sized instead of landscape-sized, and I want to open the portrait-sized ones with an image editor. I can run the imagemagick command ...
2
votes
1answer
204 views

Gnome Tweak Tool editable via bash/python?

Is there a way to access the variables to edit via bash (or other libraries with bash or python)? Similar to how you can use 'gconftool-2' in bash to edit properties that would update them after ...
2
votes
2answers
90 views

Automatically open a file when another file is opened

In Ubuntu, is it possible to cause one file to open whenever another file is opened (using a shell script, perhaps)? For example, if I created a file called stuff.js, I'd want the file stuff2.js to ...
1
vote
2answers
2k views

Multiply with decimal numbers in bash [closed]

When i run p=0.1 k=2 while [ $p \< 1 ] do echo $p p=$(echo "scale=2; $p*$k" | bc) done i have this result 0.1 .2 .4 .8 What can i do to have 0.1, 0.2, 0.4 and 0.8 ?
0
votes
1answer
6k views

“Text File Busy” when running a simple script on bash

When I make a simple script, I get "Text File Busy" when I try to run it. dbell@det-ui-supergbe:~$ cat > test2 ls ^Z [2]+ Stopped cat > test2 dbell@det-ui-supergbe:~$ chmod a+x ...
3
votes
4answers
840 views

How to xkill an application by its id?

I need to simulate the behavior of the keyboard shortcut (ALT+F4) using Terminal for a given application. If I open for example gedit and click ALT + F4 , then GEDIT will be xkilled. If I want to ...
1
vote
1answer
247 views

Are $ reboot and $ shutdown -r now different?

I was receiving the following notification at the end of my message of the day *** /dev/xvda1 will be checked for errors at next reboot *** I did the following $ touch /forcefsck $ shutdown -r now ...
5
votes
4answers
692 views

How can I prevent accidental execution of the rm -r *command?

Occasionally I use command to delete some files. For example, the name might start with 'a', so I'll delete with the command rm -r a*, but I don't want to remove some other directory by accident. How ...
2
votes
2answers
320 views

Does sudo really make you root for a while?

On Ubuntu, in what kind of situations, if any, running a command as a non-root to access a file/folder or create/delete a file/folder using sudo may result in "permission denied" while running the ...
0
votes
1answer
1k views

Gedit not Launching

For some reason, gedit does not launch. Here is the output it gives: chris@Chris-Ubuntu-Laptop:~$ gedit chris@Chris-Ubuntu-Laptop:~$ Descriptive, Let us try the help. chris@Chris-Ubuntu-Laptop:~$ ...
1
vote
2answers
136 views

download file from web source, selectively

If anyone has heard of Bukkit, you know that their files are usually of three types: Development, Beta, and Realease. Click (here) for examples. I need a script that: Loops through the directory ...
4
votes
3answers
2k views

cron jobs not running

I've got a couple of scripts that I've had scheduled to run in cron for a while. About a week or so ago, they stopped running as far as the (very basic) logging showed, and also I noticed that my ...
2
votes
1answer
279 views

Run Bash script before every print job

I'm using refilled printer cartridges that don't show ink levels, so I made a bash script that keeps count of printed pages (from CUPS log) and shows a warning when it reaches about 200 pages (known ...
0
votes
1answer
395 views

How to check for missing files in filesystem or directory with bash (after crash)?

After the system unmounted the root partition, I detected that some files are missing in the filesystem. wifi and the gwibber icons disappeared from the indicator applet I am trying to check if ...
2
votes
2answers
732 views

How to reset bash keyboard shortcuts?

How can I reset the bash shell's Ctrl + C keyboard shortcut? I changed it a few months ago and can't seem to recover it.
0
votes
2answers
679 views

How to delete older files using a bash script?

How to find and delete older files (older than 7 days) in a folder using a bash script? It's a folder in a server which contain automatic backups. Need to delete old ones automatically so there's ...