0

I have some questions about some Terminal commands:

  1. Why must you do sudo apt-get update before installing an program or after downloading something? Does it update Ubuntu then?

  2. What is the different between sudo gedit /location/to/afile.txt and gksu gedit /location/to/afile.txt?

  3. Why people don't use -y on the end of a command, like for example in sudo apt-get install programx -y.

  4. What does the -i and -l (are there any more) mean in a Terminal?

  5. How can I unpack any .zip or .tar.gz file in a Terminal?

oerdnj
  • 7,900
  • 39
  • 49
Korkel
  • 1,158
  • 1
  • 10
  • 26
  • 2
    1. [What does “sudo apt-get update” do?](http://askubuntu.com/questions/222348/what-does-sudo-apt-get-update-do) -- 2.[What is the difference between “gksudo nautilus” and “sudo nautilus”](http://askubuntu.com/questions/11760/what-is-the-difference-between-gksudo-nautilus-and-sudo-nautilus) – TuKsn Jun 02 '14 at 08:11
  • 1
    **3.** It is a good idea to check whether `apt` is doing what it should or something utterly stupid (its very good at that) **4.** depends on the program - run `COMMAND --help`, `COMMAND -h` or `man COMMAND` to find what those options do for that command **5.** http://askubuntu.com/questions/262068/how-to-extract-a-tar-gz-file and http://askubuntu.com/questions/86849/how-to-unzip-a-zip-file-from-the-terminal – Wilf Jun 02 '14 at 08:19
  • 1
    your fourth question seems to be unclear. – Avinash Raj Jun 02 '14 at 08:20
  • Shouldn't this question be split into 5 different questions? It's rather unlikely that others will have this exact set of questions, but separately they're all quite common. – waldyrious Jun 02 '14 at 14:31
  • No? It is one question? – Korkel Jun 02 '14 at 15:19
  • These are separate questions and each can be answered: some have already been answered. – Warren Hill Jun 02 '14 at 17:28

2 Answers2

7

sudo apt-get update updates the repository information of apt, so you can install the latest version of packages.

sudo gedit will ask you for a password in the terminal window, while gksu gedit prompts for a password with a GUI.

Most people like to review any changes they make with root permissions, that's why they refrain from using sudo apt-get -y and similar.

As for -i and -l, these look like parameters you would give to a command. Each command behaves differently and uses different switches, so without knowing the specific command, it's not possible to tell what these mean. Read the manual (man apt-get, for example) or try using --help with any command.

Use unzip file.zip to extract a zip file and tar xzf file.tar.gz to extract a tar.gz file.

kraxor
  • 5,459
  • 3
  • 26
  • 35
3

Why must you do sudo apt-get update before installing an program or after downloading something? Does it update Ubuntu then?

No , it won't update Ubuntu. It just update the repositories and PPA's.

What is the different between sudo gedit /location/to/afile.txt and gksu gedit /location/to/afile.txt?

Don't open gui application as root through sudo instead of sudo, you have to use gksu. gksu package is not installed by default, so run this command sudo apt-get install gksu to install gksu package.

Why don't people not use -y on the end of a command, like sudo apt-get programx -y?

Because people want apt-get to always propmt(ask for permission) before installing packages.

How can I unpack any .zip or .tar.gz file by Terminal?

  • unzip filename.zip

  • tar -xzvf file.tar.gz

Avinash Raj
  • 77,204
  • 56
  • 214
  • 254