Getting Started with Unix (specifically QNX)
Getting started in unix is easy. Here are simple steps to working on a UNIX box.
Logging in
- Logging in: To log in you have 2 prompts. Both fields are case sensitive.
The first prompt will be your username; the second prompt will be your password.
If you remember that this is case sensitive, you are easily on a unix system.
- In QNX log in as root, otherwise you won't have
the necessary privledges to do much.
- root is all-powerful! Don't make a mess or you'll
have to reinstall the QNX OS
- After you log in to QNX's graphic interface, click
the "terminal" button to open a text window for typing unix commands
Directory Commands:
- Tell you what directory you are in: pwd
To find out what directory you are in, use pwd, which stands for print
working directory.
- Changing directories: cd directory
To change your directory simply use cd directory-name.
In UNIX, if you are using a full path use the forward slash. For example,
a user named "joe" may have his home directory in /home/joe. Joe can get to
his default home directory by simply typing cd. If he wants to be in
/tmp, he would type cd /tmp
- / means "top directory"
- . means "this directory"
- .. means "the directory above this
directory" (parent) as in cd ..
- Making directories: mkdir directory
Use the mkdir command to make one or more directories.
- Make yourself a working directory for your
stuff: mkdir /myname
- Removing directories: rmdir directory
Use the rmdir command to remove one or more directories.
File Commands:
Getting Help:
- Getting help: man -k topic
The man command helps you get manual information. Run man -k topic
to find the man page you need. Then run man commandname to get help
with the actual command.
- QNX has no man command - see the html or pdf
online reference docs instead
Compiling and running programs:
- to compile: qcc
yourprogram.c servotogo.c -o executablefilename
- sometimes you need to link in a library like
-lsocket
(no space between -l and socket)
- to run it:
./executablefilename
Random other things:
- use ftp to transfer files to/from other machines
- voyager is the web browser
- ped is the text editor