This file contains a few basic UNIX commands to enable you to create directories and files, move around to find specific files, and run a few simple commands.
passwdyppasswd or
something different, so ask around)
manman chmod |
read about the UNIX chmod command |
man man |
read about the man command |
man fopen |
read about the Standard C library fopen command |
/home/www/CS400/index.html is an
absolute pathname.
Absolute pathnames always start with / (which is
the name of the root directory), with one exception:
a tilde in front of a username represents the absolute pathname
of that user's home directory. For example,
~abrady/ProgLang is an absolute name because the
system will expand ~abrady to /home/abrady.
myfile.c |
file in current directory |
progLang/myfile.c |
file in progLang directory, which is a subdirectory
of the current directory |
../myfile.c |
file in parent directory (.. means directory above
current directory) |
../progLang/myfile.c |
file in progLang directory, which is at same level
in hierarchy as the current directory (it is a child of my
parent directory) |
pwdcd dirnamedirname, e.g., cd ProgLang
or cd ../ProgLang or cd ~abrady/ProgLang
mkdir dirnamedirname
rmdir dirnamedirname (must be empty)
ls.profile, which are also
known as hidden files)
ls -aFls *.html *.c.html or .c
mv oldname newnameoldname to newname
mv oldname ProgLang/newnameoldname to directory ProgLang,
giving it name newname
cp oldfile newfileoldfile, calling the copy
newfile
cp oldfile ProgLang/newfileoldfile; put in the
ProgLang directory
rm filenamerm *
cat filenamecat = concatenate)
cat f1 f2 >f3f1 and f2, calling combination f3
more filenamefilename to screen one page at a time (use
spacebar to go to next page; b to back up)
lpr filenamepr filename on some systems)
vi filenamefilename (but learning vi is another lesson!)
emacs filenamefilename (but learning emacs is another lesson!)
grep string *.c.c files contain string, e.g.,
grep fcn3 *.c
cc, CCgcc, g++gcc -Wall -Wextra -Wpedantic -Wformat -Wshadow
-Wredundant-decls -Wstrict-prototypes-W options generate warnings about questionable
constructions; these sometimes indicate programmer confusion or actual
logic errors. (You can also use -Wtraditional to catch
some non-traditional C constructs that GCC allows, or
-Wmissing-prototypes to find functions that do not have
prototypes in header files.)
cflow, dbx, gdb
man page for details):chmodheadtailbanner wordcalcal 9 1752
cleardateechoecho Hi! or echo $PATH
exit, logoutwcwc myfile or
wc -l myfile
who
man
page for details):type commandcommand? (could be a command or an
alias) e.g., type diff or type l
whereis commandwhereis man
grepgrep pat myfile
diffdiff old new
sortfindftpsshscpssh
pskillkill -9 14238