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

learn more… | top users | synonyms (1)

6
votes
2answers
5k 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
10k 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
239 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 ...
5
votes
2answers
76 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
2answers
2k 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 ...
5
votes
3answers
145 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
4answers
3k 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
8k 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
9k 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
339 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
3k 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
300 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
284 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
6k 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
7k 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
752 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
333 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
1k 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
1k 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
20k 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
4answers
335 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
192 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
4k 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
2k 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
700 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
492 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
1k 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
12k 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 ...
11
votes
1answer
1k views

How do I remove the “did you mean…” feature in the shell?

When I fail to type correctly a command, for example: luca@mostro:~$ sido No command 'sido' found, did you mean: Command 'sudo' from package 'sudo' (main) Command 'sudo' from package 'sudo-ldap' ...
9
votes
2answers
987 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?
8
votes
3answers
365 views

Why does redirection to the same file truncate the file?

Normally we use a different file to redirect the output. For example : cat < first > temp In this command the contents of first are redirected to temp instead of the standard output. Then ...
7
votes
3answers
1k views

How to open several image files from command line, consecutively, for editing?

Lets say I have three image files to edit. Consider all the files are in ~/Pictures. Let name of the first file be 1.svg, name of the second file be 2.svg and name of the third file be 3.svg .I have ...
7
votes
1answer
20k 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 ...
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 : $ ...
6
votes
6answers
26k views

How do I change my PYTHONPATH to make 3,2 my default Python instead of 2.7.2?

I have python3.2 located in /usr/lib/python3.2. I am not sure if that means it's installed but I assume it is for now. Some facts about my system: $ which python /usr/local/bin/python When I type ...
6
votes
3answers
514 views

How do you get details from the output of the locate command?

When I run the ls -l command I get details about the files in the current directory like permissions, owner, group, file size. Is there a way I can get these same details instead of just the ...
6
votes
3answers
6k views

using grep with pipe and ampersand to filter errors from find

I am using cygwin to find a file on the cygdrive. However I need to suppress the permission denied messages (otherwise the results get hidden in the error messages). The following command works: ...
6
votes
3answers
2k views

Why does my shell script hang without the .sh extension?

I created a shell script /usr/local/bin/suspend with the following content: #! /bin/sh # Take an optional delay parameter if [ "$#" -gt "0" ]; then sleep "$1" fi # Put the system to sleep ...
5
votes
1answer
198 views

How to prevent output from '&' and '>' operator (send to background operator and redirection operator)

I have tried various combinations of gedit, &, >/dev/null 2>/dev/null. When gedit is used with the other two it always prints something to the terminal. I understand that the numbers are ...
5
votes
4answers
835 views

Redirect pipe output to the same file

Is there any short way to save the pipe output to the same file that it's processed. For example, this is what I am actually doing $ cat filename | sort | uniq > result $ rm -f filename $ mv ...
5
votes
2answers
277 views

How to easily make an alias command permanent? [duplicate]

I search everywhere and almost everyone was suggesting to open the ~/.bashrc or ~/.bash_aliases, then put the alias command there, I created a function name palias as permanent alias function and put ...
5
votes
4answers
691 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 ...
5
votes
3answers
852 views

How do I list the public files in my home directory? (mode 777)

I want to get the list of all the files in my home folder, having rwx (read-write-execute) or 777 permissions for everyone. Also, what is the command to know the permissions of a file?
5
votes
5answers
5k views

How to have a path containing spaces in PATH?

I tried export TASK=$HOME/Ubuntu\ One and export TASK="$HOME/Ubuntu One" but neither works.
5
votes
3answers
877 views

Why is this bypassing the SUDO password?

I have a bash script I am using to automate a SVN checkout. The contents of the file were: #!/bin/bash cd /var/www-cake sudo svn checkout file:///usr/local/svn/bash_repo/repo/ Then when I double ...
4
votes
2answers
304 views

Print only one line at a time from text file

how can I print or display only word from a text file at a time. When I run my script it should only display each word from the text file one by one, but only display that word. This is what I have ...