mkdir
command. Use cd
to change to that directory:
[taylorm@jazz510 ~]$ mkdir tutorial
[taylorm@jazz510 ~]$ cd tutorial
[taylorm@jazz510 ~/tutorial]$
cd ..
will bring you up one level of the directory structure:
[taylorm@jazz510 ~/tutorial]$ cd ..
[taylorm@jazz510 ~]$
cd
which will bring you to your home directory (and thus is equivalent to cd ~
, and cd -
, which will bring you back to the previous directory you were in.touch
command:
[taylorm@jazz510 ~]$ touch test.txt
cp
command:
[taylorm@jazz510 ~]$ cp test.txt tutorial
cp * tutorial
or cp *.c tutorial
.ls
(list stuff).
rm
removes (deletes) a filemv
moves a file (ie. cut/paste instead of copy/paste)man
displays documentation for a command (manual)pwd
prints your current path (present working directory) xterm
opens a new terminal windowfirefox
opens a web browser&
to a command to run it in the backgroundfg
brings a program running in the background to the foregroundvi
, pico
, or joe
on Unix; or Notepad on Windows; or TextWrangler on Macs; and others).
To run Emacs, type emacs
at a command prompt:
emacs helloWorld.c &
helloWorld.c
which will either open
that file for editing if it exists, or create it otherwise.
When editing
this file you may notice some of that some text becomes automatically
colored: this is syntactic highlighting to help you
distinguish items such as keywords, variables, strings, and comments.
Some basic Emacs editing commands (C-
means "while
holding the Ctrl-key"):
C-x C-s
Save the current fileC-x C-f
Open a file, or create a new file it if
doesn't existC-k
Cut a line, add it to the clipboardC-y
Paste the contents of the clipboardC-_
UndoC-g
Abort a half-entered commandYou can also copy and paste using just the mouse. Using the left button, select a region of text to copy. Click the middle button to paste.
#include <stdio.h>
main()
{
printf("Hello World");
}
g++ helloWorld.c -o helloWorld
and then run your program:
./helloWorld