Làm quen với một số lệnh

3 287 0
Làm quen với một số lệnh

Đang tải... (xem toàn văn)

Thông tin tài liệu

1 Làm quen với số lệnh • Lệnh tạo thư mục: mkdir /home/hoanguyen/Desktop/congtoan • Đọc thư mục: • Tạo file rỗng : touch /home/hoanguyen/desktop/congtoan/taorong ls /home/hoanguyen/desktop • Tạo file nano: nano /home/hoanguyen/desktop/congtoan/file • Đọc file nano: cat • /home/hoanguyen/desktop/congtoan/file Di chuyển thư mục: mv /home/hoanguyen/desktop/congtoan/taorong /home/hoanguyen/desktop Bài 2: Thực viết chương trình chép file a sang thành file b #include #include int main() { int a,b; char block[1024]; int a(const char *path, int oflags, mode_t mode); a=open(“file.a”,O.RDONLY); b=open(file.b,O.WRONLY|O.CREAT, S_IRUSR|S_IWUSR); while((nread=read(a,block,sizeof(block))>0) write(out,block,nread); exit(); } Bài tập : File system Windows

Ngày đăng: 22/04/2016, 21:55

Tài liệu cùng người dùng

Tài liệu liên quan