什么是CygWin
cygwin常用指令
以下参考:
cygwin常用指令
基本操作命令: ls ls –a ls –l ls --color=never *.so > obj 其中ls -al文件的各字段解释 [ls -al文件的字段解释](https://www.cnblogs.com/easonjim/p/6525280.html) ---------------------------------------------------------------------- cd dir cd / cd .. cd ../.. cd ~ ---------------------------------------------------------------------- rm file rm -fr dir ---------------------------------------------------------------------- cp source target cp /root/source . cp –av soure_dir target_dir cp –fr source_dir target_dir ---------------------------------------------------------------------- mv source target ---------------------------------------------------------------------- diff dir1 dir2 diff file1 file2 comm file1 file2 ---------------------------------------------------------------------- echo message echo "message message2" cat: cat file cat file | more more ---------------------------------------------------------------------- export LC_ALL=zh_CN.GB2312 export DISPLAY=0:0 date date -s 20:30:30 date -s 2002-3-5 clock –r clock –w ---------------------------------------------------------------------- du du -sm /root find -name /path file grep -ir “chars” [sed的使用](https://cloud.tencent.com/developer/article/1619897) [find的使用](https://www.cnblogs.com/greamrod/p/12743107.html) ---------------------------------------------------------------------- vi file vi 原基本使用及命令: 输入命令的方式为先按ctrl+c, 然后输入:x(退出),:x!(退出并保存) :w(写入文件),:w!(不询问方式写入文件), :r file(读文件file) ,:%s/oldchars/newchars/g(将所有字串oldchars换成newchars) 这一类的命令进行操作 ---------------------------------------------------------------------- man ls man ls | grep color ---------------------------------------------------------------------- reboot halt init 0 init 1 init 6 ---------------------------------------------------------------------- 扩展命令 ---------------------------------------------------------------------- ---------------------------------------------------------------------- tar xfzv file.tgz tar xfzv file.tgz -C target_path tar cfzv file.tgz source_path tar c directory > directory.tar gzip directory.tar gunzip directory.tar.gz tar xf directory.tar ---------------------------------------------------------------------- uname uname -r uname -a ---------------------------------------------------------------------- strings file 显示file文件中的ASCII字符内容 ---------------------------------------------------------------------- rpm -ihv program.rpm rpm2targz program.rpm program.tgz ---------------------------------------------------------------------- mknod /dev/hda1 b 3 1 mknod /dev/tty1 c 4 1 ---------------------------------------------------------------------- touch /tmp/running ---------------------------------------------------------------------- sleep 9 ---------------------------------------------------------------------- fdisk /dev/hda cfdisk /dev/hda mount -t ext2 /dev/hda1 /mnt df mount -t iso9660 /dev/cdrom /mnt/cdrom mount-t smb //192.168.1.5/sharedir /mnt -o username=tomlinux,password=tomlinux mount -t nfs 192.168.1.1:/sharedir /mnt umount /mnt umount /dev/hda1 sync e2fsck /dev/hda1 e2fsck -p /dev/hda1 e2fsck -y /dev/hda1 e2fsck -c /dev/hda1 mkfs /dev/hda1 mkfs.minix /dev/hda1 mfks /dev/hda9 swapon /dev/hda9 swapoff /dev/hda9 ---------------------------------------------------------------------- gcc hello.c gcc hello.c -o hello gcc -static -o hello hello.c ldd program objcopy -S program gcc -o sum –Wall –pedantic –ansi –g sum.c gcc -Wall -pedantic -ansi -g –shared -o ${HOME} /lib/f.dll a.c b.c d.c gcc -o UDPxxx –Wall –pedantic –ansi –g UDPxxx.c -L${HOME} /lib -lf.dll ---------------------------------------------------------------------- strace netscape ps ps –ef kill -9 500 killall -9 netscape top free time program ---------------------------------------------------------------------- ifconfig eth0 192.168.1.1 netmask 255.255.255.0 ifconfig eth0:1 192.168.1.2 ifconfig eth0:x 192.168.1.x ifconfig down eth1 hostname -F tomlinux.com route route add default gw 192.168.1.1 metric 1 route del default dhcp dhclient ping 163.com ping 202.96.128.68 ---------------------------------------------------------------------- probe rtl8139 lsmod insmod rtl8139.o insmod sb.o io=0x280 irq=7 dma=3 dma16=7 mpu_io=330 rmmod rtl8139 gpm -k gpm -t ps2 ---------------------------------------------------------------------- telnet 192.168.1.1 telnet iserver.com ftp 192.168.1.1 或 ftp iserver.com