The content of this document may be incorrect or outdated.
Print this article Edit this article
Command Differences Between SunOS and Solaris
This document describes the differences you will encounter between the SunOS and Solaris command sets.
Command Differences
This section lists, in alphabetical order, changes in the standard UNIX commands between SunOS and Solaris. This list contains only those commands the ECN staff believes are of general interest; consult the Sun manual, System Transition Guide for Users, for a complete list of command differences.
Mail
This command is not available in Solaris. Similar functionality is provided by themailxcommand. (Basically, the Berkeley/Sunmailx.) You can place the commandset bsdcompatin your ~/.mailrc to makemailxbehave as it did on SunOS.
arch
This command is not available in Solaris. Similar functionality can be obtained by using theuname -mcommand, which gives output identical to thearch -kcommand. Theunamecommand is also available in SunOS.
at
The-coption (usecshto execute the script) is not available in Solaris.
atq
In Solaris, only the jobs belonging to you will be displayed; it is no longer
possible to view the jobs belonging to other users.
bar
This command is not available in Solaris. Similar functionality is provided
by thetarcommand.
biff
This command is not available in Solaris. The equivalent ofbiff yischmod u+x `tty`, while the equivalent ofbiff nischmod u-x `tty`.
cdmount
This command has been replaced by the Volume Manager, described in Chapter 6, Media Management.
df
The output from this command is formatted differently in Solaris, and it accepts a different set of options. Consult the manual page for details.
dosmount
This command has been replaced by the Volume Manager, described in Chapter 6, Media Management.
du
The SunOS version of this command reports disk usage in kilobytes (1024 bytes), while the Solaris version reports usage in 512-byte blocks. The -k option to the Solaris version enables output in units of kilobytes.
echo
In Bourne shell (sh) scripts only, the-noption is no longer supported in Solaris. Similar functionality is obtained by placing a\con the end of the string to be echoed.
fdmount
This command has been replaced by the Volume Manager, described in Chapter 6, Media Management.
find
The-lsand-xdevoptions are not available in Solaris. The-lsoption may be simulated by using the arguments-exec ls -gilds {} \;.
from
This command is not available in Solaris.
hostname
This command is not available in Solaris. Theuname -ncommand provides similar functionality. Theunamecommand is also available in SunOS, although this particular option to the command does not behave in quite the same way.
ksh
The Korn shell is provided by the ECN staff in /usr/unsup (/usr/unsup/bin) on SunOS; it is a standard part of Solaris.
leave
This command is not available in Solaris.
lpq
This command is not available in Solaris. The lpstat command provides similar functionality. See Chapter 5, Printing Changes.
lpr
This command is not available in Solaris. The lp command provides similar functionality. See Chapter 5, Printing Changes.
lprm
This command is not available in Solaris. The cancel command provides similar functionality. See Chapter 5, Printing Changes.
ls
In Solaris, the group ownership of the file is displayed by default when the-loption is given. The-goption disables the display of group ownership. In SunOS, the group ownership of the file is only displayed if both the-land-goptions are given. (In other words, the meaning of-ghas been reversed.)In SunOS, the
-soption displays the size of the file in kilobytes (1024 bytes). In Solaris, the size of the file is displayed in 512-byte blocks. There is no command option to enable the use of kilobytes in this field.
mach
This command is not available in Solaris. It has been replaced by theuname -pcommand. Theunamecommand is also available in SunOS, but the-poption is not supported.
mail
In SunOS, this command is the same as themailxcommand in Solaris provides similar functionality to the SunOS
man
The names of the chapter subdivisions have changed in Solaris.In SunOS a manual section was simply specified on the command line as the first argument; in Solaris the
-soption is used to specify a section.
pr
Several command line options have changed or been added in Solaris; consult the manual page for more information.
printenv
This command has been replaced by the env command in Solaris.
ps
The options to this command are completely different between Solaris and SunOS. The following table provides some commonly-used equivalents; consult the manual page for more details.
SunOS Solaris
-----------------------
ps ps
ps -x ps -u yourlogin
ps -ax ps -e
ps -axl ps -el
ps -axlww ps -elf
ps -t00 ps -t tty00
ps -tp0 ps -t pts/0
ps 12345 ps -p 12345
reset
This command is not available in Solaris. Similar functionality is provided by the stty sane command.
rlogin
In SunOS, the argument to the-eoption is given with no intervening space as in-ec; in Solaris the option has an intervening space, as in-ec. To specify "no escape character" in SunOS the-eoption was used with no character specified; the-Eoption is used (with no additional argument) in Solaris.
rm
The ECN staff has normally replaced the standard version of this command with a locally written version that places removed files in /zap. With the conversion to the CUE, we will be using a different version of this command that places files in a special location when they are removed. They can be "unremoved" by using the new unrm command.
screendump
This command is not available in Solaris. Similar functionality is provided by the xwd command in OpenWindows and X11.
stty
The names of several modes have changed between SunOS and Solaris; consult the manual page for full details. The table below provides equivalents for some commonly-used modes.
SunOS Solaris
__________________________
crt no equivalent
crterase echoe
crtkill echoke
ctlecho echoctl
everything -a
talk
There are two versions of thetalkprotocol - the original, which is used on Solaris, has problems when talking with machines that use a different internal data representation. The newer version, sometimes calledntalk, fixes these problems. The CUE specifies that the new version oftalkbe installed in /usr/ local/bin; this version works best for on-campus use. However, because other off-campus sites may not use this version (it is not shipped by Sun), we have left the Sun standard (old) version of talk in /usr/bin. Thus, if you simply typetalk, you will get the new version; if you have trouble talking to a friend at an off-campus site, you might try using /usr/bin/ talk instead.
tset
This command is not available in Solaris. Similar functionality for terminal setup (setting tabs, etc.) is provided by the tput init command.
vacation
The usage of this command has changed between SunOS and Solaris; consult the manual page for details.
whoami
This command is not available in Solaris. The id command provides similar functionality.
Using Third-Party Software From A SunOS System
Because we have not yet received the Solaris versions of some of the third-party software packages we support, you may have to use a SunOS system to run these packages. This section describes some ways to do this.
Non-Windowing Packages
Packages that do not use a window system, but rather just use a ``dumb terminal'' interface, are the simplest to deal with. You can just start up an xterm or shelltool window, log in to a SunOS system using the rlogin command, and then use the package as you normally would.
For example, to use Maple to calculate the integral of an expression, you might perform the following steps. (Note that you don't really need to do this for Maple, since Maple is available on Solaris.)
solaris_host% rlogin sunos-host
....message of the day, etc...
sunos-host% maple
|\^/| MAPLE V
._|\| |/|_. Copyright (c) 1981-1990 by the University of Waterloo.
\ MAPLE / All rights reserved. MAPLE is a registered trademark of
<____ ____> Waterloo Maple Software.
| Type ? for help.
> 4*x**3 + 12*x**2 + 9*x + 11;
3 2
4 x + 12 x + 9 x + 11
> int(", x);
4 3 2
x + 4 x + 9/2 x + 11 x
> quit;
bytes used=117964, alloc=131048, time=.166
sunos-host% ^D
solaris-host%
As a second example, to use ACSL to run the file pendlm.csl and generate a PostScript plot, you might perform the following steps.
solaris_host% rlogin sunos-host
....message of the day, etc...
sunos-host% acsl pendlm
Start Translation step
ACSL Model File: pendlm.csl
List on File: stdout
Compile from: pendlm.f
Include from: pendlm.inc
Table Space: 100000
Options Used:
Macro File: /home/ups3/SYSTEM/acsl10d/bin/acslm.bin
Start Fortran step
pendlm.f:
MAIN main:
BLOCK DATA zzdata:
zzsiml:
zzderv:
Start Link step
Start Run step
Automatic startup disabled.
Unable to open file: pendlm.cmd
ACSL>prepare t, th, thd, thdd
ACSL>set kdamp = 0.01
ACSL>start
ACSL>set plt = 15 set plot file unit number
ACSL>set devplt = 5 set plot device to PostScript
ACSL>plot th, thd
n Opening new plot unit number 15 as (plot15)
ACSL>quit
STOP: End ACSL run
sunos-host% ^D
solaris-host%
It should probably be noted that for this particular example (ACSL), we could also have used the Tektronix plot output mode, if we had used an xterm in ``4014'' mode to log in to the remote host.
Windowing Packages
Windowing packages are somewhat more complicated, because you have to tell them how to display their windows on your local workstation, even though you are logged in to some other host.
SunView Packages
SunView, because it is not a networked window system, does not allow programs running on a remote host to create windows on the local host. This means that you cannot use SunView programs from a remote host to display on your Solaris system. Most packages run under X11 or OpenWindows, and are described in the next section.
X11 and OpenWindows Packages
X11 and OpenWindows both allow programs running on remote hosts to create windows on the local display. To set this up, you need to perform the following steps:
- Enable the remote host to create windows on the local display. If you are using OpenWindows, this step is not necessary. If you are using
xauthunder X11, this step is not necessary. If you are not usingxauthunder X11 (or if you're not sure), you need to use thexhostcommand to allow the remote host (the one running SunOS) to create windows on the local display. To do this, type:% xhost+sunos-hostOnce you are done using the package, you may want to remove access for this host again; to do this type:
% xhost-sunos-host - Log in to the remote host (the one running SunOS).
- Set your DISPLAY environment variable so that it indicates your local host (the one running Solaris), display number zero. This can be done with the command
setenv DISPLAY solaris-host:0
in the C shell (csh), and with the commands
DISPLAY=solaris-host:0
export DISPLAY
in the Bourne shell (sh) and Korn shell (ksh). - Execute the package as you normally would.
For example, to use MATLAB to plot a vector, you might perform the following steps. (Note that you don't really need to do this for MATLAB, since it is available for Solaris.)
solaris-host% xhost +sunos-host allow display accessAs another example, to use Mathematica to plot an equation, you might perform the following steps. (Note that you don't really need to do this for Mathematica, since it is available for Solaris.)
solaris_host% rlogin sunos-host
....message of the day, etc...
sunos-host% setenv DISPLAY solaris-host:0 set display variable
sunos-host% matlab
< M A T L A B (tm) >
(c) Copyright 1984-92 The MathWorks, Inc.
All Rights Reserved
Version 4.0a
Dec 11 1992
This is the Engineering Computer Network at Purdue University.
Problems? Contact your site specialist for release notes or other help.
Commands to get started: intro, demo, help help
Commands for more information: help, whatsnew, info, subscribe
>> a = [ 0 2 4 6 8 1 3 5 9];
>> plot(a);
a plot now displays in an X window...
>> quit
187 flops.
sunos-host% ^D
solaris-host% xhost -sunos-host disallow display access
solaris-host%
solaris-host% xhost +sunos-host allow display accessGenerally, the steps are the same regardless of what command you want to use. First allow the remote host to access your display using
solaris_host% rlogin sunos-host
....message of the day, etc...
sunos-host% setenv DISPLAY solaris-host:0 set display variable
sunos-host% math
Mathematica 2.1 for SPARC
Copyright 1988-92 Wolfram Research, Inc.
-- Motif graphics initialized --
In[1] : = 3*x^4 + 2*x^3 + x^2 + 5*x + 2
2 3 4
Out[1]= 2 + 5 x + x + 2 x + 3 x
In[2]:= Plot[Out[1], {x, 1, 10}]
Out[2]= -Graphics-
a plot now displays in an X window...
In[3]:= Exit[]
sunos-host% ^D
solaris-host% xhost -sunos-host disallow display access
solaris-host%
xhost (if necessary), then log in to the remote host and set your DISPLAY environment variable to reference the local host, and then execute the program.
DWB Troff and Sun Troff
The ECN-maintained version of the troff family of programs, Documentor's Workbench 2.0, is installed in /usr/local/bin/dwb. However, Solaris also comes with a version of device-independent troff ; it is installed in /usr/bin. If the /usr/local/bin/dwb directory comes before the /usr/bin directory in your search path, you will be using the ECN versions of the troff,eqn,tbl, and pic commands. If however the /usr/local/bin/dwb directory comes after the /usr/bin directory in your search path, you will be using the Sun versions of these commands. Both sets of commands work, however you may receive slightly different results depending on which version you use.
Special Note for -mm Users When using the -mm macro package, it is common to include a line such as
at the top of your file. This is a poor practice, because it means that if the name of this file ever changes, or it is stored in a different directory, your document will no longer format correctly until you change this line. Just such a change has taken place with Solaris, and the names of the macro files have been changed. This means that you will need to change your.so /usr/lib/tmac/tmac.m
.so lines to accommodate this change.
If you would like to include the standard version of the -mm macro package, you should use the line
in your files. Using this version of the macro package means that if you take your document to a non-ECN host (or send it to a friend), it will format correctly..so /usr/lib/tmac/m
If you would like to include the ECN-modified version of the -mm macro package, you should use the line
in your files. Using this version of the macro package means that your document may not format correctly on a non-ECN system, because of local modifications..so /usr/local/lib/dwb/tmac/tmac.m
In order to ease with this transition, we have placed a link from /usr/lib/tmac/tmac.m to /usr/local/lib/dwb/tmac/tmac.m so that your documents will continue to format as you expect. However, this is a temporary link, and it will be removed on December 31, 1994. You should make sure you change all your .so lines before that date if you wish to continue using the ECN-modified version of the -mm macros.
If you would like to avoid having to do this again in the future, you should consider changing your files so that they do not use .so to include the macro package at all, and instead use the -mm command line option to troff.
Last Modified:
Dec 19, 2016 11:12 am US/Eastern
Created:
Mar 5, 2007 1:41 pm US/Eastern
by
admin
JumpURL: