mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
Added KB about the 'sync' command
This commit is contained in:
37
knowledge base/sync.md
Normal file
37
knowledge base/sync.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Sync
|
||||
|
||||
```sh
|
||||
# Flush all cached file data of the current user only.
|
||||
sync
|
||||
|
||||
# Flush all pending write operations on all disks and mounted filesystems.
|
||||
sudo sync
|
||||
|
||||
# Flush all pending write operations on given files only to disk.
|
||||
sync path/to/first/file path/to/second/file
|
||||
|
||||
# Flush all pending write operations on all files in a directory, recursively.
|
||||
sync path/to/directory
|
||||
|
||||
# Flush only the file data and its minimal metadata to disk.
|
||||
sync -d path/to/file
|
||||
|
||||
# Flush all pending write operations on only the filesystem on mounted partition
|
||||
# '/dev/sdc1'.
|
||||
sudo sync /dev/sdc1
|
||||
|
||||
# Flush all pending write operations on all mounted filesystem from '/dev/sdb'.
|
||||
sudo sync /dev/sdb
|
||||
|
||||
# Flush all pensing write operations on the entire file system which contains
|
||||
# '/var/log/syslog'.
|
||||
sudo sync -f /var/log/syslog
|
||||
```
|
||||
|
||||
## Sources
|
||||
|
||||
- [cheat.sh]
|
||||
- [Linux sync command]
|
||||
|
||||
[cheat.sh]: https://cheat.sh/sync
|
||||
[linux sync command]: https://www.computerhope.com/unix/sync.htm
|
||||
Reference in New Issue
Block a user