A FEW SHORT DECADES AGO, WORKING WITH A PC meant typing in a command line. You displayed 6 your directories by typing some variation on the DIR command, and you created, formatted, and deleted disk partitions by typing other specific
commands. There were no mice, no (or few) menus, and no time waiting for the graphical interface to load. You can still do command-line work on pes, of course, but typing commands remains a significant part of working with Linux. Searching for Linux help more often than not yields a series of commands to type rather than icons or menus to click.

To work with the command line in Ubuntu, you need a terŽminal window-choose Applications I Accessories I TermiŽnal. The Ubuntu terminal runs what's called a "shell" in Linux; Ubuntu uses the bash shell (Bourne Again Shell), although you can call up dash, sh, or any other Linux shell as well from the /bin directory (where we'll go in a minute).

In all shells, the simpler commands are identical. One of the most commonly cited commands for Ubuntu users is sudo. Typing sudo plus an executable program name tells Ubuntu that you want to run the program, but as an administrator (you'll be prompted for the administrator password) rather than under your user profile.

The Linux command line is a huge subject area, and I'll return to it periodically as we continue working with Ubuntu. It remains the core ofLinux, even though actual use of the OS depends increasingly on GUI programs and utilities.

Name:  Linux Cotntnand Line.jpg
Views: 49
Size:  18.7 KB

GETTING STARTED
When Terminal opens, you'll see a prompt: username@ computername. followed by -$, which lets you know that it is in fact a prompt. As a starting point, type pwd and press Enter (everything requires the Enter key, so I'll stop mentioning it), Terminal returns the name of the directory you're currently in (the working directory). To change directories, type cd directory-name, or cd .. to move up one level. or cd / to move to the top directory Linux file and directory names are case sensitive.

Once inside a directory, type d i r or 1 s (short for "list") to see the files and subdirectories inside that directory The 1 s command has the benefit of providing colors to help you distinguish files (default is pUrple) from directories (blue). Black means a text file. light blue signifies a symbolic link (a shortcut), green is an executable file. For a complete look at the contents. use 1 s -1 to get full file/ directory details (note that Linux uses the forward slash (/) as a separator, not the backslash. To have Linux tell you what kind of file an item in the list is, type fi1 e followed by the name of the item.

LOOKING AROUND

The 1 s -1 command reveals the details of what's inside the directory. Column titles would be spiffy, but in their absence, from left to right, they mean the following:
file permissions, owner, group, size in bytes, time last modified, and file or directory name. In a future Linux solution we'll look at file permissions and ownership.

FINDING INFORMATION

The file commands at the bottom of this screen provide information on file type for the designated item. Since Linux does not use standard file extensions, it's often impossible to tell what a file might be simply by looking at it.