sync

同步磁盘上的数据和内存

语法

  sync

将内存中缓冲的数据写入磁盘。这可以包括(但不限于)修改后的超块、修改后的inode和延迟读写.
这必须由内核实现;“sync”程序只执行“sync”系统调用。内核将数据保存在内存中,以避免执行(相对缓慢的)磁盘读写操作。这提高了性能,但如果计算机崩溃,数据可能丢失或文件系统因此损坏。“sync”确保内存中的所有内容都写入磁盘

除了一个单独的参数外,任何参数都被忽略 --help or --version

sync 命令实例:

linux命令:sync; echo 3 > /proc/sys/vm/drop_caches /proc/sys/vm/drop_caches > 3 echo sync; sync; echo 3 > /proc/sys/vm/drop_cachesrootopen.com
linux命令:sync; echo 3 > /proc/sys/vm/drop_caches /proc/sys/vm/drop_caches > 3 echo sync; sync; echo 3 > /proc/sys/vm/drop_cachesrootopen.com
2018-01-04 15:59:48

linux命令:sync; time `dd if=/dev/zero of=bigfile bs=1M count=2048 && sync` sync` && count=2048 bs=1M of=bigfile if=/dev/zero `dd time sync; sync; time `dd if=/dev/zero of=bigfile bs=1M count=2048 && sync`rootopen.com
linux命令:sync; time `dd if=/dev/zero of=bigfile bs=1M count=2048 && sync` sync` && count=2048 bs=1M of=bigfile if=/dev/zero `dd time sync; sync; time `dd if=/dev/zero of=bigfile bs=1M count=2048 && sync`rootopen.com
2018-02-22 22:44:48

linux命令:sync; time `dd if=/dev/cciss/c0d1p1 of=/dev/null bs=1M count=10240` count=10240` bs=1M of=/dev/null if=/dev/cciss/c0d1p1 `dd time sync; sync; time `dd if=/dev/cciss/c0d1p1 of=/dev/null bs=1M count=10240`rootopen.com
linux命令:sync; time `dd if=/dev/cciss/c0d1p1 of=/dev/null bs=1M count=10240` count=10240` bs=1M of=/dev/null if=/dev/cciss/c0d1p1 `dd time sync; sync; time `dd if=/dev/cciss/c0d1p1 of=/dev/null bs=1M count=10240`rootopen.com
2018-01-26 12:26:48

linux命令:sync; echo 3 > /proc/sys/vm/drop_caches /proc/sys/vm/drop_caches > 3 echo sync; sync; echo 3 > /proc/sys/vm/drop_cachesrootopen.com
linux命令:sync; echo 3 > /proc/sys/vm/drop_caches /proc/sys/vm/drop_caches > 3 echo sync; sync; echo 3 > /proc/sys/vm/drop_cachesrootopen.com
2018-02-27 10:11:48

linux命令:sync && echo 3 | sudo tee /proc/sys/vm/drop_caches /proc/sys/vm/drop_caches tee sudo | 3 echo && sync sync && echo 3 | sudo tee /proc/sys/vm/drop_cachesrootopen.com
linux命令:sync && echo 3 | sudo tee /proc/sys/vm/drop_caches /proc/sys/vm/drop_caches tee sudo | 3 echo && sync sync && echo 3 | sudo tee /proc/sys/vm/drop_cachesrootopen.com
2018-04-22 23:11:48

linux命令:sync ; /sbin/sysctl -w vm.drop_caches=3 ; sync ; sleep 2 ; /sbin/sysctl -w vm.drop_caches=0 ;/sbin/swapoff -a ; sleep 2 ;/sbin/swapon -a -a ;/sbin/swapon 2 sleep ; -a ;/sbin/swapoff vm.drop_caches=0 -w /sbin/sysctl ; 2 sleep ; sync ; vm.drop_caches=3 -w /sbin/sysctl ; sync sync ; /sbin/sysctl -w vm.drop_caches=3 ; sync ; sleep 2 ; /sbin/sysctl -w vm.drop_caches=0 ;/sbin/swapoff -a ; sleep 2 ;/sbin/swapon -arootopen.com
linux命令:sync ; /sbin/sysctl -w vm.drop_caches=3 ; sync ; sleep 2 ; /sbin/sysctl -w vm.drop_caches=0 ;/sbin/swapoff -a ; sleep 2 ;/sbin/swapon -a -a ;/sbin/swapon 2 sleep ; -a ;/sbin/swapoff vm.drop_caches=0 -w /sbin/sysctl ; 2 sleep ; sync ; vm.drop_caches=3 -w /sbin/sysctl ; sync sync ; /sbin/sysctl -w vm.drop_caches=3 ; sync ; sleep 2 ; /sbin/sysctl -w vm.drop_caches=0 ;/sbin/swapoff -a ; sleep 2 ;/sbin/swapon -arootopen.com
2018-06-08 08:52:48

linux命令:synclient TouchPadOff=1 TouchPadOff=1 synclient synclient TouchPadOff=1rootopen.com
linux命令:synclient TouchPadOff=1 TouchPadOff=1 synclient synclient TouchPadOff=1rootopen.com
2018-01-09 17:11:48

linux命令:synclient TouchPadOff=0 TouchPadOff=0 synclient synclient TouchPadOff=0rootopen.com
linux命令:synclient TouchPadOff=0 TouchPadOff=0 synclient synclient TouchPadOff=0rootopen.com
2018-04-21 16:01:48

linux命令:synclient TapButton1=1 TapButton2=2 TapButton3=3 TapButton3=3 TapButton2=2 TapButton1=1 synclient synclient TapButton1=1 TapButton2=2 TapButton3=3rootopen.com
linux命令:synclient TapButton1=1 TapButton2=2 TapButton3=3 TapButton3=3 TapButton2=2 TapButton1=1 synclient synclient TapButton1=1 TapButton2=2 TapButton3=3rootopen.com
2018-03-21 01:39:48

linux命令:synclient TouchpadOff=$(synclient -l | grep -q 'TouchpadOff.*1'; echo $?) $?) echo 'TouchpadOff.*1'; -q grep | -l TouchpadOff=$(synclient synclient synclient TouchpadOff=$(synclient -l | grep -q 'TouchpadOff.*1'; echo $?)rootopen.com
linux命令:synclient TouchpadOff=$(synclient -l | grep -q 'TouchpadOff.*1'; echo $?) $?) echo 'TouchpadOff.*1'; -q grep | -l TouchpadOff=$(synclient synclient synclient TouchpadOff=$(synclient -l | grep -q 'TouchpadOff.*1'; echo $?)rootopen.com
2018-02-15 23:24:48

Linux的Bash命令行(A-Z排序)