{"id":370055,"date":"2024-05-21T04:17:00","date_gmt":"2024-05-21T04:17:00","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=370055"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T04:17:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=370055","title":{"rendered":"<span>\u041d\u0430\u0440\u0443\u0448\u0430\u0435\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c *NIX<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/a6\/ec\/xf\/a6ecxfdy9rwhuyu_yqj0osukkwu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/a6\/ec\/xf\/a6ecxfdy9rwhuyu_yqj0osukkwu.png\"\/><\/div>\n<p>  \u0412\u0441\u0435 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u0440\u0443\u0433 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442: \u043d\u0430 \u0444\u043b\u0435\u0448\u043a\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0431\u044b\u043b\u043e \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c. \u0420\u0430\u0437\u0433\u0430\u0434\u043a\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0432\u043e \u0432\u0441\u0435\u043c \u0432\u0438\u043d\u043e\u0432\u0430\u0442 \u0444\u043e\u0442\u043e\u0430\u043f\u043f\u0430\u0440\u0430\u0442, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u0430\u0434\u0440\u0430.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0435\u0446\u0435\u0434\u0435\u043d\u0442 \u043f\u043e\u0431\u0443\u0434\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043e\u0431\u043c\u0430\u043d\u0443\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0438 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u0435\u0442\u044b \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c? \u0418 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0442\u043e \u043a\u0430\u043a \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u041e\u0421?<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0432\u0430\u0441 \u0436\u0434\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044d\u043a\u0441\u043a\u0443\u0440\u0441 \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u043d\u0430\u0431\u043e\u0440 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432.<a name=\"habracut\"><\/a>  <\/p>\n<hr\/>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b.<\/p>\n<ul>\n<li>\u0414\u043b\u0438\u043d\u0430 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0444\u0430\u0439\u043b\u0435 \u043d\u0435 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0430.<\/li>\n<li>\u0414\u043b\u0438\u043d\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430. \u0427\u0443\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043d\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0430: \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430, \u0442\u043e\u0436\u0435 \u043d\u0435 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u0435\u043d.<\/li>\n<li>\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0432 \u043f\u0443\u0442\u0438, \u0441\u0438\u043c\u0432\u043e\u043b \u00ab\/\u00bb, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f.<\/li>\n<li>\u041d\u0443\u043b\u044c-\u0441\u0438\u043c\u0432\u043e\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u043e\u043a\u0438.<\/li>\n<li>\u0412\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0432\u0443\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c.<\/li>\n<\/ul>\n<p>  \u041f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u2014 \u043d\u0435 \u0442\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u043b\u0435\u0439 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u0435\u043c. \u0415\u0441\u043b\u0438 \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u0442 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c. \u0410 \u0432\u043e\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0438\u043c\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c\u2026 \u0423\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0435\u0441\u044c?<\/p>\n<p>  <a href=\"https:\/\/selectel.ru\/services\/cloud\/servers\/?utm_source=habr.com&amp;utm_medium=referral&amp;utm_campaign=cloud_article_nix_070324_banner_001_ord\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/nb\/lo\/t_\/nblot_ve1t3hcw5bluwc_-did08.png\" data-src=\"https:\/\/habrastorage.org\/webt\/nb\/lo\/t_\/nblot_ve1t3hcw5bluwc_-did08.png\"\/><\/div>\n<p><\/a><br \/>  <a name=\"1\"><\/a><font color=\"#EB4247\"><\/p>\n<h2>\u0412\u0441\u0435 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b<\/h2>\n<p><\/font><br \/>  \u0412 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c *NIX \u0435\u0441\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u0438\u0434\u0435\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u00abEverything is a file\u00bb, \u0442\u043e \u0435\u0441\u0442\u044c \u00ab\u0432\u0441\u0435 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u00bb. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u0438\u043d \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u042d\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a.<\/p>\n<ul>\n<li>open(2) \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u044c.<\/li>\n<li>read(2) \u2014 \u0447\u0442\u0435\u043d\u0438\u0435 \u0431\u0430\u0439\u0442\u043e\u0432 \u0438\u0437 \u0440\u0435\u0441\u0443\u0440\u0441\u0430.<\/li>\n<li>write(2) \u2014 \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 \u0440\u0435\u0441\u0443\u0440\u0441.<\/li>\n<li>close(2) \u2014 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<blockquote><p>\u041f\u0438\u043e\u043d\u0435\u0440\u044b \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u044b\u0445 \u043d\u0430\u0443\u043a \u2014 \u044d\u0442\u043e \u0443\u043c\u043d\u044b\u0435 \u043b\u044e\u0434\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0448\u0430\u043b\u0438 \u043d\u0435\u0432\u0438\u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u042d\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u0438\u0435, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f creat(2), \u0430 \u043d\u0435 create(2)? \u041c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u044b \u0438 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e \u0442\u0435\u043c\u0430\u043c \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u2014 \u0432 \u043c\u043e\u0435\u043c <a href=\"https:\/\/t.me\/%2BVzpLr5pam-MxODEy\">Telegram-\u043a\u0430\u043d\u0430\u043b\u0435<\/a>.<\/p><\/blockquote>\n<p>  \u042d\u0442\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e \u0432\u0441\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<ul>\n<li>\u041a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u043d\u0430 \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u0435.<\/li>\n<li>\u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0431\u0430\u0439\u0442\u043e\u0432\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043d\u0430 \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u0435 (\u0444\u0430\u0439\u043b\u044b \/dev\/sd* \u0438 \/dev\/nvme*).<\/li>\n<li>\u041a \u0432\u043d\u0435\u0448\u043d\u0435\u043c\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443: \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0443, \u043c\u044b\u0448\u043a\u0435, \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0435 (\u0444\u0430\u0439\u043b\u044b \/dev\/input\/, \/dev\/mouse*).<\/li>\n<li>\u0414\u0430\u0436\u0435 \u0441\u043e\u043a\u0435\u0442\u044b \u0411\u0435\u0440\u043a\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u0422\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 socket(2), \u0430 \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 open(2).<\/li>\n<\/ul>\n<p>  \u041d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0441\u044e \u0433\u043b\u0443\u0431\u0438\u043d\u0443 \u044d\u0442\u043e\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438, \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u0441\u0430\u043c\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e. \u041a\u0430\u0442\u0430\u043b\u043e\u0433 \u2014 \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0444\u0430\u0439\u043b. \u0414\u0430, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 cat. \u041d\u043e \u043d\u0435 \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<pre><code class=\"bash\">root@ubuntu-2204:~# cat \/tmp cat: \/tmp: Is a directory root@ubuntu-2204:~# <\/code><\/pre>\n<p>  \u0412 Linux \u044d\u0442\u043e\u0442 \u0444\u043e\u043a\u0443\u0441 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 \u0432\u043e\u0442 \u0432\u043e FreeBSD \u0434\u043e 12 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433.<\/p>\n<pre><code class=\"bash\">root@freebsd-11:~ # cat \/tmp X...X .X11-unix&lt;X .XIM-unix&lt;X  .ICE-unix&lt;X PERL5_DEFAULT\\local.UgDju9Hno\\dmail.RsZJCJr4Yt6\\Hmail.RsygwgsVOYB4\\(write-422194.oZxxhash-737aeb.oZbench-fb2faf.lz4io-a10809.olz4cli-b2a9d6.o root@freebsd:~ # <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043f\u0435\u0447\u0430\u0442\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0438\u043c\u0435\u043d \u0444\u0430\u0439\u043b\u043e\u0432, \u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <i>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e<\/i> \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430. \u041a\u0430\u0442\u0430\u043b\u043e\u0433 \u2014 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 <a href=\"https:\/\/man.freebsd.org\/cgi\/man.cgi?query=dirent%26apropos=0%26sektion=0%26manpath=FreeBSD%2B11.0-RELEASE%26arch=default%26format=html\">dirent<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"plaintext\">struct dirent {    __uint32_t d_fileno;               \/* file number of entry *\/    __uint16_t d_reclen;               \/* length of this record        *\/    __uint8_t  d_type;               \/* file type, see below *\/    __uint8_t  d_namlen;               \/* length of string in d_name *\/ #ifdef _POSIX_SOURCE    char    d_name[255 + 1];               \/* name must be no longer than this *\/ #else #define MAXNAMLEN       255    char    d_name[MAXNAMLEN        + 1];  \/* name must be no longer than this *\/ #endif }; <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b dirent: <a href=\"https:\/\/man.freebsd.org\/cgi\/man.cgi?query=readdir%26apropos=0%26sektion=0%26manpath=FreeBSD%2B11.0-RELEASE%26arch=default%26format=html\">opendir(3), readdir(3) \u0438 closedir(3)<\/a>. \u041d\u043e \u0432 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0446\u0435\u043b\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u043d\u0438\u0445:<\/p>\n<pre><code class=\"plaintext\">#include &lt;stdio.h> \/\/ printf(3) #include &lt;sys\/types.h> \/\/ open(2) #include &lt;sys\/stat.h> \/\/ open(2) #include &lt;fcntl.h>  \/\/ open(2) #include &lt;errno.h>  \/\/ errno #include &lt;string.h> \/\/ strerror(3) #include &lt;unistd.h> \/\/ close(2) #include &lt;dirent.h> #define BUF_SIZE 4096 int main(int argc, char* argv[]) {         \/\/ \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435. \u0411\u0435\u0437 \u0444\u043b\u0430\u0433\u0430 O_DIRECTORY \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430.         int fd = open(argv[1], O_DIRECTORY | O_RDONLY);         if(fd &lt; 0) {                 printf(\"Cannot open %s: %s\\n\", argv[1], strerror(errno));                 return 1;         }         unsigned char buf[BUF_SIZE];         while(1) {                 struct dirent dir;                 \/* \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044e *\/                 ssize_t count = read(fd, &amp;dir.d_fileno, sizeof(dir.d_fileno));                 \/* \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 *\/                 if(count &lt; 0) {                         printf(\"Read error: %s\\n\",  strerror(errno));                         return 2;                 }                 if(count == 0) break;                 count += read(fd, &amp;dir.d_reclen, sizeof(dir.d_reclen));                 count += read(fd, &amp;dir.d_type, sizeof(dir.d_type));                 count += read(fd, &amp;dir.d_namlen, sizeof(dir.d_namlen));                 count += read(fd, &amp;dir.d_name, dir.d_reclen - count);                 dir.d_name[dir.d_namlen] = '\\0';                 printf(\"Entry:\\n\");                 printf(\"\\td_fileno: %u\\n\", dir.d_fileno);                 printf(\"\\td_reclen: %u (read: %zd)\\n\", dir.d_reclen, count);                 printf(\"\\td_type: %u\\n\", dir.d_type);                 printf(\"\\td_namelen: %u\\n\", dir.d_namlen);                 printf(\"\\td_name: %s\\n\", dir.d_name);         }         close(fd);         return 0; } <\/code><\/pre>\n<p>  \u0414\u0430, \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code class=\"bash\">root@freebsd:~ # .\/a.out \/tmp Entry:         d_fileno: 11556864         d_reclen: 12 (read: 12)         d_type: 4         d_namelen: 1         d_name: . Entry:         d_fileno: 2         d_reclen: 12 (read: 12)         d_type: 4         d_namelen: 2         d_name: .. Entry:         d_fileno: 11556869         d_reclen: 20 (read: 20)         d_type: 4         d_namelen: 9         d_name: .X11-unix Entry:         d_fileno: 11556870         d_reclen: 20 (read: 20)         d_type: 4         d_namelen: 9         d_name: .XIM-unix Entry:         d_fileno: 11556871         d_reclen: 20 (read: 20)         d_type: 4         d_namelen: 9         d_name: .ICE-unix Entry:         d_fileno: 11556872         d_reclen: 20 (read: 20)         d_type: 4         d_namelen: 10         d_name: .font-unix Entry:         d_fileno: 11556915         d_reclen: 408 (read: 408)         d_type: 8         d_namelen: 13         d_name: PERL5_DEFAULT <\/code><\/pre>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c\u0438 \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u043e \u0437\u0430\u043f\u0438\u0441\u044c. \u041d\u043e \u0440\u0430\u0437 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0442\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043b\u043e\u043c\u0430\u0442\u044c.<\/p>\n<pre><code class=\"plaintext\">#include &lt;stdio.h> \/\/ printf(3) #include &lt;sys\/types.h> \/\/ open(2) #include &lt;sys\/stat.h> \/\/ open(2) #include &lt;fcntl.h>  \/\/ open(2) #include &lt;errno.h>  \/\/ errno #include &lt;string.h> \/\/ strerror(3) #include &lt;unistd.h> \/\/ close(2) int main(int argc, char* argv[]) {         \/* \u0421\u043f\u0435\u0440\u0432\u0430 \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u0432\u0434\u0440\u0443\u0433 \u043f\u0440\u043e\u043a\u0430\u0442\u0438\u0442 *\/         int fd = open(argv[1], O_DIRECTORY | O_WRONLY);         if(fd &lt; 0) {                 printf(\"Cannot open for write %s: %s\\n\", argv[1], strerror(errno));                 return 1;         }         return 0; } <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c.<\/p>\n<pre><code class=\"bash\">root@freebsd:~ # cc write.c  root@freebsd:~ # .\/a.out \/tmp Cannot open for write \/tmp: Is a directory root@freebsd:~ # <\/code><\/pre>\n<p>  \u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u042f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430 FreeBSD 11, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0448\u043b\u0430 \u0432 2016 \u0433\u043e\u0434\u0443. \u041c\u043e\u0436\u0435\u0442, \u0432 \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u043c UNIX \u043d\u0435\u0442 \u0442\u0430\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439? \u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0432 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 K&amp;R. \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b O_WRONLY \u0442\u043e\u0436\u0435 \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0435\u043c \u0432 <a href=\"http:\/\/squoze.net\/UNIX\/v5man\/man2\/open\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a> \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0447\u0438\u0441\u043b\u043e 1.<\/p>\n<pre><code class=\"plaintext\">int main(argc, argv)      int argc;     char* argv[]; {   int fd;   fd = open(argv[1], 1);   if(fd &lt; 0) perror(\"open\");   return 0; } <\/code><\/pre>\n<p>  \u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0430\u043a\u0438\u0445 \u0433\u0438\u043f\u043e\u0442\u0435\u0437 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 PDP-11\/70 \u043d\u0430 JavaScript, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <a href=\"https:\/\/skn.noip.me\/pdp11\/pdp11.html\">\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d<\/a> \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0431\u0440\u0430\u0437\u044b Unix v5 \u0438 BSD2.11. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u043d\u0430 Unix v5.<\/p>\n<pre><code class=\"bash\"># cc a.c # .\/a.out \/tmp open: Is a directory <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 dirent \u043d\u0430 \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u0435 \u043d\u0435 \u0443\u0432\u0435\u043d\u0447\u0430\u044e\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0445\u043e\u043c. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 dirent \u2014 \u044d\u0442\u043e <a href=\"https:\/\/man.freebsd.org\/cgi\/man.cgi?query=getdirentries%26sektion=2%26apropos=0%26manpath=FreeBSD%2B11.0-RELEASE\">\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f<\/a>, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u042f\u0434\u0440\u043e \u00ab\u043f\u043e\u0434\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u00bb \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043d\u0438\u0445 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430. \u0422\u043e\u0433\u0434\u0430 \u0437\u0430\u043c\u044b\u0441\u043b\u0438\u043c \u0448\u0430\u043b\u043e\u0441\u0442\u044c!<\/p>\n<p>  <a name=\"2\"><\/a><font color=\"#EB4247\"><\/p>\n<h2>\u041d\u0435 \u0434\u043e\u0432\u0435\u0440\u044f\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c<\/h2>\n<p><\/font><br \/>  \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0437\u043d\u0430\u0447\u0438\u0442, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0431\u0435\u0437 \u0435\u0435 \u0432\u0435\u0434\u043e\u043c\u0430. \u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0434\u0438\u0441\u043a \u0432 HEX-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043d\u0430 Windows, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440. \u041f\u0440\u043e Windows \u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e\u0433\u043e\u0440\u044f\u0447\u0438\u043b\u0441\u044f, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043c\u044b\u0441\u043b\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f:<\/p>\n<ol>\n<li>\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u00ab\u0434\u0438\u0441\u043a\u00bb \u0432 \u0432\u0438\u0434\u0435 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 50 \u041c\u0411,<\/li>\n<li>\u0440\u0430\u0437\u043c\u0435\u0442\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430,<\/li>\n<li>\u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 mnt,<\/li>\n<li>\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c 12345678,<\/li>\n<li>\u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u00ab\u0434\u0438\u0441\u043a\u00bb,<\/li>\n<li>\u0447\u0435\u0440\u0435\u0437 HEX-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430,<\/li>\n<li>\u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u00ab\u0434\u0438\u0441\u043a\u00bb \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0442\u0435\u0438.<\/li>\n<\/ol>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0438\u0434\u0435\u0435 \u00ab\u0432\u0441\u0435 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u00bb \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0435\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u0444\u0430\u0439\u043b\u043e\u043c-\u0434\u0438\u0441\u043a\u043e\u043c \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0435 \u043d\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0434\u0438\u0441\u043a\u0430, \u0430 \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u0410 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u044d\u0442\u043e \u0434\u0438\u0441\u043a.<\/p>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443:<\/p>\n<pre><code class=\"bash\"># \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b dd if=\/dev\/zero of=img bs=1M count=50 # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 mkfs.ext4 img # \u041c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0438\u0441\u043a mkdir mnt mount img mnt # \u041f\u0443\u0441\u0442\u043e\u0439 \u0444\u0430\u0439\u043b touch mnt\/12345678 # \u041e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c umount mnt # \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c 12345678 \u0432 87654321 sed -i 's\/12345678\/87654321\/g' img <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 sed, \u043e\u043d \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u041c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# mount img mnt void@ubuntu-2204:~# ls -l mnt ls: reading directory 'mnt': Bad message total 0 <\/code><\/pre>\n<p>  \u041e\u0433\u043e, <s>\u043f\u043b\u043e\u0445\u0438\u0435 \u0432\u043e\u0440\u043e\u0442\u0430<\/s> \u043f\u043b\u043e\u0445\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u0412 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043b\u043e\u0433\u0435 \u044f\u0434\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"bash\">[36446.876771] EXT4-fs error (device loop1): htree_dirblock_to_tree:1080: inode #2: comm ls: Directory block failed checksum <\/code><\/pre>\n<p>  \u041b\u043e\u0433\u0438\u0447\u043d\u043e. \u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432 \u0441\u0438\u043b\u0443 \u0441\u0432\u043e\u0435\u0439 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u044b \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0441\u0431\u043e\u0439. \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 e2fsck \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# e2fsck img  e2fsck 1.46.5 (30-Dec-2021) img contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Directory inode 2, block #0: directory passes checks but fails checksum. Fix&lt;y>? yes Pass 3: Checking directory connectivity Pass 3A: Optimizing directories Pass 4: Checking reference counts Pass 5: Checking group summary information img: ***** FILE SYSTEM WAS MODIFIED ***** img: 13\/12800 files (7.7% non-contiguous), 1840\/12800 blocks void@ubuntu-2204:~# <\/code><\/pre>\n<p>  \u041c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0437\u0430\u043d\u043e\u0432\u043e:<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# ls -l mnt\/ total 16 -rw-r--r-- 1 void root     0 Mar  5 18:44 87654321 -rw-r--r-- 1 void root     0 Mar  5 18:31 blablabla drwx------ 2 void root 16384 Mar  5 18:26 lost+found <\/code><\/pre>\n<p>  \u0421\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0435 \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435: \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u0438\u043c \u043e\u0434\u043d\u043e \u0438\u043c\u044f.<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~\/mnt# ls -li total 24 12 -rw-r--r-- 1 void root     2 Mar  5 19:26 1.txt 13 -rw-r--r-- 1 void root    20 Mar  5 19:26 2.txt 11 drwx------ 2 void root 16384 Mar  5 18:26 lost+found void@ubuntu-2204:~\/mnt# cat 1.txt  1 void@ubuntu-2204:~\/mnt# cat 2.txt  2222222222222222222 void@ubuntu-2204:~\/mnt#  <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0441\u0447\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u044b:<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# e2fsck img e2fsck 1.46.5 (30-Dec-2021) img contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Duplicate entry 'a.txt' found.         Marking ??? (2) to be rebuilt. Directory inode 2, block #0: directory passes checks but fails checksum. Fix&lt;y>? yes Pass 3: Checking directory connectivity Pass 3A: Optimizing directories Entry 'a.txt' in \/ (2) has a non-unique filename. Rename to a.txt~0&lt;y>? no Pass 4: Checking reference counts Pass 5: Checking group summary information img: ***** FILE SYSTEM WAS MODIFIED ***** img: ********** WARNING: Filesystem still has errors ********** img: 13\/12800 files (7.7% non-contiguous), 1842\/12800 blocks void@ubuntu-2204:~# mount img mnt\/ <\/code><\/pre>\n<p>  \u0423\u0442\u0438\u043b\u0438\u0442\u0430 e2fsck \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043d\u0435\u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f. \u041c\u044b, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043e\u0442 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u00ab\u0434\u0438\u0441\u043a\u00bb. \u0427\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c?<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# ls -li mnt total 24 12 -rw-r--r-- 1 void root     2 Mar  5 19:26 a.txt 12 -rw-r--r-- 1 void root     2 Mar  5 19:26 a.txt 11 drwx------ 2 void root 16384 Mar  5 18:26 lost+found void@ubuntu-2204:~# cat mnt\/a.txt  1 <\/code><\/pre>\n<p>  \u0414\u0440\u0430\u0439\u0432\u0435\u0440 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u044e: \u0444\u0430\u0439\u043b \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043d\u043e\u043c\u0435\u0440\u043e\u043c inode, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0440\u0430\u0437\u0430. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u00ab\u043f\u0435\u0440\u0432\u044b\u043c\u00bb \u0444\u0430\u0439\u043b\u043e\u043c.<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# rm mnt\/a.txt  void@ubuntu-2204:~# ls -l mnt\/ ls: cannot access 'mnt\/a.txt': No such file or directory total 16 ? -????????? ? ?    ?        ?            ? a.txt drwx------ 2 void root 16384 Mar  5 18:26 lost+found void@ubuntu-2204:~# cat mnt\/a.txt  cat: mnt\/a.txt: No such file or directory void@ubuntu-2204:~# umount mnt  void@ubuntu-2204:~# mount img mnt\/ void@ubuntu-2204:~# ls -li mnt\/ total 20 13 -rw-r--r-- 1 void root    20 Mar  5 19:26 a.txt 11 drwx------ 2 void root 16384 Mar  5 18:26 lost+found void@ubuntu-2204:~# cat mnt\/a.txt  2222222222222222222 <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0444\u0430\u0439\u043b, \u0442\u043e \u0435\u0433\u043e \u00ab\u0442\u0435\u0437\u043a\u0430\u00bb \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u0442 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u0442\u0430 \u0428\u0440\u0435\u0434\u0438\u043d\u0433\u0435\u0440\u0430. \u0424\u0430\u0439\u043b \u0435\u0441\u0442\u044c, \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0435\u0442. \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u0442\u043e\u0440\u043e\u0439 \u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0438\u043c\u0432\u043e\u043b-\u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c:<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# cat >mnt\/split-me.txt  Hello, Habr! void@ubuntu-2204:~# umount mnt void@ubuntu-2204:~# sed -i 's\/split-me.txt\/split\\\/me.txt\/g' img void@ubuntu-2204:~# e2fsck img  e2fsck 1.46.5 (30-Dec-2021) img contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Entry 'split\/me.txt' in ??? (2) has illegal characters in its name. Fix&lt;y>? no Directory inode 2, block #0: directory passes checks but fails checksum. Fix&lt;y>? yes Pass 3: Checking directory connectivity Pass 3A: Optimizing directories Pass 4: Checking reference counts Pass 5: Checking group summary information img: ***** FILE SYSTEM WAS MODIFIED ***** img: ********** WARNING: Filesystem still has errors ********** img: 12\/12800 files (8.3% non-contiguous), 1841\/12800 blocks <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443, \u043d\u043e \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0435\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0439. \u0425\u043e\u0440\u043e\u0448\u043e, \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# ls -l mnt\/ ls: reading directory 'mnt\/': Input\/output error total 16 drwx------ 2 void root 16384 Mar  5 18:26 lost+found void@ubuntu-2204:~# ls -l mnt\/split\/me.txt ls: cannot access 'mnt\/split\/me.txt': No such file or directory void@ubuntu-2204:~# mkdir mnt\/split void@ubuntu-2204:~# cat mnt\/split\/me.txt cat: mnt\/split\/me.txt: No such file or directory void@ubuntu-2204:~# echo Wow > mnt\/split\/me.txt void@ubuntu-2204:~# cat mnt\/split\/me.txt  Wow <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u044f \u0434\u043e\u043b\u0433\u043e \u0436\u0434\u0430\u0442\u044c.<\/p>\n<ul>\n<li>\u0427\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0441\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430. \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c inode \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0443 \u00ab\u0441\u043b\u043e\u043c\u0430\u043d\u043d\u043e\u0433\u043e\u00bb \u0444\u0430\u0439\u043b\u0430, \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432 \u0432\u044b\u0432\u043e\u0434.<\/li>\n<li>\u0421\u0430\u043c \u00ab\u0441\u043b\u043e\u043c\u0430\u043d\u043d\u044b\u0439\u00bb \u0444\u0430\u0439\u043b \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.<\/li>\n<\/ul>\n<p>  \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u043d\u0435 \u0434\u0435\u043d\u044c \u0438 \u043d\u0435 \u0434\u0432\u0430, \u0430 45 \u043b\u0435\u0442, \u0435\u0441\u043b\u0438 \u0431\u0440\u0430\u0442\u044c \u0437\u0430 \u0442\u043e\u0447\u043a\u0443 \u043e\u0442\u0441\u0447\u0435\u0442\u0430 \u0432\u044b\u0445\u043e\u0434 UNIX v7.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c *NIX. \u041d\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u00ab\u043e\u043a\u043e\u043d\u043d\u044b\u0435\u00bb \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<blockquote><p><b>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u0438 \u0442\u0435\u043a\u0441\u0442\u044b \u0442\u043e\u0436\u0435 \u0432\u0430\u0441 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442:<\/b><\/p>\n<p>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/selectel\/blog\/795621\">Figma \u0437\u0430\u043a\u0440\u044b\u043b\u0430 Dev Mode: \u043f\u0443\u0442\u0438 \u043e\u0431\u0445\u043e\u0434\u0430 \u0438 \u0438\u0445 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440<\/a><br \/>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/selectel\/blog\/797675\">\u041c\u0438\u043d\u0438-\u041f\u041a \u0434\u043b\u044f \u00ab\u0442\u044f\u0436\u0435\u043b\u044b\u0445\u00bb \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0434\u0430\u0447: 5 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0435\u0441\u043d\u044b 2024 \u0433\u043e\u0434\u0430<\/a><br \/>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/selectel\/blog\/797573\">10\u043d\u043c \u0442\u0435\u0445\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 6 \u0413\u0413\u0446: Intel \u0441\u0442\u0430\u0432\u0438\u0442 \u043d\u043e\u0432\u044b\u0435 \u0440\u0435\u043a\u043e\u0440\u0434\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u043f\u043e\u0432. \u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e?<\/a><\/p><\/blockquote>\n<p>  <a name=\"3\"><\/a><font color=\"#EB4247\"><\/p>\n<h2>exFAT<\/h2>\n<p><\/font><br \/>  \u0411\u0440\u0430\u0442\u044c NTFS \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c. \u041d\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u0438\u0437-\u0437\u0430 \u0431\u0430\u0433\u0430 \u043d\u0430 \u0444\u043b\u0435\u0448\u043a\u0435 \u0444\u043e\u0442\u043e\u0430\u043f\u043f\u0430\u0440\u0430\u0442\u0430. \u0422\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0442 Microsoft \u2014 exFAT. \u042d\u0442\u043e \u043f\u0440\u0435\u0435\u043c\u043d\u0438\u043a FAT, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0441\u044a\u0435\u043c\u043d\u044b\u0445 \u043d\u043e\u0441\u0438\u0442\u0435\u043b\u0435\u0439. \u041e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442. \u0425\u043e\u0442\u044f \u0434\u043b\u044f Ubuntu 22.04 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e exfat-fuse.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u043a\u0430\u043a \u0440\u0430\u043d\u044c\u0448\u0435:<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# dd if=\/dev\/zero of=img bs=1M count=50 50+0 records in 50+0 records out 52428800 bytes (52 MB, 50 MiB) copied, 0.024757 s, 2.1 GB\/s void@ubuntu-2204:~# mkfs.exfat img exfatprogs version : 1.1.3 Creating exFAT filesystem(img, cluster size=4096) Writing volume boot record: done Writing backup volume boot record: done Fat table creation: done Allocation bitmap creation: done Upcase table creation: done Writing root directory entry: done Synchronizing... exFAT format complete!&lt;br>void@ubuntu-2204:~# mount img mnt void@ubuntu-2204:~# cat > mnt\/1.txt 111111111111111111111111 void@ubuntu-2204:~# cat > mnt\/2.txt  222222222222222222222 <\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0447\u0435\u0440\u0435\u0437 sed \u0443\u0436\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f: \u0434\u043b\u044f \u0438\u043c\u0435\u043d exFAT \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 UTF-16. \u0425\u043e\u0440\u043e\u0448\u043e, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c Python \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"python\">import sys file, pattern, replace = sys.argv[1:4] pattern = pattern.encode(\"utf-16le\") replace = replace.encode(\"utf-16le\") with open(file, \"rb\") as f:     raw_data = f.read() raw_data = raw_data.replace(pattern, replace) with open(file, \"wb\") as f:     f.write(raw_data) <\/code><\/pre>\n<p>  \u041d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0437\u0430 \u0432 50 \u041c\u0411 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0437\u0430\u043c\u0435\u043d\u0443:<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# python3 replace.py img 2.txt 1.txt void@ubuntu-2204:~# mount img mnt void@ubuntu-2204:~# ls -li mnt\/ total 8 10 -rwxr-xr-x 1 void root 25 Mar  5 20:48 1.txt 10 -rwxr-xr-x 1 void root 25 Mar  5 20:48 1.txt <\/code><\/pre>\n<p>  \u0420\u0435\u0430\u043a\u0446\u0438\u044f Ubuntu \u043d\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0430\u0441\u044c: \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u0430\u0439\u043b. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441 UNIX-\u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u043c. \u0410 \u0432\u043e\u0442 Windows-\u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0432\u043d\u043e\u0441\u0438\u0442 \u0441\u043c\u0443\u0442\u0443, \u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"bash\">void@ubuntu-2204:~# ls -l mnt\/ ls: cannot access 'mnt\/2\\txt': No such file or directory total 4 -rwxr-xr-x 1 void root 25 Mar  5 20:48  1.txt -????????? ? ?    ?     ?            ? '2\\txt' void@ubuntu-2204:~# ls -l mnt\/2\\\\txt  ls: cannot access 'mnt\/2\\txt': No such file or directory <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043d\u0430 Windows \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0430 \u0444\u043b\u0435\u0448\u043a\u0443.<\/p>\n<pre><code class=\"bash\">dd if=img of=\/dev\/&lt;\u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0439 \u0434\u0438\u0441\u043a> bs=4M <\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/y_\/fk\/mc\/y_fkmcbr4i1t64vlp0c9mulpfjq.png\" data-src=\"https:\/\/habrastorage.org\/webt\/y_\/fk\/mc\/y_fkmcbr4i1t64vlp0c9mulpfjq.png\"\/><\/div>\n<p>  <i>\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0432 Windows 10.<\/i><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/jt\/cr\/vk\/jtcrvktosqcyh461wbi9sauof3u.png\" data-src=\"https:\/\/habrastorage.org\/webt\/jt\/cr\/vk\/jtcrvktosqcyh461wbi9sauof3u.png\"\/><\/div>\n<p>  <i>\u041f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u043b\u044c\u0437\u044f.<\/i><\/p>\n<p>  Windows \u0442\u0443\u0442 \u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u044c \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u2014 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043d\u0430\u0447\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0435\u043b\u044f \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/uk\/52\/wm\/uk52wmx5kxwtekl8idbqa7rf0si.png\" data-src=\"https:\/\/habrastorage.org\/webt\/uk\/52\/wm\/uk52wmx5kxwtekl8idbqa7rf0si.png\"\/><\/div>\n<p>  <i>\u041a\u043e\u043d\u0441\u043e\u043b\u044c \u0442\u043e\u043f.<\/i><\/p>\n<p>  \u041a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u043d\u0435\u0442\u0441\u044f \u043d\u0430 \u00ab\u0441\u043b\u043e\u043c\u0430\u043d\u043d\u043e\u043c\u00bb \u0444\u0430\u0439\u043b\u0435. \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c, \u043e\u0434\u043d\u0430\u043a\u043e, \u0444\u0430\u0439\u043b\u044b \u0440\u044f\u0434\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<blockquote><p>\u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0432 *NIX \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043d\u043e \u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c. <b>\u0427\u0442\u043e \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0432\u044b? \u041f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u043c\u043d\u0435\u043d\u0438\u0435\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445!<\/b><\/p><\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/798329\/\"> https:\/\/habr.com\/ru\/articles\/798329\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/a6\/ec\/xf\/a6ecxfdy9rwhuyu_yqj0osukkwu.png\" data-src=\"https:\/\/habrastorage.org\/webt\/a6\/ec\/xf\/a6ecxfdy9rwhuyu_yqj0osukkwu.png\"\/><\/div>\n<p>  \u0412\u0441\u0435 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u0440\u0443\u0433 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442: \u043d\u0430 \u0444\u043b\u0435\u0448\u043a\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0431\u044b\u043b\u043e \u0434\u0432\u0430 \u0444\u0430\u0439\u043b\u0430 \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c. \u0420\u0430\u0437\u0433\u0430\u0434\u043a\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0432\u043e \u0432\u0441\u0435\u043c \u0432\u0438\u043d\u043e\u0432\u0430\u0442 \u0444\u043e\u0442\u043e\u0430\u043f\u043f\u0430\u0440\u0430\u0442, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043a\u0430\u0434\u0440\u0430.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u0435\u0446\u0435\u0434\u0435\u043d\u0442 \u043f\u043e\u0431\u0443\u0434\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043e\u0431\u043c\u0430\u043d\u0443\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0438 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u0435\u0442\u044b \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c? \u0418 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0442\u043e \u043a\u0430\u043a \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u041e\u0421?<\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0432\u0430\u0441 \u0436\u0434\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044d\u043a\u0441\u043a\u0443\u0440\u0441 \u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u043d\u0430\u0431\u043e\u0440 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-370055","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=370055"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370055\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=370055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=370055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=370055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}