Linux newbies and given commands --ADVICE
Posted 08-31-2021 at 07:21 AM by zeebra
So, you're new to GNU/Linux and you have been asked by someone to try to solve something by typing a command. First of all, WELCOME, second, should you just do it?
No! Although most people on Linuxquestions are nice and just trying to help, for your own sake you should not just do it. Command lines with options and arguments are way more powerful than GUI tools, and it's very easy to not understand what you are doing. There are two main reasons you should always CHECK the command you are given.
1. To learn about commands and options and arguments
2. To make sure the command you have been given is what you are trying to do, and that it is or seems correct for your situation
Additionally, people give you commands with variable information. This does not mean something bad, it just means that you are the one that has to figure out the variable for your system. And how will you do that unless you understand (at least somewhat) what you are doing? If you don't figure out the variable, the solution/command will most likely be completely useless. And it's your task to find out the variable, not the one that gave the solution, although you could be pointed in the right direction.
Consider this example:
You ask something.
Then I tell you to type this command as root or with sudo:
If you are new, you probably don't know what it means. For all you know it could mean "format disk" and -l could mean "yes to all". This is why you should always check commands, options and arguments you don't understand. But don't worry, it is very easy to do so!
Most programs have a basic help option "--help", and using this should always be harmless and do nothing but print the basic help if you only type "command --help". In this case you would type
and it would show you basic info about the program and what the options do. This is a quick way to check both the program AND options, and should in most cases be sufficient for you to analyze what the command you have been given will do.
If you need or want additional info, you can use a few different ways to accomplish this. You could use "info command" or "man command", where info is GNU info and man is manual. These do tend to overlap, but you might find that one or the other will be more or less useful in some cases. In this case you would type
or
You can press "q" to leave those pages.
Most of all, doing this if you don't know what a command does, will teach you about commands, and over time build your knowledge of the command line. --help is very useful and very short, but if a command interest you more, you can learn far more in the man/info pages, in particular the description of the command and options are far longer, and many arguments are described too. If you do this each time you don't know exactly what a command does, you will learn alot about options as well.
So, just do it! Take the wee bit of time it takes to at least read the relevant --help information. This will not only teach you things, but make sure what you are doing is what you actually want to be doing, and a basic security precaution you can easily accomplish.
No! Although most people on Linuxquestions are nice and just trying to help, for your own sake you should not just do it. Command lines with options and arguments are way more powerful than GUI tools, and it's very easy to not understand what you are doing. There are two main reasons you should always CHECK the command you are given.
1. To learn about commands and options and arguments
2. To make sure the command you have been given is what you are trying to do, and that it is or seems correct for your situation
Additionally, people give you commands with variable information. This does not mean something bad, it just means that you are the one that has to figure out the variable for your system. And how will you do that unless you understand (at least somewhat) what you are doing? If you don't figure out the variable, the solution/command will most likely be completely useless. And it's your task to find out the variable, not the one that gave the solution, although you could be pointed in the right direction.
Consider this example:
You ask something.
Then I tell you to type this command as root or with sudo:
Code:
fdisk -l
Most programs have a basic help option "--help", and using this should always be harmless and do nothing but print the basic help if you only type "command --help". In this case you would type
Code:
fdisk --help
If you need or want additional info, you can use a few different ways to accomplish this. You could use "info command" or "man command", where info is GNU info and man is manual. These do tend to overlap, but you might find that one or the other will be more or less useful in some cases. In this case you would type
Code:
info fdisk
Code:
man fdisk
Most of all, doing this if you don't know what a command does, will teach you about commands, and over time build your knowledge of the command line. --help is very useful and very short, but if a command interest you more, you can learn far more in the man/info pages, in particular the description of the command and options are far longer, and many arguments are described too. If you do this each time you don't know exactly what a command does, you will learn alot about options as well.
So, just do it! Take the wee bit of time it takes to at least read the relevant --help information. This will not only teach you things, but make sure what you are doing is what you actually want to be doing, and a basic security precaution you can easily accomplish.
Total Comments 1
Comments
-
Superbly EXCELLENT point!
Just now, I blindly tried this
I panicked (&then remembered seeing this blog), whenCode:$ sudo apt update E: Conflicting values set for option Signed-By regarding source https://brave-browser-apt-release.s3.brave.com/ stable: /usr/share/keyrings/brave-browser-archive-keyring.gpg != E: The list of sources could not be read.
Posted 09-01-2021 at 09:51 PM by GentleThotSeaMonkey