Posts Tagged ‘Linux Beginners’

Top Ten Concepts for Linux Beginners – Number 2, Directories

January 30, 2010 in Linux Client | Comments (0)

Tags: , , , , , , , , , , , , , , , , , , ,

Linux people like to claim that directories are really just another type of file. This statement can be misleading. We saw in a previous article that you create a file using a file editor. We will see later in this article how to create a directory.

So just what is a Linux directory? A directory is a collection that may include one or more directories, one or more files, or in fact be empty. You may think of a directory as a computerized file folder or loose-leaf notebook that contains dividers (themselves directories) and pages (files.) Just like a notebook page may not contain a divider, a Linux file may not contain a directory.

Up to now our comments about Linux directories hold for Windows directories as well. Now let’s take a look at some differences between these two systems. First come the naming conventions. Linux always distinguishes between lower-case and upper-case characters in directory names. Microsoft Windows does not. For example, Linux treats pay12june and Pay12june are as two different directories, as different as the directories pay12june and heighho. These directory names were used as file names in the previous article. While Linux does have some reserved directory and file names, in general one cannot tell by the name whether it is a file name or a directory name. So be careful. Linux helps you out here ‘ the ls command that lists the contents of a given directory usually displays files and directories in different colors.

Directories are hierarchical. They resemble a tree or a family tree. But unlike a tree (or Microsoft Windows) Linux has only one root. The root, designated as / lies at the top, rather than at the bottom, of the hierarchy. Right underneath the root directory you will find several subdirectories. For example, the /home directory is a child of / the root directory. The number and names of the first-level subdirectories vary from one version of Linux to another. For example, some Linux distributions include a /root directory while others do not. The /root directory (or subdirectory, both terms are used) is a child of /, the actual root directory.

The /home directory is an important directory. It is divided into subdirectories, one for each user. We like to work with Damn Small Linux, a free version of Linux that runs on the Windows desktop and requires only 50 Megabytes of disk space. Damn Small Linux automatically creates a user called dsl whose home directory is /home/dsl ; a working area essentially reserved for this user. All Linux versions subdivide the /home directory into user subdirectories according to this simple naming convention.

Linux provides several commands to process directories. For example, the mkdir command creates a directory. The rmdir command removes a directory, but in the simplest case only when it is empty. The cd command changes the working directory, the directory in which you are positioned. The pwd (print working directory) command displays (not prints) the working directory. Beginners should run this command often to reduce errors. For example, if you, the dsl user, think that you are positioned in the /home/dsl directory but in fact are positioned in the / directory you won’t be able save your files with a simple command. Why? Because you lack the requisite permission, the subject of our next article.



By: Levi Reiss


The Top Ten Concepts for Linux Beginners – Number 8, Programming Language Support

January 20, 2010 in Linux Client | Comments (0)

Tags: , , , , , , , , , , , , , , , , , , ,

Damn Small Linux can be an ideal platform for supporting a wide range of programming languages. You can even program directly from the command line via a programming shell such as Bash. Major programming languages used in this environment include C, C++, and Java. If you are developing for the Internet you may want to use PHP, a web programming language and MySQL, a language for database system development. All these programming languages are also available in the Windows environment. So the question arises, why would you want to program under Linux rather than under Windows?

Many web developers and Internet service providers feel that Linux provides a more stable web site environment than does Windows. The most widely used web server, Apache, is available under both these operating systems but its new features, security enhancements, and bug fixes always are made available first on the Open Source (LAMP) version. And then they filter down to the Windows version. At the time of this writing the Windows version of Apache has problems with its cryptographic functions.

While programming languages are essentially the same across these two operating systems, their libraries are quite different. Basically, when you write complicated programs you want to make use of as much prewritten software as possible to reduce your programming and debugging effort. One example is handling the graphical user interface. As programmers often say, why reinvent the wheel? Linux provides a wider choice of libraries and graphical user interface toolkits.

When you program in Linux it is often fairly easy to port your programs to the Windows environment. Unfortunately, the inverse is rarely true. Of course as Linux systems become more popular, you will find more and more Windows-based programming systems that enable you to convert your programs to run under Linux. To do so makes clear economic sense.

Program conversion tools may be fairly difficult to develop. For example, executing programs must access the actual computer hardware. As you may imagine Linux and Windows programs access hardware quite differently. The modules that manage hardware access are called drivers. Linux drivers tend to be of higher quality than Windows drivers.

These two operating systems differ substantially in the way they manage programs during their execution. In other articles we discussed Linux’s increased security compared to Windows. We conclude this article by repeating a point that we have often made; you can run Damn Small Linux and its associated applications on very reduced hardware. You can do Linux, PHP, and MySQL development on old computers, ones that may have seemed ready for the garbage heap. In contrast many Windows competitors such as SQL Server Developer Edition require substantially more powerful computers, the kind of computers that people purchase for one or a few thousand dollars. When your programs will be used by dozens of people simultaneously, you will need powerful hardware. Don’t forget the operating system; can you guess which one we recommend? Our next subject is the graphical user interface.



By: Levi Reiss


Top Ten Concepts for Linux Beginners – Number 1, Files

December 7, 2009 in Linux Client | Comments (0)

Tags: , , , , , , , , , , , , , , , , , , ,

Of course if you are used to Microsoft Windows you are familiar with the concept of files. This familiarity means you won’t have to start from zero to learn about Linux files. However, you will have to relearn several concepts and techniques to work with files in the Linux environment, whether using Damn Small Linux or other versions. You can do several great things with Linux files that you can’t do easily or at all under Windows. This could be just one more reason to switch from Windows to Linux.

Files have unique names. This rule is not as simple as it may seem. There is no conflict between a hard disk file named pay12june and a file named pay12june on your removable USB flash drive. In fact, be sure to backup all your important files. Don’t worry if your hard drive file is erased or becomes corrupted and illegible, simply access the one on your flash drive. You could also have two files named pay12june on your hard drive in different directories. Directories, collections of directories and files, will be discussed in the next article in this series.

Linux distinguishes between lower-case and upper-case characters in file names. Microsoft Windows does not. For example, Linux treats pay12june and Pay12june as two different files, as different as pay12june and heighho. Windows users will have to adapt to this major difference. Even though I am a Linux fan I don’t see any advantage in the Linux way of naming files. Maybe I have spent too much time in the Windows environment.

File names should be relatively short. The allowed maximum is 255 characters but working with long file names is no fun and in fact is asking for trouble. Linux file names may not contain the character / which has a special meaning. To avoid misunderstanding don’t include special characters such as $ and & in your file names. Doing so could cause confusion and lead to hard-to-find errors. For the same reason don’t call your files by special Linux names such as etc.

Linux sometimes applies file extensions; common examples include .c to indicate a C-language program and .htm or .html to indicate one type of web page. Savvy Linux users often avoid coding the file extension but rely on the file directory to indicate the file type. Don’t give a Linux file a misleading file extension.

Use an editor to create or modify a text file. The old fashioned vi editor has been replaced by more powerful, user-friendly editors. Most versions of Linux come with several editors. Damn Small Linux, a popular version that runs under Windows, includes several editors such as Beaver that come quite close to being intuitive.

Linux provides an enormous variety of commands for processing files. Many of these commands are mnemonic; for example the command cp is used to copy files. Many commands include a wide variety of options. Consider the ls command, somewhat similar to the DIR command in the Windows environment. This seemingly simple command is quite rich and offers dozens and dozens of options many of which have no equivalent in the Windows environment.

Linux commands can be thought of as verbs. Just like most English sentences include more than a verb (go, jump) complete Linux commands contain the command itself and one or more objects. To copy a file you not only need to specify cp but also What and Where. For example, the command cp pay12june backuparea means copy the pay12june file into the backuparea directory.

Linux syntax (grammar rules) is quite strict and does take time to learn. But mastering Linux and associated technologies can lead to employment. The next step is mastering Linux directories.



By: Levi Reiss