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

learn more… | top users | synonyms (1)

0
votes
1answer
583 views

What is the best way to add some configuration to bashrc?

I'm currently trying to configure a server using Precise Pangolin and Vagrant (a software allowing me to provision a number of software when booting my VM). My current question is a pure bash one. ...
5
votes
2answers
3k views

“No such file” when running a 32-bit program on a 64-bit system

I downloaded a Chromium snapshot and unzipped it, like this: michael@ubuntu:/opt/chrome-linux$ ls chrome libffmpegsumo.so nacl_irt_x86_32.nexe chrome.1 ...
1
vote
1answer
10k views

How do I enable a user to sudo without password?

I have a php script with this: <?php #echo exec('whoami'); $output = shell_exec('bash /usr/local/svn/bash_repo/make-live'); echo "$output"; ?> The make-live script contains this: ...
49
votes
3answers
4k views

Is #!/bin/sh read by the interpreter?

In bash or sh, I guess anything which starts with # is a comment. But in bash scripts we write: #!/bin/bash And in Python scripts, there is: #!/bin/python Does this mean that # by itself is a ...
1
vote
1answer
3k views

How to force quit out of an infinite loop in a bash script gracefully

I wrote a bash script that logs keycodes in a simple file. I have put the code in a while loop because I want it to log continuosly. But if I run the bash script in the terminal, the cursor just keeps ...
0
votes
1answer
240 views

How can I execute scripts as root without pointing to its location?

I tend to use sudo arp-scan --localnet --interface wlan0 a lot, but I find it cumbersome to type this each time. To speed things up, I've created a script, called arp-lw-scan, which should do this for ...
-2
votes
1answer
204 views

bat file to batch? [closed]

hello i would like to know if its possible to turn this batch file into a working basfile for ubuntu, im completely new to all this. It works on a windows machine but it does not work on ubuntu. I ...
1
vote
1answer
2k views

How do I remove files as a result of the find command?

I want to rm all the files that I get when I run find search-3S-beta |grep "\.log\." What would be the command?
3
votes
3answers
1k views

Is it possible to get a list of all open files (and the programs being used to view them)?

I want to write a script that obtains a list of all open programs and files, and then generates a shell script to re-open these files. For example, if I were editing the file example.txt using gedit, ...
5
votes
2answers
8k views

How to write Bash script What is the command to open a terminal with two different tabed terminals and execute some commands separately tabs?

How to write Bash script to open a terminal with two tabs, and execute commands in both tabs? for instance: tab 1 opens skype tab 2 opens chromium-browser In the end, I want one more thing: write a ...
19
votes
5answers
3k views

Repercussions to sharing .bashrc across machines with Dropbox?

I work on a lot of different machines, all running Ubuntu (not always the same version). I have some really basic customizations to my prompt I would like to have available on all machines. I ...
4
votes
1answer
302 views

Why Byobu custom status notification code fail to show in color?

The code below runs well in Bash and shows text with proper green background color but when I add it to the ~/.byobu/bin/ folder it shows the escape characters instead. Something like ...
4
votes
1answer
682 views

How to compare zip files' contents?

Is there any tool to compare zips by content? maybe some krusader addon or command-line magic?
6
votes
4answers
9k views

How to add an extension to all files via terminal

I would like to add the .zip extension to all files. I tried this, however it does not work: ls | awk '{print $1 " " $1".zip"}' | xargs mv -f
5
votes
1answer
148 views

Preventing Users/Groups from accessing certain Domains

I have created a Study account which I use when doing anything school related work. It's purpose is to remove the distractions of my normal account, such as social media and news websites. I know ...
3
votes
1answer
122 views

Launching a program with several files through terminal expansion problem

I'm making a program that launches vlc with a set of files saved in a variable. But it doesn't work it seems to have a problem with the names, what is weird (for me) is that in the end the problem is ...
3
votes
1answer
130 views

How to use “read” to enter a directory “cd” to change a file “chmod +x”?

The following Bash script exits after the first read -p line. #!/bin/bash clear echo Put me next to your targeted .sh file! read -p "Press [Enter] key when placed next to target..." echo Type your ...
2
votes
2answers
166 views

How to use single-thread script to do batch processing?

I have a single-thread python script that gets used like this: python -c "arg" I also have a *.txt file with many arg, each in one single line in the respective *.txt. A text file, say 1.txt ...
2
votes
1answer
145 views

Why does my shell open many instances of itself?

I've been messing with the chsh command so that I could change the name displayed in my shell before each command is issued, for example picard@ubuntu:$. My problem arose when I gave the command chsh ...
3
votes
1answer
690 views

Ubuntu for phones - is there a terminal similar to the one known from PC's?

I am thinking about install Ubuntu on a phone. I spend a lot of time in terminal while working on my PC. There are much things I do using bash scripts, for example. Then, is there a terminal on ...
1
vote
1answer
357 views

Can I write keyboard shortcut in bash script?

Can I write keyboard shortcut in bash script like: #!bin/bash echo Hello ^z # this is kbd shortcut This didn't work. Is there any other way?
4
votes
1answer
2k views

Is it possible to do an unattended/silent lamp installation?

Is there a way to set up and pre-configure a lamp environment within a bash script without user prompting by dpkg and present data like mysql or root user password and such kinds of things?
5
votes
1answer
971 views

Launch a program keeping focus on terminal

I'm making a script that combines taking input from the command line with the launch of other programs. So the script will go like this: ... launch program Read input from the terminal ... The ...
1
vote
1answer
354 views

Unable to login to bash after editing .bash_profile

I've fiddled around with my .profile and .bash_profile to speed up some stuff: PATH=$PATH:/home/yoshi/android-sdk-linux/platform-tools First I appended the line to my .profile and perfect. Then I've ...
0
votes
1answer
579 views

shell script to install and run [closed]

I am trying to make an automatic installer which downloads file from ftp and installs it on system . Host = "zzz " USER= "ss" PASSWD = " xxXX" FILE = " *.tar" ftp $HOST << EOF user $USER ...
1
vote
1answer
345 views

How to delete unity default launchers

As a part of the system init script, I want to delete default launchers after blank ubuntu desktop installation using bash script. If I delete launchers from the /usr/share/applications it works, but ...
1
vote
2answers
43 views

How to have variable definition in place of command?

I am using chroot in a script, the purpose is to run a command, here is chroot syntax: chroot [OPTION] NEWROOT [COMMAND [ARG]...] The problem is the command I am running needs to take a variable ...
0
votes
3answers
113 views

Bash scripting issue for a bifurcation diagram data generation

I'm brand new to this forum (doesn't mean I didn't used it before) but today I've a very important question with wich I found no help on the web. I've a Bash script that doesn't work and I don't know ...
6
votes
2answers
3k views

Can I use standard tools to get the full name of a process, when its name has embedded spaces?

I understand that it may be a rare situation for an executable to have spaces in it, but it could happen. An example may be the best explanation.. Using standard tools, I want to determine the ...
14
votes
2answers
5k views

Command for deleting temporary files ending with ~

Many days ago, I found this useful bash alias (contents of my ~/.bash_aliases) # aliases # finds temporary files ending with '~' and deletes them alias rm~='find . -name '*~' -print0 | xargs -0 ...
3
votes
1answer
977 views

How do I batch delete a specific file inside multiple rar archives?

I have about 1000 rar files, that randomly contains an EXE file named:"JPG-Crack.exe". I need to delete it from all archives without harming the other archive content. thanks
0
votes
1answer
2k views

How to fix this problem, where sometimes /dev/video0 becomes automatically /dev/video1 as a result other apps cant read

I have one camera USB which on connect makes a place as /dev/video0, now using other applications while its reading /dev/video0 works fine, after some time like couple of hours later, automatically ...
0
votes
1answer
284 views

Find and exec using pulled variable

So far I have a simple batch script that moves *.mkv files from their source folders to a folder called "Movies". Now I would like FileBot to rename them using the 'find' command, since it (filebot) ...
5
votes
3answers
249 views

How to change the color of particular file?

I want to change the color of particular file type: for .c files red for .out files green for .sh files orange Like this, how to make these colors as default color for the corresponding file ...
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
588 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
290 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
123 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
400 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
900 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
350 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
574 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 ...