<-- Click to support a LinuxWorld sponsor
Linuxworld
Search Linuxworld
HOME >
[More Stories]

In Admin:

Time for a new installation paradigm

A strategic comparison of Windows vs. Unix, v. 2.0

In Programming:

Time for a new installation paradigm

Does an organization have anything to gain from .Net?

In Desktop:

No complaints here: Linux gaming is gaining steam

Migrating to Linux not easy for Windows users

In Core Linux:

Open source making headway in Texas government

Debunking the Linux-Windows market-share myth

About us

Help & feedback

Privacy

Terms of use

Advertise

IDG Worldwide


Command-line NT: It does exist!
Less featureful, less elegant -- but there
Apr 9, 1999
Summary
Do you need to remotely manage NT boxes from your Linux workstation? From native commands to Unix ports and from shells to daemons, you may be surprised how many Linux-like options you really have on NT. Gerald Carter stocks his command-line NT administration toolkit with free and commercial utilities in this month's There and Back Again. (3,400 words)


By Gerald Carter
Page 1 of 4
Advertisement

Suddenly another voice spoke, low and melodious, its sound an enchantment. Those who listened unwarily to that voice could seldom report the words that they heard; and if they did, they wondered, for little power remained in them. Mostly they remembered only that it was a delight to hear the voice speaking, all that it said seemed wise and reasonable, and desire awoke in them by swift agreement to seem wise themselves.

--Description of the voice of Saruman in JRR Tolkien's The Two Towers

One of the major complaints launched against Windows NT from an administrative viewpoint is that it has very weak command-line capabilities. When compared to Linux, this may be true. But Windows NT isn't as crippled as some people claim. Now, I'm not saying the Windows NT command interpreter cmd.exe competes with bash on any level. But there are some functional command-line tools available for Microsoft's premier operating system. Not many of them actually come from Redmond, though...

But that isn't important. By and large, what any administrator wants most are scripts and other features to automate his or her work. Since this is such a noble goal, there are actually many ways you can perform common tasks using console applications. With experience, you can wean yourself from the NT GUI and eventually get to the point where you will prefer using cmd.exe to Windows Explorer.

Native command-line tools
First let's look at some of the tools with command-line capabilities that ship as part of the basic operating system. Rather than try to write a command reference section, what I've done is list some Windows NT commands and their functional equivalents under Linux. The functionality may not be an exact match -- for example, the Linux mount command and the NT net use command. However, the match will be close enough to illustrate the general idea.

Table 1: Linux commands and their Windows NT equivalents
DescriptionLinux command Windows NT equivalent
Mount a remote filesystemmount -t nfs bilbo:/export/home /home net use h: \\bilbo\users
List user accounts on the local machinecat /etc/passwd net users
List user accounts in the network databaseypcat passwd.byname net users /domain
List groups on the local machinecat /etc/group net localgroup
List groups in the network databaseypcat group.byname net group
Create an exported sharevi /etc/exports

killall rpc.mountd

/usr/sbin/rpc.mountd

net share newshare=c:\export
Stop/start a service or daemonUse the appropriate SystemV init script.

For example,

/etc/rc.d/rc3.d/S30nfs {start|stop}

net [stop|start] Server
Gather statistics on shared file servicenetstat or rpcinfo net statistics Server
Synchronize with a remote time serveruse the xntp protocol net time \\bilbo /set /yes
Schedule a job to execute at a some time in the futurecrontab -e

(or use the at command)

at 10:00pm cmd.exe
Change permissions on a filechmod 700 testfile # sets access perms

chown jerry testfile # set ownership

chgrp users testfile # set group ownership

cacls testfile /p jerry:c
Check the integrity of a filesystemfsck /usr chkdsk c:
Compare the contents of two filesdiff file1 file2 fc file1 file2
Edit a text filevi file1.txt edit file1.txt

While Table 1 isn't a complete list of all possible things that can be done from the command line with a vanilla NT installation, it does give us a place to start. In addition, Windows NT provides its own versions of:

  • ping

  • traceroute (called tracert.exe under NT)

  • ftp

  • netstat

  • route

  • arp
  • rsh, rcp, and rexec

One final command that I tend to use a lot under Windows NT is the ipconfig.exe command. This tool allows you to manually release and renew IP address and related information via DHCP. If you assign static IP settings, you can still use ipconfig.exe to view the assigned information without launching the network control panel GUI. It does not however, allow for the setting of static IP address information.

Next page >
Page 1 Command-line NT: It does exist!
Page 2 Ports of Unix tools
Page 3 Windows NT Resource Kit
Page 4 Administering remote Windows NT clients from the command line

Printer-friendly version
Select this link to find a printer-friendly version of this story.

Mail this story to a friend
Select this link to mail this story's URL to a friend.


Resources
  • Virtually UN*X!
    http://www.itribe.net/virtunix/
  • The GNU-WIN32 Project Page
    http://www.cygnus.com/misc/gnu-win32/
    Gnat & GDB download sit ftp://ftp.cdrom.com/pub/languages/ada/compiler/gnat/distrib/winnt/
  • Perl5 for Win32
    http://www.ActiveState.com/
  • Tcl/Tk
    http://www.scriptics.com/
  • New Technology Shell (NTsh)
    http://ntsh.home.pages.de/
  • Source to New Technology Shell
    http://wwwcip.informatik.uni-erlangen.de/user/mnwaitz/zips/ntsh-src.zip
    ServersBooks

  • Copyright © 1998-2003 LinuxWorld.com, an IDG Communications company.


     <-- Click to support a LinuxWorld sponsor