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

learn more… | top users | synonyms (1)

1
vote
2answers
983 views

Launching a Ruby Script from the bash does not work, even with the shebang

I am using Ubuntu 12.04 64 bits. I've recently installed the ruby1.9.1 package and the wx-ruby gem using : sudo gem install wxruby-ruby19 in order to install the ruby1.9 compatible version. So I ...
8
votes
3answers
14k views

error while loading shared libraries libSDL-1.2.so.0

I am trying to install ioquake on my ubuntu server. When I try to run it, I get this message: # ./ioquake3 ./ioquake3.x86_64: error while loading shared libraries: libSDL-1.2.so.0: cannot open ...
2
votes
1answer
85 views

Allow any user to use shutdown with my own shell

First of all sorry if my english is not excelent but it isnt my native language. I have a project where I'm building my own shell (named MYSHELL). One of the tasks is to create my own built-in ...
3
votes
3answers
584 views

need a different backup solution

I just built a new media/backup server using Ubuntu 12.04 64bit. I installed a hard drive to be used only for music, pictures, and videos and formatted it fat32 so my 1 and only Windows PC could map ...
1
vote
1answer
370 views

How do I detect what device an external HDD is mapped to?

I want to backup data to an external drive that is always connected to the same external USB port. How do I detect what device the external drive is mapped to?
1
vote
1answer
2k views

How do I detect if an external drive is already mounted?

I have a script that backup up files to the external drive each night. The problem is that Nautilus auto mounts the external drive and when the script runs it fails to mount the external drive. The ...
2
votes
2answers
914 views

bash script ask for root password

I want have a script that I can give to friends which will add repositories and download files, install them without having to use command as they are not command line savey and have no desire to ...
2
votes
1answer
299 views

Bash error: Nesting 'if .. elif' inside 'for .. in' construct

When I run the code below: IFS=$'\n' for line in `more extensions.txt` do if grep '[219..223]' ${line:96:4} ; then ... else ... fi done I keep getting the error: ...
4
votes
2answers
385 views

Any way to list similar commands?

When you write the command name wrong, bash often does this: septi@norbert:~$ good No command 'good' found, did you mean: Command 'gold' from package 'binutils' (main) Command 'gmod' from package ...
2
votes
2answers
89 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 ...
28
votes
3answers
7k views

Find directories that DON'T contain a file

Yes, I'm sorting out my music. I've got everything arranged beautifully in the following mantra: /Artist/Album/Track - Artist - Title.ext and if one exists, the cover sits in ...
1
vote
2answers
5k views

Parsing a HTML page with Bash

I'm trying to write a Bash script that will extract informations from a HTML page (using wget). I know my informations will be between <h*> tags, but is there a nice way to get those ? To be ...
-1
votes
2answers
1k views

To write a batch processing script which runs on bash

How to convert your java program so that it runs as a batch program i.e it can be run like a command in the ubuntu or any linux machine. What is the procedure and what are the steps to follow? ...
4
votes
2answers
842 views

Ubuntu 12.04 isn't working with one of my crontab commands… any ideas?

In my crontab file (sudo crontab -e) I have the following commands: */1 * * * * wget -q -O /dev/null http://help.mysite.com/inc/mail/hesk_pop3.php 0 7 * * * bash -c "/home/backup/backupscript.sh" ...
1
vote
1answer
212 views

bash: how to make smarter auto-complete on tab press

Using the git status command, I had: modified: conf/test.conf Is it possible to configure bash in that way so when I type git diff *test.conf and press TAB for auto-complete, it would expand it ...
24
votes
1answer
272k views

How to copy files via terminal?

I have read about copying files with terminal but these examples will help me a lot. So here is what I want to do: Examples: I have a file in /home/levan/kdenlive untitelds.mpg and I want to copy ...
0
votes
1answer
85 views

Logging every time a command is run

I want to log every time I run a certain type of command in the terminal. For example, every time I run: sudo apt-get install [something] I want to add [something] to a log file in my home ...
3
votes
1answer
3k views

How to impose memory limits to a shell script?

I have a PHP script that while a folder contains XML files, it will process them onto the database. Currently, the server is running the PHP version 5.3.10 and there's a bug report about memory ...
8
votes
1answer
5k views

chsh -s /usr/bin/zsh not working

I'm trying to permanently change my shell to zsh using chsh command, but it's not working. zsh is installed (via apt) and works fine when I invoke it directly from a bash prompt terminal. But I ...
5
votes
3answers
560 views

How can I find the binary that is executed when entering a command?

I just have installed TeX-Live 2012, but I still get moose@pc07:~$ latex --version pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian) kpathsea version 5.0.0 Copyright 2009 Peter Breitenlohner ...
6
votes
2answers
8k views

How do I install and use voice commands?

How can I give my own command using mic. I would like to give command like: "Update system now" So system will automatic run apt-get update I've seen Gnome Voice Control but I get error : $ ...
3
votes
2answers
2k views

History | grep “keyword2find” does not gives unlimited history

The command history | grep "keyword2find" does not gives unlimited history that i typed in the terminal onwards i installed ubuntu. I want to see all of them without a time span.
3
votes
2answers
786 views

How to get language variables (Desktop folder name, Document folder name, etc..)

I am making a script and I am looking for a way to get the variable names for Desktop, Music, Documents, Pictures and others Folders. Depending on the language they change. For example Desktop in ...
21
votes
4answers
15k views

How save my “alias” entries forever [duplicate]

I want to save my alias commands forever like the default ones when I type "alias" so I don't retype them every time I leave my bash
7
votes
1answer
6k views

Link to directory in bash

I'm using the ln command to create a symbolic link to a directory using bash, I went to the directory I wanted to make a link and used the following command: ln -s C#/ ~/Projetos This would create ...
5
votes
4answers
27k views

How to get the hostname using terminal command-line?

I have used arp-scan in terminal to get the ipaddress as well as mac address, is there anyway i can get to know the hostname of the ipaddress that are there in the terminal? for example there are A-pc ...
6
votes
2answers
1k views

Grep through subdirectories

Add a string to a text file from terminal I've been looking at this thread. The solution (number 2, with ls grep) works perfectly for files called .txt in the current directory. How about if I wanted ...
2
votes
1answer
345 views

cp file in many subdirectories with *

I want to copy a file "test.sh" in directories which have all a subdirectory 2_bas (ex. prod1/2_bas, prod2/2_bas, etc...) I tried: cp test */2_bas/ but I get the error message: cp: omitting ...
6
votes
1answer
3k views

How to use /dev/(u)random

How can I use /dev/(u)random on Ubuntu or any *nix sistems ? I searched at google but I can't find how to :( I tried this but it says permission denied. Note : I also tried as root. /dev/(u)random ...
70
votes
8answers
159k views

How to clear bash history completely?

I want to clear all before command from history of my server. I use history -c it seems all things are cleared but when I ssh to the server,all commands are still there. How can I clear them ...
5
votes
1answer
339 views

My bash function runs only once per terminal opened

When I try to run my bash function, defined in .bashrc, for a second time in the same terminal, it doesn't work. The code is the following: function nos (){ local option while getopts cs ...
6
votes
1answer
1k views

How do I log into bash shell only?

On my home desktop I want to use Ubuntu Unity sometimes and just the bash shell (without any GUI) other times. Is it possible to set up a login option where I can choose between using the Unity GUI ...
9
votes
2answers
894 views

What does the l command do?

There is a command l available on my machine which appears to do nothing. which l also produces no output. Is this a real command, and does it actually do anything?
0
votes
1answer
8k views

Why I am getting Can't open /etc/rc.d/init.d/functions error?

I got bash script from internet for for Running the Clamav Antivirus in Demon mode. But am getting the below error. Can't open /etc/rc.d/init.d/functions I checked /etc/rc.d/init.d/ directory there ...
3
votes
2answers
129 views

Bash script error in my computer but NOT on some others

the script: waktu=$(date +"%H") kelompok="E20" dir_skrg=$(pwd) if (( $waktu >= 5 && $waktu <= 10 )) then salam="pagi" elif (( $waktu >= 10 && $waktu <= 3 )) then ...
4
votes
1answer
982 views

How to make bash stop tab autocompleting hidden directories

Most of the time, I don't need autocompletes for my hidden directories. In fact, that's the point of them being hidden! However, annoyingly, bash takes these directories into account when ...
3
votes
2answers
954 views

How to read a movie folder and output information from it

I am looking for a tool or group of tools that combined can read recursively from a folder and output the Name of the folder, name of the movie file, resolution of movie and other info. For example, ...
0
votes
1answer
245 views

Bash Script help required

I am trying to get this bash script that i found on a forum to work. Copied it to text editor. Saved it as script.sh chmod 700 and tried to run it. rootdir="/usr/share/malware" day=`date +%Y%m%d` ...
2
votes
1answer
71 views

How can I prevent programs from running reboot scripts or “reload your computer scripts from start up”?

I would like to prevent any program within my PC from running modified scripts without super user authorization, such as instruction on rebooting my pc from start up to forcing through software ...
1
vote
1answer
62 views

Tell user to reload his pc in script

I need to send a message to a user,that he needs to reload his pc, and i need to do it like some programms do (showing the red power button in the rigth top part of the screen "Reload your computer" ...
1
vote
3answers
336 views

how to check if stream is empty?

For example I want to execute : ps x | grep something | grep -v grep | somecommand I want to execute somecommand only if there is something running. How to do that ?
0
votes
1answer
59 views

What does ENDOFMENU do? [closed]

I have been given an example program, I am wondering what exactly the <<ENDOFMENU and ENDOFMENU does, won't it work the same if you leave it out and just use the while loop? #!/bin/sh echo ...
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 ...
4
votes
2answers
10k views

Bash script to remove line breaks?

I need a script that inputs a file and echos its contents with linebreaks removed - "word wrapped" so to speak. I've tried: #!/bin/bash find $HOME '$1' | while read line; do echo "${line}"; done ...
7
votes
6answers
57k views

Every command fails with “command not found” after changing .bash_profile?

I was updating my .bash_profile, and unfortunetly I made a few updates and now I am getting: env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or ...
0
votes
1answer
2k views

What is this PS1 variable doing in .bash_profile file?

Currently my terminal prompt looks like: blankman-MacBook-Pro:~ $ My .bash_profile has: export PS1="\[\033[36m\]\h:\W \[\033[33m\]\$(parse_git_branch)\[\033[00m\]\$(git config ...
1
vote
1answer
358 views

apt-get install - how to get report about failed installs?

I've created my script to install software on a new computer. Basically it includes lot's of apt get install <pkg name> -y lines. How can I get a short report about installs that has failed? ...
5
votes
3answers
8k views

Move running program to background in bash

If I'm running a program in bash, I can suspend it by pressing Ctrl+Z. If I want to leave the program running, I can then use the bg command. Is there some way to directly put the program in the ...
5
votes
2answers
2k views

How to diff two folders to multiple patch files

I'm not much of a unix guy so I'll just go ahead and ask: I have a following problem - two folders with plenty of subfolders. I need to diff them. I tried this: diff -drupN vanila_kernel_3.0.8 ...
0
votes
2answers
2k views

Autojump in 12.04 doesn't work

https://launchpad.net/ubuntu/+source/autojump I installed with apt-get, checked out the man page and added . /usr/share/autojump/autojump.sh to my .bashrc, like it says. When I cd around the ...