AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1042292
Accepted
Antonio
Antonio
Asked: 2018-06-01 03:59:42 +0800 CST2018-06-01 03:59:42 +0800 CST 2018-06-01 03:59:42 +0800 CST

不同版本的 `sync` 工具

  • 772

关于该工具有两个man页面:sync

(1) http://man7.org/linux/man-pages/man1/sync.1.html

NAME         

       sync - Synchronize cached writes to persistent storage

SYNOPSIS         top

       sync [OPTION] [FILE]...

DESCRIPTION         top

       Synchronize cached writes to persistent storage

       If one or more files are specified, sync only them, or their
       containing file systems.

       -d, --data
              sync only file data, no unneeded metadata

       -f, --file-system
              sync the file systems that contain the files

       --help display this help and exit

       --version
              output version information and exit

(2) http://manpages.ubuntu.com/manpages/trusty/en/man8/sync.8.html

NAME
       sync - synchronize data on disk with memory

SYNOPSIS
       sync [--help] [--version]

DESCRIPTION
       sync  writes any data buffered in memory out to disk.  This can include
       (but is not limited to)  modified  superblocks,  modified  inodes,  and
       delayed  reads and writes.  This must be implemented by the kernel; The
       sync program does nothing but exercise the sync(2) system call.

       The kernel keeps data in memory to avoid doing (relatively  slow)  disk
       reads  and  writes.   This  improves  performance,  but if the computer
       crashes, data may be lost or the  filesystem  corrupted  as  a  result.
       sync ensures that everything in memory is written to disk.

       sync  should  be  called  before  the processor is halted in an unusual
       manner (e.g., before causing a kernel panic when debugging  new  kernel
       code).    In   general,  the  processor  should  be  halted  using  the
       shutdown(8) or reboot(8) or halt(8) commands, which will attempt to put
       the  system  in  a  quiescent  state  before calling sync(2).  (Various
       implementations of these commands exist; consult your documentation; on
       some systems one should not call reboot(8) and halt(8) directly.)

第一个来自coreutils,第二个来自fileutils。我尝试sync从 Ubuntu 14.04 中编译该工具,coreutils 8.29但得到的结果与sync(2) 相同。

如何sync在 Ubuntu 14.04 上获得具有功能 (1) 的工具?

filesystem sync coreutils
  • 1 1 个回答
  • 72 Views

1 个回答

  • Voted
  1. Best Answer
    muru
    2018-06-01T05:03:19+08:002018-06-01T05:03:19+08:00

    sync在 Ubuntu 中来自coreutils. 检查它来自的包。中sync描述的sync(8)是一个古董,可能从未在 Ubuntu 上作为以下内容的一部分提供fileutils:

    This page describes sync as found in the fileutils-4.0  package;  other
    versions may differ slightly.
    

    (fileutils-4.0从 1998 年开始。)

    sync(1)您应该查看的手册页是: 14.04、18.04。请注意 18.04 的联机帮助页与 man7.org 联机帮助页是一样的。

    如果您sync从 coreutils 8.29 编译并且没有获得这些选项,那么您做错了,因为在 Ubuntu 16.04 上,使用synccoreutils 8.25 的默认值,我确实获得了这些选项:

    ~ sync --help
    Usage: sync [OPTION] [FILE]...
    Synchronize cached writes to persistent storage
    
    If one or more files are specified, sync only them,
    or their containing file systems.
    
      -d, --data             sync only file data, no unneeded metadata
      -f, --file-system      sync the file systems that contain the files
          --help     display this help and exit
          --version  output version information and exit
    
    GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
    Full documentation at: <http://www.gnu.org/software/coreutils/sync>
    or available locally via: info '(coreutils) sync invocation'
    ~ sync --version
    sync (GNU coreutils) 8.25
    Copyright (C) 2016 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
    Written by Jim Meyering and Giuseppe Scrivano.
    
    • 3

相关问题

  • 如何使文件夹与外部 USB 硬盘保持同步?

  • 为什么 Ubuntu 不再将文件大小单位测量为字节、兆字节、千兆字节等?

  • 如何与我的 iPhone 3G 同步音乐?[关闭]

  • 如何避免启动时出现“S to Skip”消息?

  • 保持多个工作站同步

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve