Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 don't people not use -y on the end of a command, like 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 by Terminal?

share|improve this question

closed as too broad by Seth Jun 2 at 14:40

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
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. askubuntu.com/questions/262068/how-to-extract-a-tar-gz-file and askubuntu.com/questions/86849/… –  Wilf Jun 2 at 8:19
1  
your fourth question seems to be unclear. –  Avinash Raj Jun 2 at 8: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 2 at 14:31
    
No? It is one question? –  Korkel Jun 2 at 15:19

3 Answers 3

up vote 7 down vote accepted

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.

share|improve this answer
    
Thank you for the answer! This helps me a lot! –  Korkel Jun 2 at 8:44

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

share|improve this answer
    
Thank you for the answer! This helps me a lot! –  Korkel Jun 2 at 8:45

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

sudo

The sudo service provides administrative access to specific users. You have to be a user on the system with a valid username and password that has been authorized by the sudo service for administrative access. This allows other users to perform specific super user operations without having full administrative level control. You can find more about sudo at http://www.sudo.ws.

gksu

You can use the gksu command in place of sudo to run graphical applications with administrative access. The gksu tool is a front end to sudo (another name for gksu is gksudo). The gksu tool will prompt you to enter your password, assuming you are logged in as a user that has sudo authorized administrative access.

You can enter the gksu command in a terminal window with the application as an argument, or set up an application launcher with gksu as the command. The following example will start up the Gedit editor with administrative access, allowing you to edit system configuration files directly.

Read more

share|improve this answer
    
What is beter to use, sudo or gksu? –  Korkel Jun 2 at 8:46
1  
sudo: uses root's configuration, with root privileges. (it's safe) __ gksu: uses user's configuration, with root privileges, and screws up user's configuration permissions. (it's not safe) __ gksudo: uses root's configuration, with root privileges, and some bugs appear, as an empty document on gedit. (it's safe) –  KasiyA Jun 2 at 9:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.