Article

Fire Up your own Linux Server

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Next

File owner
This identifies the user who owns the file. By default, the owner is the user who created the file; however, a user that has sufficient privileges—root, for example—can change the file ownership details.

File group
The group of users that has access to this file: in this case, a group named kermit. When you create a user, Linux will automatically create a group with the same name as that user. This allows us to give a user access to another user's files. For example, if we added the user gonzo to the group kermit, Gonzo would have access to Kermit's files.

Owner, Group and Others
These checkboxes allow the actual setting of permissions. You can grant the owner, the group you've selected, or everyone else any combination of read, write, and/or execute permissions. That combination of three sections of three permission types results in 512 possible combinations for the permissions on this file. That's a pretty flexible structure! We'll look more closely at file permissions in a moment.

Special flags
Special extensions to the permissions system allow us to flag a file for special treatment by the filesystem. We won't need to use these flags within this book.

Text view and Number view
These alternative ways of viewing file permissions will be familiar to anyone who's dealt with file permissions via the command line.

The text view is made up of ten characters. The first indicates the file type: if the file is a directory, this character will be d; if the file is a regular file, it'll be -. The remaining nine characters indicate the read, write, and execute permissions for the owner, the group, and everyone else. For example, -rw-rw-r-- represents a regular file with read and write permissions for the owner, read and write permissions for the group, and read-only permission for everyone else. You can see this view change as you change the checkboxes above.

The number view is a more compact view of the text view. The numbers represent, from left to right, the permissions given to the owner, the group, and to everyone else. This view, too, changes as you change your selections in the checkboxes.

Last changed
This field identifies the date and time at which the file was last changed. As this file hasn't been reopened and modified, Linux doesn't consider it to be changed yet. Open the file and modify it to see this date change.

Symlinks, or Linking Files: More Abstraction

Most people who have ever worked with Windows understand the concept of shortcuts. A shortcut is really a pointer from one location to a file in another area of the system. In fact, some users understand and become so obsessed with shortcuts in Windows that their desktops are eventually covered with them! The ability to launch a file from somewhere other than its real location clearly has value for computer users. And Linux offers such capabilities, too. As an administrator, you'll find Linux's shortcuts nearly as exciting as those in Windows.

A shortcut in Windows and a symbolic link in Linux really amount to the same thing: they're abstractions—mere representations—of the original file. Creating a shortcut in Windows doesn't actually move the executable file to the desktop. Similarly, in Linux, we can write for a file an abstraction that appears to be the file itself. The file doesn't really exist in the new location, it just operates as if it does.

One important difference between the way Windows and Linux create shortcuts is that a Linux symbolic link (normally called a symlink) can be treated exactly as if it were the file for most purposes. For example, if you open a symlink in your editor, and make changes to the file, the editor will edit the actual file to which the symlink points. If you try that under Windows, you're likely to get a surprise when the editor opens up the shortcut file for editing, rather than the file that to which the shortcut links! Symlinks are used frequently under Linux because they're a powerful abstraction that can make it seem as if a file is in multiple places at once.

You can create a symbolic link in Nautilus by right-clicking on a file or folder, and selecting Make Link, as shown in Figure 2.19. This will create a symlink with "link to" at the start of the filename, as depicted in Figure 2.20. You can drag and drop this file anywhere, and rename it as you choose.

Figure 2.19. Creating a symlink in Nautilus.
1505_2.19

Figure 2.20. A newly created symlink.
1505_2.20

Editing Text Files

A reasonable command of a Linux-compatible text editor will be crucial to the success of your day-to-day administration. As most of the configuration in a Linux system is done via text files, you'd be wise to find one that works for you. In fact, Linux is replete with text editors: editors without a GUI, editors with a GUI, editors intended primarily for programmers, editors targeted at HTML developers—there's no shortage of tools to make your administrative tasks easier. In this section, we'll take a look at some of the GUI-based text editors that are available to you. We'll look at some of the command line-based editors a little later.

Fedora Core provides two robust GUI text editors in the default installation: gedit and Kate. gedit is the default text editor for the GNOME desktop environment, and Kate is the default for KDE, but both will work in either desktop environment.

If you were a longtime Notepad or Wordpad user in Windows, you'll find that many of the same features are available in Linux's GUI text editors, plus much, much more.

gedit

gedit is GNOME's default text editor. Pictured in Figure 2.21, it offers a full range of features, including:

  • Full support for internationalized text, including UTF-8
  • Tabbed multi-document interface
  • Syntax highlighting
  • Plugins and a plugin manager
  • A complete preferences interface

In addition to these standard features, the following plugins can be added to extend the gedit application:

  • Spell checker
  • Insert date and time
  • Word count
  • Change case of selected text
  • Indent or unindent blocks of text
  • Ascertain the differences between two documents or files
  • Insert output from the command line
  • Markup language tag lists for common markup languages such as HTML, LaTeX, etc.

Figure 2.21. The main gedit screen, ready to edit the Apache configuration file.
1505_2.21

Mind your Gs and Ks
You'll quickly realize that most GUI applications for Linux are written specifically for one desktop environment or another. The naming conventions for these applications remain fairly consistent, and reasonably obvious. Most applications written for the GNOME desktop environment will begin with the letter "G," while applications written specifically for the KDE desktop environment will begin with the letter "K."

Kate

The KDE counterpart to gedit is Kate, the "KDE Advanced Text Editor," pictured in Figure 2.22, "The main Kate screen, in which the Apache configuration file is being edited.". If it's not available in the Applications menu, you can start it by selecting Applications > Run Application… and entering kate.

Figure 2.22. The main Kate screen, in which the Apache configuration file is being edited.
1505_2.22

Can't Start Kate?
The Kate text editor, originally a standalone application, is now included in the kdebase package. It's not available as a separate download. In order to use Kate, you'll need to have all the KDE libraries and base applications installed. To install additional applications, select Desktop > System Settings > Add/Remove Applications.

Like gedit, Kate is a multi-view editor: it will allow you to open and edit multiple documents in the same window. As well as that single, very useful feature, Kate offers a full range of other capabilities that make it a very powerful text editor. Its features include:

  • Kate allows you to edit all kinds of text files, even if they're big. Kate can open a 50MB file in a few seconds.
  • Kate's powerful syntax highlighting engine is extensible via XML files.
  • The editor offers code folding capabilities for many programming languages, including: C++, C, PHP, etc.
  • Kate offers split window views, allowing you to view different parts of the document simultaneously.
  • Kate allows users to choose the encoding we want to use for each file via the save/open dialog.
  • Kate boasts built-in terminal emulation.
  • Kate's sidebar displays a list of open documents, a filesystem browser, and more.
  • Kate provides a handy plugin interface that allows third party plugins.
  • The editor provides project handling capabilities (which can be overridden by project handling plugins).

Ultimately, Kate is a bit more friendly, and offers greater flexibility for editing configuration files and writing shell scripts, than do some other editors. The syntax highlighting capabilities are unsurpassed, as Kate makes available a full range of programming languages and styles. Additionally, Kate provides such features as an open document listing (shown in Figure 2.23) and an integrated filesystem browser (Figure 2.24).

Figure 2.23. Kate's Documents tab.
1505_2.23

Figure 2.24. Kate's Filesystem Browser tab.
1505_2.24

While Linux does provide other GUI text editing options, gedit and Kate are two of the most powerful and user-friendly on offer. Either will suit your Linux text-editing purposes well.

Summary

It takes time to understand Linux, and the first stage in the process is to find your way around what may, at first, be a slightly unfamiliar desktop. In this chapter, we've discussed some of the basics of Linux, Fedora, and the GNOME desktop from a user's point of view. Next it's time to look at what you need to know in your role as the administrator of a Linux server.

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links