January 30, 2010 in Linux Client | Comments (1)
Tags: Different Colors, Directory Name, Directory Names, Divider, Family Tree, File Folder, File Names, Hierarchy, Home Directory, Linux Beginners, Linux Directory, Linux Windows, Loose Leaf Notebook, Lower Case, Microsoft Windows, Naming Conventions, Root Directory, Subdirectories, Upper Case Characters, Windows Directories
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
January 23, 2010 in Linux Client | Comments (0)
Tags: Command Displays, Computer Security, Costly Error, Course Windows, damn small linux, Directory Permissions, E Mail, File Names, File Permissions, Fine Tune, Life Introduction, Mail Attachment, Number 8, Savvy User, Security Breach, Single File, Sophisticated Versions, Systems Administrator, Top Ten Reasons, Windows Systems
vides several dozens commands enabling you to control your computer to a degree that far exceeds the possibilities of Windows systems. For example, take the ls command that lists files and directories. To the uninitiated this is Linux’s version of the Windows DIR command that also lists files and directories. Both the ls and the DIR commands provide lots of switches; options that enable a savvy user to fine tune some operations. But the Linux ls command (don’t type in LS) includes multiple, powerful options that simply often do not exist in the Windows world.
For example, the ls command displays file and directory permissions. With a simple command the system administrator can block regular users from modifying or executing a file. What does this mean to you? This reduces the likelihood of a user launching a virus by opening an e-mail attachment. If the execute permission hasn’t been specifically turned on, the file won’t be executed and the attachment won’t be executed.
Another Linux function is inode. Briefly it works like this: A single file can be accessed with several names in different folders. Why would anybody want to do that? This functionality lets the system identify a given file with different natural file names for different users. Can you do this in Windows? Sort of, on the more sophisticated versions but only if you are a systems administrator or if you have been granted special permissions. Can you do this on Damn Small Linux? Yes, we’re going to cover this in one or more tutorials.
Linux is a multi-user system. Upon installation Damn Small Linux creates two users with very different file permissions. This gives you a real-life introduction to computer security. It is easy to create new users and control what they can do. Of course, Windows allows you to perform many of these activities but doing so often presents a danger of a costly error or security breach that may disable some essential computer functionality.
Linux provides multiple commands. Why would anybody want to run arcane commands when Linux, as Windows, offers an attractive graphical user interface? Let’s say that your job is to create five hundred new user accounts at the beginning of your school’s semester. Do you really want to repeat the whole click and caboodle five hundred or more times, once for each user without mentioning the extra times needed whenever you make a mistake? The answer is no.
You’ll want to work with a script, a custom program using Linux commands to save your sanity by automating these tasks. A good script will pick up student details from their registration files so that the data won’t have to be reentered. Whether the script is good or not depends on the skill set of the individual that composed it. But Linux offers all the tools necessary for writing good and even great scripts.
When you know how to create and manage users you may want to look into Linux Certification. That’s the subject of our next article.
By: Levi Reiss