Unix
Unix C++, Cygwin Windows. Devel gcc: C, C++, Fortran compilers Keep.
Windows. .
man
.
.
man cp
ls
. -l .
cd
.
.
cd - .
cd / - .
cd /usr/local/bin - .
cd .. / - .
pwd
.
cp
.
.
cp file1 file2
cp file1 /archive
cp file1 /archive/newfile
cp file1 file2 /archive - file1, file2 /archive.
cp -R dir1 /dir2 - : dir1 dir2, dir2 , dir1.
mkdir
.
.
mkdir dir1
mv
.
.
mv file1 file2 - .
mv /dir1 /dir2 - . dir2 , .
mv file1 /dir2 - .
mv file1 /dir2/abc - abc , file1 abc. abc , file1 dir2 abc.
rm
.
.
rm file1 - .
rm file1 file2 - .
rm -R dir1 - dir1 , .
rmdir
. . -p .
touch
: .
.
touch file1
find
.
.
find. nane"lost*" - , lost. , . , /.
. KOI-8.
, Unix- vi. vi , . , vi .
. , . , : a, i o.
|
|
a append (). , .
i insert (). , .
o open (). , , , . O, .
Esc.
D - .
dd - .
dd - , .
r , r.
x - .
~ - .
J - .
: w - .
: w _ - .
: q - . , .
: q! - , . .
: e _ .
y. y.
yw - .
y$- .
yy - .
yy - , .
d.
p.
3 C++
g++ .
#include <stdio.h>
int main()
{
printf ("Hello");
}
a.cpp.
g++ a.cpp -o a.out.
o .
./a.out.
Hello.
Unix
Unix [2]:
int open (const char* path, int acces_mode, int permission) - fcntl.h, path , permission 0.
: O_RDONLY , O_WRONLY , O_RDWR .
, O_CREAT , .
-1 .
int creat (const char* path, int acces_mode) .
long read (int fdesc, void* buf, int size) .
unistd.h, fdesc , buf , , size , .
|
|
.
long write (int fdesc, const void* buf, int size) .
- unistd.h, read.
, .
long lseek (int fdesc, long pos, int whence) - .
- unistd.h, pos , . whence :
SEEK_CUR ;
SEEK_SET ;
SEEK_END .
.