ExpertCentral.coman About company
Your Search is Over!
Expert Home Sign Up My ExpertCentral Answer Library Help
Search for Experts in 
View question by Expert saintly
Question History!
From : creepy_17
To : saintly
Rating :
Message Status : Confidential

[08-16-2000] creepy_17 : I would like to know:

- the commands used in UNIX and MSDOS to perform the following tasks:

a) change from one directory to another
b) Telnet to a remote host
c) Transfer files from a remote host
d) Copy a file from one directory to another
e) Move a file from one directory to another
f) Delete or remove a file or directory
g) View the contents of a file

- Explain how a full directory listing is obtained in both UNIX and MSDOS and the differene between the two listings

- Explain the difference between a file pathname in UNIX and MSDOS

Thank you
[08-16-2000] saintly :
Wow! This almost sounds like a homework assignment, like say from a college computing course? Hehe... Okay, anyway.

Change from one directory to another:
DOS and UNIX: cd
DOS Example: cd C:\WINDOWS\
UNIX Example: cd /usr/home/creepy_17

Telnet to a remote host:
DOS and UNIX: telnet hostname [port]
DOS Example: telnet some.hostname.com
UNIX Example: telnet some.hostname.com
NOTE: Pure MS-DOS does not have a telnet or FTP command! It was made in the pre-internet days. Support for networks was added with Windows or Novell, and support just copied the UNIX command syntax.

Transfer files from a remote host
DOS and UNIX: ftp hostname
DOS Example: ftp rtfm.mit.edu
UNIX Example: ftp rtfm.mit.edu

Copy a file:
DOS: copy source destination
UNIX: cp source destination
DOS Example: copy c:\windows\system.dat c:\bak\
UNIX Example: cp ~/.profile ~newuser/

Move a file from one directory to another:
DOS: move source destination
(NOT available in Pre MSDOS 5.0)
UNIX: mv source destination
DOS Example: move c:\io.sys c:\bak\
UNIX Example: mv ~/* /var/tmp

Delete or remove a file or directory:
DOS: del filename, deltree directory, rd directory
UNIX: rm file, rm -r directory, rmdir directory
DOS Example:
Deleting a file: del file.ext
Deleting a directory: deltree -y c:\windows\
Deleting an empty directory: rd c:\progra~1\
UNIX Example:
Deleting a file: rm file
Deleting a directory: rm -rf /etc
Deleting an empty directory: rmdir ~newuser

View the contents of a file:
DOS: type file, edit file, edlin file
UNIX: cat file, more file, vi file
DOS Example:
type filename.ext | more
edit filename.ext
edlin filename.txt
UNIX Example:
cat ~/.plan
more /etc/XF86config
vi /etc/XF86config

Obtain a directory listing:
DOS: dir directory
UNIX: ls -la directory
DOS Example: dir C:\WINDOWS
UNIX Example: ls -l /etc

Differences between the two listings:
DOS/dir shows the current drive label (and serial number on post MSDOS 3.3), marks directories with a "
" tag, counts files in the directory and lists free space remaining on the partition.
UNIX/ls (-l) lists file permissions, owner and group, and number of hard links to the file.
Output order is different, with DIR (and a Win95 machine) it is a columnar report of:
Abbreviated filename, directory tag, file size, modification time and date and full file name.
On UNIX the columns are:
Permissions, hard links, owner, group, modification time and date, and filename.

Pathnames in DOS are composed of an optional drive letter and colon preceding and use the backslash (the '\' because DOS is BACKWARDS) to denote subdirectories. UNIX filenames have no drive letter and use the forward slashes (the '/' because UNIX machines can look FORWARD to the future). Example of full pathnames:

DOS: C:\WINDOWS\SYSTEM\
Means a folder called 'system' on the C: drive (Primary hard disk active partition), under the 'windows' folder under the root directory.

UNIX: /usr/local/bin
Means a folder called 'bin' under the folder 'local' under the folder 'usr' under the root directory.

Hope that helps! Let me know if you have more questions.
[08-16-2000] saintly : Where the answer got all screwed up there was where I was trying to say that DOS marks directories with the <DIR> tag. Sorry, the ><s got interpreted as HTML in the answer.
[08-17-2000] creepy_17 : saintly, thank u for ur help and u really saved my life cos this is an assignment that i have to hand up tomorrow. Much appreciated.

ExpertCentral.com
Home | Sign Up | My ExpertCentral | Answer Library | Help | Log Out
Public Board | How it Works | Why Join? | Tell a Friend | About Us | Contact Us

Copyright © 2000 ExpertCentral.com, Inc. All Rights Reserved.
ExpertCentral and ExpertCentral.com are trademarks of ExpertCentral.com, Inc.
Use of this site constitutes your acceptance to the terms and conditions of the ExpertCentral Member Agreement.