Pages

Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts

Monday, April 11, 2011

Command line basics.

Now that I've talked a bit about not shying away from the command line, I'd like to actually give a basic command line tutorial.

If you have Linux installed, but have never used the command line, or you are trying it out from a live CD, the first thing to do is open a terminal. How you do this depends on which Desktop you are using.

On Gnome, go to the applications menu in the upper left corner scrren and open it up. Go to Accessories, and when that menu opens, move down and click on Terminal.

KDE is similar, but the menu is in the bottom left corner. Open up the menu and go to the System category. Then select Terminal from that menu.

You will get an open window with a text string and blinking cursor in the upper left corner. This is your command line.

To see which directory you are currently in, type pwd and press enter.
The terminal will display the current directory path, which is generally /home/"username", but this may differ if running from a live cd, but in either case, it will tell you which directory you are currently in.

Typing ls and pressing enter will show you the files and sub-directories in the current directory.

To change directories, use the cd command along with the directory you want to change to.
As an example, to change to the root directory, type cd /.

If you enter an ls command here, you will see the basic directory structure of the whole filesystem.

To get back to your home directory. type cd ~.

By now you probably have alot of text in your terminal, so to get rid of it type clear and press enter. All the text will disappear and the prompt will be placed back in the upper left corner.

To exit the terminal, either close the window or enter the word exit and hit enter. In either case, the terminal window will close.

Those are very simple and harmless commands that will get you used to using the command line and getting around a Linux system a little.

There is alot more to the command line, but that should give you a feel for it. Later lessons will likely involve more interaction with the command line.

Saturday, April 9, 2011

Fear not the command line!

With most modern Desktop based distributions of Linux, there is little need to use the command line for most day to day tasks.

However,there are reasons why the command line continues to be popular in Linux, and therefore I feel it is worth learning to use it, at least at a basic level.

The command line is one thing all distributions have in common, and it tends to work the same, regardless of what Desktop environment is running on top of it. Therefore, it is considered a universal solution when most users give advice about getting something done in a way that should work for all distributions. GUI configuration tools can vary from one distro to another, but the command line stays the same.

Also, a person who knows Linux commands and knows exactly what they need to do can often get it done faster by using the command line rather than sorting through GUI menus and dialog boxes.

Lastly, if your interest is in using Linux as a server of some type, many distributions that are installed with the server option install with only a command line interface, or with a minimal GUI, and therefore, learning the command line is essential to being able to properly administer such a system.

Learning the command line well does take some patience, but it is another one of those aspects of Linux where I really do feel it pays off in the end. However, if you really have no interest in a text based approach, the Desktop GUI tools are generally sufficient for most desktop users.