| Webhosting | Prices / Features | Support | Forums | Backgrounds | Announcements | Contact us |

Unix Commands

    Telnet
Telnet programs are a type of terminal emulation program, just like modem-based communications programs. The difference is that they allow you to access other computers through the Internet, rather than by dialing the other computers directly.
Telnet programs "talk" to other Internet-connected computers using what's called the "telnet protocol" for communication. This protocol specifies how telnet programs should send data back and forth, allowing for interactive text sessions.
To access your account, you'll need a shell (a program that sends whatever you type to the host computer). The easiest way to go about this is to open a Telnet window. Accessing files with Telnet is essentially the same as opening the chooser on your Mac or opening the Networking on a PC - except that when you get into the file structure, you won't find all those color-coded directories.
While online, you may be able to type telnet://yoursite.com in the address bar of IE for example and hit "enter" If it works, you will be prompted for your log in information. There are also many Telnet programs often reffered to as "Clients" out there.
MyPagesOnline websites can access telnet through the control panel using SSH (a more secure connection) as well.
So open Telnet, and You'll be asked to enter the username and password that your nice sysadmin assigned you when your account was set up. You should also have a user directory, which is the first place you'll end up when you Telnet to your Host. When you log on, you should get something that looks like this:
    Red Hat Linux Release 7.01 (astro)
    login: username
    Password:
    Red Hat Linux Release 7.01 astro
    Copyright 1998-2001 SomeTown Graphics, Inc. All Rights Reserved.
    Last login: Fri Jan 13 14:04:59 PST 2001 by UNKNOWN@yoursite.com
    You have mail.
    astro[~]%
Although you probably won't see it when you log on, the actual location of your user directory is
astro.yoursite.com[~]%pwd
/usr/people/username
    Basic Commands *See also More Unix Commands*
Here are a few commands to get you started.
Most of these commands have several options that make them even more powerful, but I won't go into those here. You can find them in the Unix Online Manual.
    ls - list files in a directory
syntax: ls [options] [names]
You should get something that looks like this:
astro.yoursite.com[~]% ls
racecar.au     porsche.html     unixclass
apanel.parameters graphics
In this example I have two files (racecar.au and porsche.html) and three directories (unixclass, apanel.parameters, and graphics) in my user directory.
    cd - change directory
syntax: cd [dir]
Here's an example of it what the result might be:
astro.yoursite.com[~]% cd unixclass
astro.yoursite.com[~/unixclass]% ls
one     one.html     two     two.html
astro.yoursite.com[~/unixclass]%
In this case, I've changed from my user directory to the unixclass directory, which holds one directory and two files (if you want to move back one directory use % cd ../).
    mv - moves or renames a file or directory
syntax: mv [options] sources target
Here's what it might look like:
astro.yoursite.com[~/unixclass]% mv one/ two/
astro.yoursite.com[~/unixclass]% ls
one.html     two     two.html
astro.yoursite.com[~/unixclass]% ls two/
one
astro.yoursite.com[~/unixclass]%
I moved the directory one into directory two.
If you use mv to rename a file, it will look something like this:
astro.yoursite.com[~/unixclass]% mv two/ somethingdifferent
astro.yoursite.com[~/unixclass]% ls
one.html     somethingdifferent     two.html
In this example, I've renamed the directory two. Now it is called somethingdifferent.
    rm - removes a file
syntax: rm [options] [files]
Here's an example of removing a file:
astro.yoursite.com[~/unixclass]% rm one.html
astro.yoursite.com[~/unixclass]% ls
somethingdifferent two.html
I removed the file one.html from the directory unixclass.
    rm -ir - removes a directory
Here's what happens when you remove a directory:
astro.yoursite.com[~/unixclass]% rm -ir somethingdifferent/
Directory somethingdifferent/. Remove ? (yes/no)[no] : yes
Directory somethingdifferent//one. Remove ? (yes/no)[no] : yes
astro.yoursite.com[~/unixclass]% ls
two.html
In this example, I've used rm -ir to remove the directory somethingdifferent. Before the directory is removed, I must confirm that I really want it gone. Once I do, somethingdifferent no longer exists. Be very careful with rm, because once files or directories are gone, they're probably gone forever. mkdir - creates new directory
syntax: mkdir [options] directories
Here's how you do it:
astro.yoursite.com[~/unixclass]% mkdir cars
astro.yoursite.com[~/unixclass]% ls
two.html cars
I used mkdir to create the directory cars.
    more - more a file when you just want to read it (not edit it)
    less - less really is more. It does the same thing as more, but it allows you to search through a file (among other things).
    exit - allows you to log out of your host
    date - prints the current date and time
    cal 2000 - prints the 2000 calendar
    whoami - prints who is currently logged on to your terminal
    mail - brings up a simple mail editor
    pwd - tells you where you are; it prints the full pathname of the current directory
    Unix online manual
If you want more details about a particular command, you can check out the Unix main page, which is basically just a manual for Unix. For example, if you want to find out more about ls, type
astro.yoursite.com[~/unixclass]% man ls
And you'll get:
ls(1)
NAME
    ls - list contents of directory
SYNOPSIS
ls [-RadLCxmlnogrtucpFbqisf1AM] [names]
    DESCRIPTION
For each directory argument, ls lists the contents of the directory; for each file argument, ls repeats its name and any other information requested. The output is sorted alphabetically by default.
To quit man, type q.

    Permissions *See also chmod*
As you travel around your host computer, you're going to find there are lots of things you can't do. You won't have the freedom to move and edit files as you did in your user directory.
Remember ls from our basic commands? One of this command's options (ls -l) gives you loads of information about files and directories.
Here's an example:
astro.yoursite.com[~/unixclass]% ls -l
total 20
    drwxrwxr-x     2 andi     staff      512 Jan 5 09:34 one
    -rw-rw-r--       1 andi     staff     4233 Jan 5 09:35 one.html
    drwxrwxr-x     2 andi     staff      512 Jan 5 09:34 two
    -rw-r--r--        1 andi     staff     4233 Jan 5 09:36 two.html
Here we have the contents of the directory unixclass, which contains two directories (one and two) and two files (one.html and two.html). The first column of letters determines who can read, write, or execute your files and directories.
The second list (andi, andi, andi, andi) tells who owns the file. In this case, it's me.
The next column tells which group I was part of when I made these files. To find out what groups you belong to, type groups and your name, like this:
astro.yoursite.com[~/unixclass]% groups andi
infomgr staff prod edit
The fourth column shows the size of the files.
The fifth is the date and time the file was last modified; the sixth is the name of the file.
What the heck is rwx?
As I mentioned before, these letters determine who can read, write, or execute your files. They break down like this:
For files:
    r = read - you can read the file (more or less it)
    w = write - you can write to the file (edit it with VI, Emacs, or Pico)
    x = execute - you can execute the file (run a Perl program)
For directories:
    r = read - you can read the directory
    w = write - you can create, move, rename, or remove files or directories
    x = execute - you can search the directory
Take a look at this ls -l example:
    drwxrwxr-x     2 andi     staff      512 Jan 5 09:34 one/
    -rw-rw-r--       1 andi     staff     4233 Jan 5 09:35 one.html
For every folder and file there are four sets of rwx. In the example above, they are easy to spot because they're set apart by hyphens. The first set shows your permissions, the second is for a group, the third is for anything else (other), and the fourth is for everyone (all).
Now, to make things a little more complicated, each one is referred to by a single letter:
    you = u
    group = g
    other = o
    all = a
To add permissions on a file or directory, you use +, and to remove them, you use -. Let's try it out. We'll remove group write privileges for this file:
    -rw-rw-r--     1 andi     staff     4233 Jan 5 09:35 one.html
To do this, we must also use the chmod command to change the access mode of the file.
astro.yoursite.com[~/unixclass]% chmod g-w one.html
astro.yoursite.com[~/unixclass]% ls -l
total 19
    -rw-r--r--     1 andi     staff     4233 Jan 5 10:59 one.html
To make a program executable for everyone, we'd do this:
astro.yoursite.com[~/unixclass]%ls -l svensprogram.pl
    -rw-rw-r--     1 andi     staff         0 Jan 5 11:02 svensprogram.pl
astro.yoursite.com[~/unixclass]% chmod a+x svensprogram.pl
astro.yoursite.com[~/unixclass]% ls -l
total 19
    -rwxrwxr-x     1 andi     staff         0 Jan 5 11:02 svensprogram.pl
To change who actually owns a file, use the chown command:
astro.yoursite.com[~/unixclass]% ls -l svensprogram.pl
    -rwxrwxr-x     1 andi     staff         0 Jan 5 11:02 svensprogram.pl
astro.yoursite.com[~/unixclass]% chown sven svensprogram.pl
astro.yoursite.com[~/unixclass]% ls -l
total 19
    -rwxrwxr-x     1 sven     staff         0 Jan 5 11:02 svensprogram.pl
To change which group can access the file, use the chgrp command:
astro.yoursite.com[~/unixclass]% ls -l svensprogram.pl
    -rwxrwxr-x     1 sven     staff         0 Jan 5 11:02 svensprogram.pl
astro.yoursite.com[~/unixclass]% chgrp infomgr svensprogram.pl
svensprogram.pl - Not privileged
D'oh! Not privileged. You will see this message many times, but keep at it, it only gets better.

    Text Editors
VI
The most commonly available text editor is vi (pronounced vee-eye), which is recommended for Mac users. You really only need to know a few commands to get started.
To start vi, simply type vi at the command prompt:
astro.yoursite.com[~/unixclass]% vi myfile.html
and you'll be instantly thrown into this crazy-looking environment with a ~ on every line. Don't be afraid. The annoying thing about vi is that you have to tell it when you're adding and deleting text. You can't simply type and delete, you have to use the following commands:
    To add text - hit the esc key and the letter i (for insert)
    To delete text - hit the esc key and the letter x (for delete)
    To delete an entire line - hit the esc key and the letters dd
    To save your file - hit the esc key and type :w and then hit return
    To save and exit vi - hit the esc key and type :wq and hit return
EMACS
Emacs is a very popular editor, but if you're a Macintosh user, it can be bothersome.
PICO
If you're a beginner, pico is probably your best bet. Simply type in
astro.yoursite.com[~/unixclass]%pico myfile.html
and you'll be thrown into the editor. All the commands are listed on the top and bottom of the screen. Be sure to save frequently.

    Telnet Clients
If you don't know if you already have a telnet program, try looking for a program named "telnet," or with "telnet" in its name. If your computer has a "find file" command, try searching for a file named telnet. Windows 95, 98, and NT all include a simple telnet program. If you installed the normal configuration of any of these systems, then the telnet program should already be on your hard drive, commonly stored in C:\WINDOWS\TELNET.EXE (win9x) or C:\WINNT\SYSTEM32\TELNET.EXE (winNT).
These are widely available for users of Windows and OS/2 based operating systems.
CRT (Windows 3.1, 95/98, 2000, NT)
A great Telnet client - one of the best. Shareware.
HyperTerminal Private Edition (Windows 95/98, 2000, NT)
Updates the security features among other things in the built-in HyperTerminal that comes with Windows 95/98. Freeware.
mTelnet (OS/2 & Windows 95/98, 2000, NT)
A great telnet client for OS/2 and Windows 95/98/NT. Freeware
NetTerm (Windows 3.1, 95/98, 2000, NT)
A great Telnet client - highly suggested. Shareware.
ZOC (Zap-O-Comm) (OS/2 & Windows 95/98, 2000, NT)
A great Telnet client from Germany - available in both English and German versions. Versions available for both OS/2 and Windows. Shareware.
More Telnet software can be found at:
Stroud's Consumate Winsock
TUCOWS (The Ultimate Collection Of Winsock Software)
DaveCentral Software Archive

Back to Unix Commands

  - Account Log ins
  Control Panel Sample

  - Getting Started
  Chosing a Password
  FTP
  Index Files
  Quick Html
  Virus Tracker
  Anti Spam Tips

  - Creating Databases
  Moving Databases

  - Htaccess
  Hot Linking
  Password Protection

  - Unix Commands
  Chmod
  Find
  Grep
  Ls
  Regular Expressions
  Telnet / SSH

Our Software Picks

EyesOnTraffic.com

BoxedArt.com


| Copyright | © 2000 MyPagesOnline, All Rights Reserved | Privacy Statement |