How To DO some easy commands?
For instance, you want to know more about a command line command. Pretty-much any command or program has a manual page that explains what the command does and how to make it do what.
For instance, to read the manual on the manual command, simply type:
If you want to read the manual for the command to find out how much space is left (or used up) on your computer, type:
As you will see,
df has all sorts of useful "switches" to make it show you things in different ways.
However, like most command line commands, the defaults are usually fine. Typing
df on its own is usually good enough to tell you what you need to know.
Other commands you could try are:
This "lists" the contents of the directory (folder) your command line is in. If you read the manual page for
ls then you'll see that there are many options. However, the following are what you'll use most:
|Command||What it does|
|ls -al||Lists everything in the folder - it's a bit like the DOS command "DIR"|
|ls -altr||Lists everything in time order, but reversed. This puts the most recent thing in the folder at the end of the list. |
You're usually looking for a file you just put or made somewhere. If you don't want to scroll all the way to the top of a long list, you usually want to use this command. To list things in proper order, just omit the "r".
There are loads of things that you can do using a command line, however, a lot of it is to do with administration or performing tasks faster than if you use a graphical tool. For instance, you find that you need to install a program. Let's say it's a game called called "spotty". You could:
- Open your Package Management program
- Search for the name of the program you want to install
- Install it.
Or you could (as root) type:
You see? Faster. Of course, you shouldn't do everything as root. It's dangerous. You could break your computer fast if you don't know what you're doing, or if you're not thinking clearly. You are flying your computer manually, with your hands on the controls, when you're root.
However. There are ways you can avoid leaving a command prompt open as root. The usual way Linux distributions do this is by having a command called "sudo" (Do as Superuser), or "Besu" (similar). Mageia uses "sudo". However, it may not be activated on your Mageia. If that is the case, follow the instructions in this page.
There are plenty of things you can achieve using the command line. How about trying some of the recipes in the Mageia Cookbook?