Interview

Take command of your Linux commands

Jan Stafford, Editor
If you could make every user do one best practice for Linux, what would it be?
Learn all about your shell, even the most obscure bits. It's the program that most of us spend most of the time using,

    Requires Free Membership to View

so it pays to be efficient at it. Type "info bash" or "man tcsh", read the whole thing, and try out each feature until you understand it. Sure it takes time, but a little learning now will translate into a LOT of time saved later, as you gain agility in using the advanced features.

On a related note, make sure to understand the distinction between Linux commands and the shell. Not everybody realizes that wildcards and various other special characters are expanded by the shell, not the invoked program, which makes command-line invocation seem mysterious sometimes.

How many users type "ssh myhost ls a*", trying to list their remote files whose names begin with "a", and don't understand why it fails? The "a*" gets evaluated in your local, current directory before ssh is even invoked. That sort of thing [is important].


Dan Barrett is the author of other O'Reilly books, including Linux Security Cookbook and SSH, the Secure Shell: The Definitive Guide. Click here for more information about Linux Pocket Guide from O'Reilly & Associates; ISBN: 0596006284

FEEDBACK: How is your enterprise using Fedora?
Send your feedback to the SearchEnterpriseLinux.com news team.

If you could erase one Linux worst practice for all time, what would it be?
Non-standardized command-line options. We shouldn't have to remember that one command uses "-h" to print a help message, another uses "--help", a third uses "-v", and a fourth prints it when invoked with no arguments. It's enough to make newcomers tear their hair out. What little-used Linux tools can benefit admins greatly if used more often?
Xargs is my favorite these days. It reads standard input and produces a set of commands on standard output. It took me years to notice xargs and now I can't live without it. If you've ever been frustrated by the length limits of a command line (e.g., when you type "ls a*" and get told "Argument list too long"), or the limitations of "find -exec" for processing directory trees, learn xargs. Its man page is too terse to communicate the real power of the program, so Google for good examples. In your opinion, what is the funniest command (abbreviation or any other term) associated with Linux?
Well, a lot of the classics that worked for Unix have been lost in Linux. For instance, on Unix if you typed "make love" (the program "make" with the argument "love") the error response would say, "Don't know how to make love. Stop."

One silly command line that has survived still works in the tcsh shell. Make sure you're running tcsh (type "tcsh" if you're not) and type, "got a light?" The shell responds, "got no match." What are the top five Linux commands IT admins should know and use?
Whew, there are so many good ones, but here are five I use regularly:

  1. ssh, for secure network connections and tunneling of TCP services.
  2. perl, for scripting just about anything.
  3. m4, the macro processor, for automatically generating configuration files for specialized tasks.
  4. cron, for scheduling tasks.
  5. logwatch, a handy utility for summarizing your log files.

But I've left out emacs, snort, xinetd, spamassassin, and 100 others. What don't Windows admins know about managing Linux?
That the command line is your friend, not to be feared. Some Windows admins feel lost without a familiar GUI tool. Linux has a steep learning curve but once you're up to it, it's hard to look back. And once you are comfortable with the command-line tools and textual configuration files, you can script your system administration tasks very effectively. Scripting is so much more powerful on Linux, for sysadmin tasks or other purposes.

Some Windows admins feel lost without a familiar GUI tool. Linux has a steep learning curve but once you're up to it, it's hard to look back.
Dan Barrett
Author
Fedora isn't designed for business usage, is it? Would IT shops be better off ignoring it altogether, or can they use it in some way in their organizations?
Really, it depends on the business. I would feel completely comfortable running a small business on Fedora or just about any other common distribution. Fedora's got a powerful Web server, an office suite (OpenOffice.org) and plenty of other useful software for business. If you want to run a large server farm, Fedora isn't necessarily a bad choice; but if you also want enterprise-level technical support, you'd look elsewhere.

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: