![]() ![]() ![]() ![]() ![]() |
|
|
|
|
Flavor | Product | uname -r | Released |
---|---|---|---|
Microsoft | |||
- | IRIX | ||
AT&T | SVR4 (System V Release 4) | ||
Berkeley Software | FreeBSD | ||
- | NetBSD | ||
Hewlett Packard | HP-UX | ||
SunSoft | SunOS | 5.8 | |
Solaris | |||
IBM | AIX | ||
Linux![]() | Red Hat 9 | 2.4.20-6smp | |
Red Hat Enterprise Linux | 2.4.21-4.ELsmp | ||
Mandrake, Caldera, etc. |
This comparison of features across Unix implementations
from
Puppet, a cross-Unix administration tool.
Windows applications, such as Crossover Office, can be run on Linux (with varying success) by using Wine, an open source implementation of the Windows API running on top of Linux OS's.
In the early 1980s, Richard Stallman began the Open Source movement within the software industry by preaching that software should be free in that source code should be shipped with the software product because users:
Windows Management Instrumentation (WMI)
is based on the
Common Information Model (CIM)
supported by the
Desktop Management Taskforce (DMTF)
Making UNIX and Windows NT Talk
by Nadelson, Mark.; Hagan, Tom (Lawrence, Kan. CMP Books, 2000)
Windows 2000 & Unix Integration Guide
by Burnett, Steven Forrest.; Gunter, David.; Gunter, Lola.
(Berkeley, Calif. McGraw-Hill Professional, 2000)
Linux can serve Windows clients via the Samba package.
Installing Windows clobbers the dual-boot disk created when Linux is installed.
Memconf by Tom Schmidt is a
Perl5 script that displays the size of each SIMM/DIMM memory module installed in Sun/HP-UX systems.
Listed in the
SunManagers FAQ.
Poof! by Kilowatt Software provides 135 Windows command line tools.
use it instead of
Microsoft NT Power Toys which has been removed from Microsoft's website.
SlickRun is a free floating command line utility for Windows so that command aliases (known as MagicWords)
provide instant access to any program or website.
|
Shell | Command | Default Prompt |
Initialization File | History |
---|---|---|---|---|
MSDOS | cmd | > | AUTOEXEC.BAT | Began as CP/M from Gary Kildall. Purchased by Microsoft in the mid 1970's for the IBM PC. Ended at version 6.22 (7.1 within OEM Windows 95B) |
PCDOS | cmd | > | AUTOEXEC.BAT | Jointly developed by Microsoft and IBM until version 5. |
- | DRDOS | > | AUTOEXEC.BAT | Developed by Digital Research, then purchased by Novell, then Caldera/Lineo in 1999. |
Bourne Shell |
sh & bsh |
$ | .profile | Developed at AT&T by Stephen R. Bourne in the early 1970s.
It was the original and official shell distributed by AT&T and its successor, Unix System Laboratories, now owned by Novell.
Considered the fastest, most portable, and easiest shell to learn, it lacked command history![]() Shell scripts developed for public use are usually written in the Bourne shell language and assume a System V Release 1 environment. |
Bourne Again Shell |
bash | $ | .profile & .bash_profile | Created for use in the GNU project started by Richard Stallman of the Free Software Foundation (FSF) to replace all commercial UNIX utilities with freely distributable copyleft. Written by Brian Fox from Sunday, January 10, 1988 until 1993 when Chet Ramey became the official maintainer. |
C | csh | % | .login .cshrc (for settings) | Developed by William Joy (later Sun Microsystems' chief technology officer) and others at UC Berkeley during the early 1980s for C programming flexiblity. Provides the most shortcuts, but is slower than other shells. |
Korn | ksh | $ | - | Developed by David Korn in the early 1980s. It combines many of the best features of earlier command processors, so is considered a superset of the Bourne shell. |
POSIX | sh | $ | - | IEEE Std 1003.1 and IEEE Std 1003.2 supported by SunOS and Solaris |
Microsoft Shell | msh | > | - | Product code named "MONAD" in the 2004 Longhorn release of Windows provides manipulation of .NET objects and new WinFS type queries. Introduces user-declared System.Management.Automation namespace "commandlets" like unix pipes and "-whatif" directive for testing them. |
The C shell and Korn shell is preferred over the original Bourne shell which did not have command history capability.
|
Feature | sh | csh | ksh | python |
---|---|---|---|---|
Aliasing | - | Yes | Yes | |
Arithmetic expressions | - | Yes | Yes | |
Array variables | - | Yes | Yes | |
Assignment id=string | Yes | - | Yes | |
case statement | Yes | - | Yes | |
cdpath searches | SysV | Yes | Yes | |
-clobber overwrite protect | - | Yes | Yes | |
Command aliases | - | Yes | Yes | |
echo -n option | - | Yes | - | |
export command | Yes | - | Yes | |
foreach statement | - | Yes | - | |
getopts built-in command | - | - | Yes | |
History of commands | - | !n | fc | |
glob command | - | Yes | - | |
Hash table problems, rehash and unhash commands | - | Yes | - | |
Job control (bg, fg, ...) | - | Yes | Yes | |
let command | - | - | Yes | |
limit, unlimit commands | - | Yes | - | |
nice shell built-in | - | Yes | - | |
nohup shell built-in | - | Yes | - | |
notify shell built-in | - | Yes | - | |
onintr command | - | Yes | - | |
print command | - | - | Yes | |
pushd, popd commands | - | Yes | - | |
RANDOM shell variable | - | - | Yes | |
repeat last command | - | !! | - | |
Restricted version | rsh | - | rksh | |
select statement | - | - | Yes | |
setenv, unsetenv commands | - | Yes | - | |
SHELL variable specifies command to execute scripts | - | Yes | - | |
switch statement | - | Yes | - | |
until statement | Yes | - | Yes | |
set -x | Yes | - | Yes | |
set optionname | - | Yes | - | |
Set-uid scripts | - | - | Yes | |
Shell functions | SysV | - | Yes | |
Substring selectors :x | - | Yes | - | |
trap command | Yes | - | Yes | |
typeset command | - | - | Yes | |
ulimit command | Yes | - | Yes | |
Undefined variable is an error | - | Yes | - | |
! special character | - | Yes | - | |
@ command | - | Yes | - | |
$(...) command expression | - | - | Yes | |
*(...) wildcards | - | - | Yes | |
{...} wildcards | - | Yes | - | |
|& coprocessing | - | - | Yes | |
>& redirection | - | Yes | - |
To be prepared to use various shells, define different temporary folder names.
On UNIX systems, use these commands:
$ mkdir /u01/oradata/tmp $ TMPDIR=/u01/oradata/tmp; export TMPDIR $ TEMP=/u01/oradata/tmp; export TEMP $ TMP=/u01/oradata/tmp; export TMP
The Complete Idiot's Guide to UNIX
by Wagner, Bill (Indianapolis, Ind. Alpha Books, 1998)
Checking UNIX Server Performance
$3 UNIX Shell Programming, 2nd ed. (Hayden Books (Pearson): 1990)
by Stephen G. Kochan and Patrick H. Wood
Programming the UNIX Shell 3 week Online course I $295 & II $195
Sams Teach Yourself Shell Programming in 24 Hours
by Veeraraghavan, Sriranga
(Indianapolis, IN Sams Publishing, 1999)
UNIX Shell Programming Tools
by Medinets, David.
(New York McGraw-Hill Professional, 1999)
Learning the Bash Shell
by Newham, Cameron.; Rosenblatt, Bill.
(Cambridge, [England] O'Reilly and Associates, 1998)
Unix Network Management Tools
by Maxwell
Unix System Security Tools
by Ross
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn
sunfreeware.com offers several "ready to use" Software for SUN Solaris.
|
Function | UNIX command | DOS command |
---|---|---|
Find commands apropos to given text "HTTP" | apropos "HTTP" | |
Get a short description of the command "print" | whatis print | |
Read the manual on the command "print"
![]() | man print | help print |
Search manual (whatis database on the MANPATH) for topics beginning with the word &auot;printing" | man -k print | |
Clear screen. | clear (or Ctrl+L) |
cls |
What version of the kernel am I using? | uname -r | ver |
What directory is the shell located? (e.g., /bin/bash) | echo $SHELL | |
What distribution am I using? (e.g., RedHat Linux 9) | cat /etc/issue |
|
Action | UNIX stty | DOS |
---|---|---|
Alternative to Enter | Ctrl-J or Ctrl-M | |
Retrieve last command | Esc-K from vi | F3 |
Clear Screen | Ctrl-L | - |
Backspace: Erase last character typed | Ctrl-H or # | Backspace key |
Kill all the way back to the prompt (without executing it) | @ or Ctrl-U or Ctrl-X | Ctrl-C |
Stop | Ctrl-Z or q | - |
Exit / End of file | Ctrl-D | Ctrl-Z |
Scroll forward | spacebar | |
Scroll back | up arrow | |
Stop scrolling | Ctrl-S | |
Resume scrolling | Ctrl-Q | Ctrl-Q |
Swap Command line to KDE | Alt+F8 | |
Swap KDE to Command line | Ctrl+Alt+F1 |
In the UNIX Korn shell, this command prevents users from being logged off the system when Ctrl-D is pressed:
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
|
Code | Permission | Octal | Decimal |
---|---|---|---|
r-- | Read only | 0100 | 4 |
-w- | Write only | 0010 | 2 |
--x | eXecute only | 0001 | 1 |
rwx | Read, Write, eXecute | 0111 | 7 |
Each permission is stored as one binary bit within a 4-bit number.
Unix commands specify all three permissions at once using the decimal equivalent of the 4 bit "octal" number, so called because one can count to 8 using 4 binary bits.
- | u user | g group | o other | |
---|---|---|---|---|
ls -l | - | rwx | r-x | r-- |
chmod binary | 4+2+1 | 4+0+1 | 4+0+0 | |
chmod octal | 7 | 5 | 4 | |
umask binary | 0+0+0 | 0+2+0 | 0+2+1 | |
umask octal | 0 | 2 | 3 |
An octal number is used to store the permission of each category of ownership.
Umask filename without argument echoes current permissions settings as an octal number.
chmod 754 filename sets permissions using "7" for user, "5" for group, "4" for other.
umask 023 filename (user mask) cause all new files to be created as if "chmod 754" were executed after their creation.
chmod ugo+rwx filename sets permissions for all category of ownership.
chmod a+r filename sets permissions for all users.
In Solaris, to modify the default group membership of a file:
|
Solaris | ptconf|grep -i mem | project/task level |
ptconf|grep -J mem | processes and tasks | |
psrinfo -v | - | |
HP/UX | swapinfo -tm | |
IBM AIX | lsdev -C|grep mem lsattr El mem0 | |
DEC-UNIX | uerf -r 300 | grep -i mem | |
Linux | free |
Related page: The Windows Management Interface.
|
Action | UNIX options & filespec | DOS filespec & options |
---|---|---|
Reboot / re-start | reboot | - |
Shut down (halt) machine abruptly | poweroff halt -p shutdown -h now init 6 |
- |
Shut down (halt) machine gracefully | shutdown -ry 10
-c to cancel scheduled shutdown. |
- |
Elapsed time (and other statistics) since last reboot | uptime | NET STATISTICS |
List installed patches | showrev -p patchadd -p | - |
|
Action | UNIX options & filespec | DOS filespec & options |
---|---|---|
View computers on a network: | ? | NET VIEW |
List shares on a given machine: | ? | NET SHARE |
List user accounts on a given machine: | ? | NET USER |
List user sessions on a given machine: | ? | NET SESSION |
Add computer “homer” to the PDC on the local domain: | ? | net computer \\homer /add |
|
Action | UNIX options & filespec | DOS filespec & options |
---|---|---|
List Windows services/UNIX processes (daemons): | pstree ps -aux |
NET HELP START |
Start service/process | - | NET START service |
Stop service/process | - | NET STOP service |
Pause and continue started services: | pstop 22121 | NET PAUSE service
NET CONTINUE service |
Kill process | pkill HUP in.named |
Microsoft does not provide a built-in command to stop processes. However,
![]() ![]() |
To fork processes:
| ![]() ![]() ![]() |
|
Function | UNIX command | DOS command |
---|---|---|
Total Disk Usage (in 512 byte blocks) | du -s | chkdsk |
Disk Usage for directories -in kilobytes | df -kah | - |
Disk Usage for each file | du -lR -a | - |
Disk Quota information | DQinfo | - |
Disk Quota allocation | DQalloc | - |
Disk Quota removal | DQrm | - |
Repartition FAT disk | Linux fips.exe | |
Reformat disk drive system | mke2fs | format |
|
Function | Linux | Microsoft |
---|---|---|
Kernel | root /boot |
"WINNT" or "WINDOWS"![]() |
Executables | /usr/bin /usr/lib /usr/include /usr/share /usr/doc /usr/apps |
"Program Files" |
Drivers | /dev | Win.../System32 |
hosts file | /etc | Win.../System32/Drivers/Etc |
One for each User | /usr /user |
"Documents and Settings" |
Log files | /var | - |
Temporary work files | /tmp | Temp |
Optimizing Utilities | /opt | - |
To get a list of libraries mapped into processes on Solaris: pldd $$
|
Action | UNIX options & filespec | DOS filespec & options |
---|---|---|
Check current Print Working Directory | pwd | cd |
Return to user's home folder | cd cd ~ |
cd / |
Up one folder | cd .. | |
Make directory | mkdir proj1 | |
Remove empty directory | rmdir /usr/sam | rmdir or rd |
Remove directory -recursively | rm -r | rmdir /s (NT)
deltree (Win 95) |
|
Action | UNIX options & filespec | DOS filespec & options |
---|---|---|
List directory tree -recursively | ls -r | tree |
List last access dates of files, with hidden files | ls -l -a | |
List files by reverse date | ls -t -r *.* | dir *.exe /o-d |
List files verbosely by size of file | ls -l -s *.* | dir *.* /v /os |
List files recursively including contents of other directories | ls -R *.* | dir *.* /s |
List file types in color | ls -flai --color | |
List number of lines in folder | wc -l *.xtuml sed -n '$=' |
sed -n "$=" |
List files with x anywhere in the name | ls | grep x |
The "ls -l" command lists permissions for both files and directories. An example:
|
Linux | UNIX | File Type | Color | test |
---|---|---|---|---|
blank | - | Regular/normal file | White | -f |
/ | d | Directory/folder | Blue | -d |
* | Program or executable script | Green | -x | |
| | p | Named (fifo) Pipe | -p | |
@ | l | Symbolic link | Aqua | -h |
= | Socket | |||
b | Block special file | -b | ||
c | Character special file | -c |
The test command also uses -s for nonzero size, -w for writeable by the current user, -a for ???
For no color
An inode number is the address of a disk block.
Two filenames with the same inode means they are aliases of the same physical file.
To create a hard file link (within the same directory):
To create a symbolic link:
Microsoft uses the first letter of each attribute name
(read-only, archive, system, hidden):
| ![]() | ![]() ![]() ![]() |
|
Action | UNIX options & filespec | DOS filespec & options |
---|---|---|
To untar a tar file (used in UNIX but not recognized by WinZip8): | tar -zxvf file | not WinZip |
To unjar a jar (Java archive) file | jar -xvf file.jar | Winzip? |
Page the contents a screen at a time: spacebar forward, B for Backward, Q to Quit | less afilename | |
Peek at the first and last n lines | head -n file tail -n file |
TYPE x.txt | MORE |
Create new (blank) file | touch afilename | |
Copy old.file to new.file
-p preserve file attributes (e.g. ownership and edit dates) -r copy recursively through directory structure -a archive, combines the flags -p -R and -d | cp old.file new.file | copy old.file new.* ![]() |
Move old.file (-i interactive flag prompts before overwriting files) | mv -i old.file /tmp | Copy old.file /tmp del old.file |
Remove file (-intention) | rm -i sam.txt | del sam.txt |
Find and (blindly) remove files in the system with file types of tmp which haven't been accessed in the last 10 days | find / -name "*.tmp" -atime +10 -exec rm {} \; | - |
Find and prompt user mike to OK removal of files in the system with file types of tmp | find /usr/home/mike -name "*.tmp" -ok rm {} \; | - |
Find and print user files in the system with file types of txt | find /usr/home -depth -name "*.tmp" -print | edit file.txt |
Compare two files and show differences | diff | comp
fc |
|
Redirection & Piping Action | UNIX |
---|---|
Read STDIN file feed.txt and output STDOUT to file x.txt and STDERR to file err.txt
![]() | readnews 0>feed.txt 1>x.txt 2>err.txt |
outputs to nowhere
![]() | readnews > /dev/null |
count entries starting with "a" from a listing | ls -l | grep d? | wc |
input file schedule into the mail program to output file acctng | mail acctng < schedule |
Appends output of command to the bottom of AppendedFile. | command >> AppendedFile |
Concatenate 3 files and pipe to line printer and tee (replicate) it to the screen as well. | cat file.1 file.2 file.3 | tee lp |
|
Action | UNIX options & filespec | DOS filespec & options |
---|---|---|
View a file | EMACS |
edit file.txt |
Edit file | pico myfile | edit myfile |
view file starting at line number 39 | more +39 whatever.txt | |
Format text for printer | troff file.txt nroff file.txt |
|
Compact (defragment) files | compact | |
Concatenate files | cat file1 file2 to standard output. | copy file2 >>file1 |
Counts -lines, -words, and -characters in a file | wc -l | |
Displays line-by-line differences between pairs of text files. | diff | |
calculator | bc | |
calendar for September, 1752 (when leap years began) | cal 9 1752 |
WinBatch from
Morrie Wilson WindoWare of Seattle compiles makes executable runtimes from macro scripts
written using its own “Windows Interface Language”
for controlling Windows and Windows NT and Novell Netware clients.
MIcrosoft's Windows Scripting Host
/rdb from Revolutionary Software is a commercial product ($249 for Linux/BSD $495 for Sun/AIX/HP/Windows) implemented as a
suite of 131 UNIX shell level commands. It's described in
UNIX relational database management: application development in the UNIX environment
and the
1988 UNIX Relational Database Management, both by Rod Manis, Evan Schaffer, and Robert Jorgensen.
| ![]() ![]() ![]() |
|
Pattern | Example | |
---|---|---|
Position | ? stands for any single character | ls ?1 |
Position | * stands for any number of characters | ls 2* |
Specific characters | [AB] stands for any number of characters | ls [AB]1 would yield A1 and B1 |
Range of characters | [A-Z] stands for letters from A thru Z |
The MS-DOS CLI command Comp compares the contents of two files or two sets of files. Its syntax:
Usage Example:
compares the files in \path1\myfiles with those in \path2\myfiles and show just the line numbers of any discrepancies.
The MS-DOS CLI command FC (file compare) two individual files and displays content discrepancies. Its syntax:
The MS-DOS CLI command findstr (find string) in an individual file. Its syntax:
sed works like a find-and-replace filter.
Its
general format is: 's/ regexp / replacement / flags'
| ![]() Eric Pement has an errata of sed versions in his sed faq:
GNU sed v4.0 - v4.0.5, GNU sed v3.02.80 GNU sed v3.02 GNU sed v2.05 GNU sed v1.18 GNU sed v1.03 sed v1.6 (Briscoe) sed v1.5 (Helman) sedmod v1.0 (Chen) HP-UX sed SunOS sed v4.1, v5.6 Ultrix sed v4.3 Digital Unix sed | ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
Related:
|
![]()
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page ![]() Support this site: Thank you! |