Beginner’s Guide to Command Line: Part 1

The command line interface will either be from a terminal or a SSH window like putty. Here is an example of the Gnome terminal (Applications/Accessories/Terminal from the menu). You can see that it is only text but it does have a menu system for modifying the color of the screen and text or allowing you to open multiple terminals at one time.

If you login from a putty session from a Windows machine or if you are logged into a TTY session on the Linux box you will not have the option of a terminal and so you will be using text only as there will be no menus or graphics of any kind. Text is exactly the same as you can see in the next example. The biggest difference is that it will typically be a black screen with white text.

As you change users the prompt will show the change in user as you can see from these examples:

fred@ub:~$
mary@ub:~$
tom@ub:~$
jane@ub:~$

As you change to different servers the hostname will change. The hostname is a name that is applied to a server so that users and applications may refer to the server with a name and not an IP Address. An example would be of a hostname of ub instead of the IP Address 192.168.5.43. As you connect to different servers or workstations, this name will change. These names can be anything the system administrator would like to assign.

fred@mail:~$
fred@ftp:~$
fred@ubuntuserver:~$
fred@mystuff:~$

As you change locations in the file system the location will change. The ~ symbol indicates that a user is located in their home directory. The home directory in Linux is located in a directory, Windows calls them folders, labeled /home. So if fred is in his home directory he is really located in /home/fred. Each user has a home directory named for the user. If fred changes location in the directory system to /var, his prompt will reflect that change.

fred@ub:/var$

If mary changes to the /usr/share directory it will reflect that change.

mary@ub:/usr/share$

If tom changes to the /usr/bin directory it will reflect that change.

tom@ub:/usr/bin$

And finally if jane moves to the / directory it will reflect that change.

jane@ub:/$

Changes in location in the file system will list the location in the prompt. It is important that you use this as a clue to location especially when you begin to issue commands.