For SUSE maniacs — those of us always trying to find the latest news and information about SUSE Linux and things related — there are enough Web sites out there to satisfy everyone’s info
Trang 1SUSE’s Increasing Popularity
Don’t you just love to be part of a trend? I do SUSE is on the rise and we can ride high — at least, while the ride lasts SUSE Linux is already popular in Europe and is continuing to improve SUSE Linux’s fortunes are on the rise following Novell’s acquisition of Germany’s SUSE Linux AG for $210 million
SUSE Linux is poised for more growth in the U.S marketplace, helped in part
by IBM’s $50 million investment in Novell as part of the SUSE acquisition deal
Recently, Novell announced that SUSE’s YaST installation and configuration tool will become open source, licensed under the GNU General Public License
All these recent developments have generated a distinct “buzz” around SUSE Linux as the up and coming Linux distribution for everyone from home users
to enterprise servers And the nice thing is that you and I — we — are part of the crowd that’s contributing to SUSE’s popularity
325
Chapter 21: The Ten Best Things about SUSE
Trang 3Chapter 22
Ten Great Web Sites for SUSE Maniacs
In This Chapter
www.suse.com
portal.suse.com/sdb/en/index.html
distrowatch.com/table.php?distribution=suse
www.suseforums.net
www.linuxquestions.org/questions/f60
www.linuxforums.org/forum/forum-36.html
www.linux-laptop.net/
packman.links2linux.org
www.tldp.org/
www.linuxhq.com/guides/
In this age of the Internet, we look to Web sites when we need any
informa-tion about virtually anything For SUSE maniacs — those of us always trying to find the latest news and information about SUSE Linux and things related — there are enough Web sites out there to satisfy everyone’s informa-tion needs From all the available SUSE and Linux-related Web sites, I have culled ten Web sites that I consider most useful for SUSE Linux users I pre-sent these ten Web sites in this chapter
http://www.suse.com
For anything related to SUSE Linux, you’ve got to start here — the official SUSE Linux Web site You will be redirected to the SUSE Linux page at www novell.com/linux/suse/ You can browse this Web site for latest news about SUSE Linux, Novell’s Linux products, and the support and services Novell offers
Trang 4From Novell’s SUSE Linux page, you can search the SUSE knowledgebase — click Support and select knowledgebase Search the knowledgebase for answers to your SUSE Linux questions
http://portal.suse.com/sdb/en/index.html
This is the English page at the SUSE portal If you want to use the site in other languages such as German, French, or Spanish, click the appropriate link along the top of the page
The SUSE portal gives you access to the SUSE support database (or SDB, for short) You can search the SDB by keyword or browse the database by cate-gory There is a link to the main SUSE FTP server (ftp.suse.com/pub) as well as a list of mirror sites from which you can download SUSE Linux From the SUSE portal, you can also access and search the SUSE Linux hard-ware database to see information about how well SUSE Linux supports a spe-cific hardware device such as a graphics card, networking card, printer, modem, and so on
http://distrowatch.com/table.
php?distribution=suse
This Web page provides summary information about the latest SUSE Linux release as well as lots of links to news, reviews, forums, and documentation about SUSE By following links at this Web site, you can also buy SUSE Linux
on CDs and DVDs at a reasonably low cost (this can be convenient if you don’t have high-speed Internet access and cannot easily download huge ISO files)
http://www.suseforums.net
This is an online forum for SUSE Linux You can register as a user for free and then post questions or search the forums for previously posted questions and answers You can browse the forum without registering
Trang 5questions/f60
LinuxQuestions.org has a number of forums on Linux, including one for SUSE Linux I show the URL that takes you directly to the SUSE Linux forum
You can browse and search the forums for answers to questions on topics such as installation, networking, and security To post a question on the forum, you must register as a member (you don’t have to pay to become a member)
http://www.linuxforums.org/
forum/forum-36.html
This is another SUSE online forum where you can search for answers to your SUSE Linux questions As with other forums, you have to register and log in before you can post your questions You also must log in before you can search the forums You can, however, browse the postings at the forum with-out logging in as a registered user
http://www.linux-laptop.net/
This Web site chronicles the experiences of many users who have installed various Linux distributions (including many versions of SUSE Linux) on their laptops You can browse the information by the make and model of laptops
The information is useful if you are considering installing SUSE Linux on a laptop
http://packman.links2linux.org
From this site, you can download software for SUSE Linux — in the form of RPMs — from this Web site You can browse the RPMs by category, look at a complete index, or search by keyword
329
Chapter 22: Ten Great Web Sites for SUSE Maniacs
Trang 6This is the famous Linux Documentation Project Web site Here you can find links to HOWTO documents, guides, Frequently Asked Questions (FAQs), man pages with help on Linux commands, the Linux Gazette magazine, and much more This site is not SUSE-specific; rather, it provides general Linux informa-tion Nevertheless, it’s a treasure trove of information for anyone who wants
to learn Linux
http://www.linuxhq.com/guides/
This Web page offers a collection of guides on Linux topics such as getting started, system and network administration, and programming You can browse the guides and tutorials Who knows? You may very well find a guide that addresses exactly what you want to know
Trang 7Chapter 23
Ten Most Commonly Used
SUSE Commands
In This Chapter
apropos
man
ls
cat
grep
locate
chmod
rpm
tar
pico
One of these days, you’ll become a SUSE Linux expert, and then you’ll
want to use cryptic commands for everything Yeah, right! Seriously: Sometimes you do end up having to use some Linux commands either because you are stuck at a text console (X is on the fritz) or there’s no quick way in a GUI to do what you want I’m going to show you the ten most com-monly used SUSE Linux commands (I didn’t do a survey to find the ten most-used commands — these are simply the ones I use most often.)
Linux commands are case-sensitive and all commands are in lowercase Of course, directory and filenames can be in mixed case
Before I forget if you are wondering where you use these commands, you type these commands at a shell prompt in a text console or in a terminal window, which you can open from the GUI desktop See Chapter 16 for more information about shells and the syntax of commands
Trang 8apropos: Finding Commands Based on a Keyword
Sometimes you might be at a loss to find a command that does something specific like how to print from the command line That’s when you can turn
to the lifesaver command — apropos The aproposcommand looks up the
keyword in a database of all online manual pages (called man pages) and
dis-plays all Linux commands whose description contains the keyword
The syntax of the aproposcommand is the following:
apropos keyword
This command displays all Linux commands whose manpages include key-word By the way, I don’t show the morecommand as a top ten command, but you often need to use moreto view output one page at a time In this case, if the output of aproposis too long, simply type a vertical bar followed by
more (| more) after the aproposcommand For example, type apropos print
| more and see what you get Press the spacebar to continue.
As much as aproposcan be useful, when you try aproposwith a simple key-word such as find, you may end up with a long listing of manpages because
the word find appears in many man pages Your best bet is to try apropos
with as unique a keyword as possible For example, to look up commands
that relate to MP3 files, try typing apropos MP3 Here’s what I get when I type apropos MP3 on my SUSE Linux system:
plaympeg (1) - MPEG audio (MP3) and video (MPEG-1) player normalize-mp3 (1) - adjust levels of mp3 or ogg files by running
normal-ize(1), then re-encoding What you get on your system might be different, but, as you can see, apro-posdisplays the commands related to a keyword
man: Reading Online Man Page
The mancommand is for viewing online manual pages (also called man
pages) The simplest form of the mancommand looks like this:
man commandname
Trang 9This causes manto display the manpage (think of it as the online help) for the command you specify by commandname For example, if you want to know how to use the mancommand itself, type man man.
When you first read a manpage, it can be somewhat daunting because a typi-cal manpage has lots of information However, after a while, you get the idea how they are organized and which parts you need to read to understand what the command does
You can use manin combination with apropos First, use aproposto look up the commands for a keyword Then select the command that seems most appropriate and use manto look up the description of that command
Use the mancommand to read the manpage of each of the Linux commands
I list in this chapter That way, you’ll become familiar with these oft-used commands
ls: Listing Files and Directories
The lscommand displays the contents of a specified directory If you omit the directory name, lsdisplays the contents of the current directory By default, lsdoes not list files whose names begin with a period (.); to see all files, type ls -a You can see full details of files (including size, user and group ownership, and read-write-execute permissions) with the ls -lcommand
cat: Feeding Input to Commands
The catcommand is deceptive when you find out what it does literally —
it copies the contents of a file to the standard output (which means the text console or the terminal window) So what’s so great about it? Well, to see why catis useful, you have to use cattogether with the output redirection feature
of the shell Basically, you can feed the output of catas input to other com-mands For example, suppose you have several MP3 files that you want to consolidate into a single big MP3 file You can type the following cat com-mand to perform that task:
cat *.mp3 > bigone.mp3 This command concatenates all the files with names ending in mp3and cre-ates the bigone.mp3file in the current directory Incidentally, that greater-than
333
Chapter 23: Ten Most Commonly Used SUSE Commands
Trang 10sign (>) is the output redirection character that causes the output of the cat command to go to the bigone.mp3file
You can use catto make an ISO image file of any CD Assuming that the CD-ROM drive’s device name is /dev/cdrom, just type the following cat com-mand to create the ISO image file named cdimage.iso(you can use any file-name you want):
cat /dev/cdrom > cdimage.iso How’s that for a multipurpose tool?
grep: Searching for Text in Files
If you have used Linux (or any variant of UNIX) for a while, you probably know about the grepcommand, which enables you to search files for a pat-tern of strings Here is a typical use of grepto locate all files that have any occurrences of the string ethernetor Ethernet— on any line of all files with names that end in h:
cd /usr/include grep “[eE]thernet” *.h The last command finds all occurrences of ethernetor Ethernetin the files with names ending in h
The grepcommand’s “[eE]thernet” argument is known as a regular sion, a pattern that matches a set of strings You construct a regular expres-sion with a small set of operators and rules that resemble the ones for writing arithmetic expressions A list of characters inside brackets ([ ]), for exam-ple, matches any single character in the list Thus, the regular expression
“[eE]thernet” is a set of two strings, as follows:
ethernet Ethernet There are many more ways to construct regular expressions, but I won’t go into that Even if you don’t know much about regular expressions, you can use grepperfectly well to search for a specific sequence of characters in one
or more text files Later on, you can gradually learn more complex search patterns
Setting aside the regular expressions for the time being, here is the syntax of
a typical use of grep:
Trang 11This grepcommand searches for the patternin the specified files, and
[options]denote one or more single-character options that begin with a hyphen Here are the options and their meanings:
-N(where Nis a number) displays Nlines around the line containing the pattern
-cshows the number of lines that contain the search pattern
-freads options from a specified file
-iignores case
-ldisplays the filenames that contain the pattern
-ndisplays a line number next to lines that contain the pattern
-qreturns a status code but does not display any output
-vdisplays the lines that do not contain a pattern
-wmatches only whole words
locate: Finding Files and Directories the Easy Way
The locatecommand searches a database of filenames for any name that matches a specified pattern If you are not sure about the location of a file, just type locatefollowed by a part of the filename For example, here’s how you can search for the XF86Configfile:
locate XF86Config This causes locateto display all file or directory names that contain XF86Configin their names
I love the locatecommand I use it all the time whenever I want to check if a certain file exists somewhere in my system Sometimes a huge number of files and directories might contain the search word You can send the output of locatethrough more by typing locate keyword | more and browsing the
output a page at a time Another trick is to send the output through the grep command and look for some other word that helps you find a specific file For example, when I want to see if there is a binary (executable) file with rpm in
its name, I type locate rpm | grep bin because I know that the binary files
would be in a directory whose name contains bin (for example, /bin, /usr/binor /sbin, and so on)
The locatecommand isn’t installed by default in SUSE Linux
335
Chapter 23: Ten Most Commonly Used SUSE Commands
Trang 12chmod: Changing Permissions
You use the chmodcommand to change the permission settings of one or more files The syntax is as follows:
chmod [-cfvR] perm files
The command changes the permission settings of filesto what you specify
in the permargument The characters within square brackets are the options and they have the following meanings:
-clists only files whose permissions have changed
-fstops any error message displays
-vverbosely displays permission changes
-Rrecursively changes permissions of files in all subdirectories
To use chmodeffectively, you have to learn how to specify the permission set-tings One way is to concatenate one letter from each column of the following table in the order shown (Who/Action/Permission):
o others = assign x execute
a all s set user ID
For example, to give everyone read access to all files in a directory, type
chmod a+r * On the other hand, to permit everyone to execute a specific file, type chmod +x filename.
Another way to specify a permission setting is to use a three-digit sequence
of numbers In a detailed listing of a file that you get when you use the com-mand ls -l, the read, write, and execute permission settings for the user, group, and others appear as the sequence rwxrwxrwx(with dashes in place
of letters for disallowed operations) Think of rwxrwxrwxas three occur-rences of the string rwx Now, assign the values:
r = 4
w = 2