How do you install Google Chrome on Ubuntu?
What is the difference between the commands adduser
and useradd
on Ubuntu?
In tutorials and how-to's I often see commands combined. For instance,
sudo apt-get update && sudo apt-get install pyrenamer
There seem to be four possible connectors: &
, &&
, ||
and ;
. Though the &
connector is clear to me (it sends a process to the background and leaves the terminal available), it is not clear what the difference is between &&
and ;
. And I did not know of ||
until Kaya's comment.
The following questions deal with the difference between the two connectors, but do so mostly in the comments:
So here are a number of related questions:
- What is the difference between
;
and&&
? - When should you use them respectively? It would be nice to see some use cases: if I want to run a command and then after it shutdown my computer, which connector should I choose?
- What are their advantages and dangers? Robie Basak mentions in a comment to this answer that a command like
cd /somewhere_else; rm -Rf *
can have destructive consequences if the first element in the command chain fails, for instance. - If relevant, where do they come from?
I'm running Ubuntu 11.04. I use the terminal to start a bash session, and I want to add an environment variable:
$r@hajt:~$ env THEVAR=/example
But it's not working. It shows all the variables with THEVAR being the last one, but another call to env
does not show THEVAR
anymore- env | grep THEVAR
returns nothing.
Similarly, scripts with export (export THEVAR=/example
) or other variable assignments (THEVAR=/example
) don't add the environment variable.
I know I'm doing something wrong, I know it should be something simple, but I just can't find what.
UPDATE: The real meaning of my question was this one:
(Anyway I'll choose the most voted answer and leave the edited title -that wasn't what I was asking)
env
runs a program in a modified environment, then dismisses all the changes.
I want to install Oracle's JRE and to update to the latest version with the Software Updater when they released. Is there a Ubuntu package that is provided by Canonical or Oracle?
Before release Java 7, I followed this way to install Java 6.
But it doesn't work for Java 7. There is no package sun-java7-xxx
. How can you install Java 7?