{ "version": "https://jsonfeed.org/version/1", "title": "Unix", "description": null, "home_page_url": "go/unix", "feed_url": "feed/unix.json", "items": [ { "author": { "url": "member/yezheyu", "name": "yezheyu", "avatar": "https://cdn.v2ex.com/avatar/f338/e452/166159_large.png?m=1698659181" }, "url": "t/986797", "date_modified": "2023-10-30T11:03:30+00:00", "content_html": "

\u6700\u8fd1\u5728\u770b\u300a unix \u7cfb\u7edf\u7f16\u7a0b\u624b\u518c\u300b\u548c\u300a unix \u73af\u5883\u9ad8\u7ea7\u7f16\u7a0b\u300b\n\u770b\u5230 IO \u7f13\u51b2\u533a\u8fd9\u5757\u6709\u70b9\u7591\u95ee\uff0c\u4e66\u4e0a\u597d\u591a\u5730\u65b9\u6709\u63d0\u5230\u7f13\u51b2\u533a\uff0c\u4f46\u4e66\u4e0a\u4e5f\u6ca1\u7ec6\u8bf4\u662f\u5185\u6838\u7f13\u51b2\u533a\u8fd8\u662f\u7528\u6237\u7f13\u51b2\u533a\n\u7ffb\u4e00\u4e0b\u7f51\u4e0a\u7684\u5e16\u5b50\uff0c\u53d1\u73b0\u4e5f\u662f\u5982\u6b64\u3002

\n

\u6211\u6309\u7167\u4e2a\u4eba\u7406\u89e3\u753b\u4e86\u4e0b\u9762\u51e0\u5e45\u56fe\uff0c\u5927\u5bb6\u5e2e\u6211\u770b\u4e0b\u6211\u7406\u89e3\u7684\u5bf9\u5417\uff1f

\n

\"\"

\n

read \u51fd\u6570\uff1a\u6bcf\u6b21\u8c03\u7528\u90fd\u6267\u884c\u4e00\u6b21 read \u7cfb\u7edf\u8c03\u7528\uff0c\u6ca1\u6709\u7f13\u5b58

\n

\"\"

\n

fread \u51fd\u6570\uff1a

\n\n

\"\"

\n

write \u51fd\u6570\uff1a\u6bcf\u6b21\u8c03\u7528\u90fd\u4f1a\u6267\u884c\u4e00\u6b21 write \u7cfb\u7edf\u8c03\u7528\uff0c\u6ca1\u6709\u7f13\u5b58

\n

\"\"

\n

fwrite \u51fd\u6570\uff1a

\n\n

\u6211\u4e0a\u9762\u63cf\u8ff0\u7684\u5bf9\u5417\uff1f

\n

\u8f93\u5165\u8f93\u51fa\u7f13\u51b2\u533a\u662f\u4f4d\u4e8e\u5185\u6838\u7a7a\u95f4\u5417\uff1f

\n

fopen \u8fd4\u56de\u7684 FILE \u7ed3\u6784\u4f53\u662f\u5305\u542b\u7740\u7528\u6237\u7f13\u51b2\u533a\u662f\u5417\uff1f

\n

\u5982\u679c fopen \u4ee5\u8bfb\u5199\u65b9\u5f0f\u6253\u5f00\u6587\u4ef6\uff0c\u90a3\u662f\u4e0d\u662f\u4f1a\u5728\u7528\u6237\u7a7a\u95f4\u540c\u65f6\u5efa\u7acb\u4e24\u4e2a\u7f13\u51b2\u533a\uff0c\u4e00\u4e2a\u7528\u4e8e\u8bfb\uff0c\u4e00\u4e2a\u7528\u4e8e\u5199\uff1f

\n

fopen \u6253\u5f00\u6587\u4ef6\u8fd4\u56de\u7684\u5bf9\u8c61\u79f0\u4e4b\u4e3a stream \uff0cstream \u662f\u4e2a\u5565\uff1f\u662f\u4e0d\u662f\u5176\u7279\u70b9\u5c31\u662f\u5e26\u6709\u7f13\u51b2\u533a\uff0c\u53ef\u4ee5\u7528\u4e8e\u7f13\u51b2 IO \uff0c\u5408\u5e76\u7cfb\u7edf\u8c03\u7528\uff1f

\n

\u5982\u679c\u4f7f\u7528 setvbuf \u628a fread \u4e2d\u7684\u7528\u6237\u7f13\u51b2\u533a\u6539\u4e3a\u884c\u7f13\u51b2\u6a21\u5f0f\uff0c\u90a3\u7b2c\u4e00\u6b21 read \u65f6\u662f\u4e0d\u662f\u53ea\u4ece\u8f93\u5165\u7f13\u51b2\u533a\u8bfb\u53d6\u4e00\u884c\u6570\u636e\u800c\u4e0d\u662f 2k \uff1f

\n
test.txt \u5185\u5bb9\u5982\u4e0b\nab\ncd\n\n\nFILE *file = fopen(\"test.txt\", \"r+\");\nchar buf_cache[512];\nsetvbuf(file, buf_cache, _IOLBF, 512);\nchar c;\nsleep(5);\nfread(&c, 1, 1, file);\nfread(&c, 1, 1, file);\nfread(&c, 1, 1, file);\nfread(&c, 1, 1, file);\nfread(&c, 1, 1, file);\nfclose(file);\n\n
\n

\u90a3\u4ee5\u4e0a\u4ee3\u7801\u6211\u7528 strace \u8ffd\u8e2a\u4e3a\u5565\u8fd8\u662f\u53ea\u8c03\u7528\u4e86\u4e00\u6b21 read \u7cfb\u7edf\u8c03\u7528\u5462\uff1f\u6309\u7406\u8bf4\u4e0d\u5e94\u8be5\u662f\u56e0\u4e3a\u6709\u4e24\u884c\u6570\u636e\u6267\u884c\u4e24\u6b21 read \u5417\uff1f

\n", "date_published": "2023-10-30T09:51:27+00:00", "title": "\u8bf7\u6559\u4e0b\u5173\u4e8e IO \u7f13\u51b2\u7684\u4e00\u70b9\u7591\u95ee", "id": "t/986797" }, { "author": { "url": "member/Zien", "name": "Zien", "avatar": "https://cdn.v2ex.com/avatar/9153/9772/354209_large.png?m=1744315960" }, "url": "t/795445", "title": "mv \u547d\u4ee4\u6587\u4ef6\u5939\u540e\u9762\u52a0\u659c\u6760\u771f\u7684\u6ca1\u6709\u610f\u4e49\u5417\uff1f", "id": "t/795445", "date_published": "2021-08-12T14:30:29+00:00", "content_html": "

\u5927\u90e8\u5206\u90fd\u8bf4\u6ca1\u6709\u4f5c\u7528\uff08\u6211\u4ee5\u524d\u4e5f\u662f\u8fd9\u6837\u8ba4\u4e3a\u7684\uff09\uff0c\u4f46\u770b\u5230\u4e00\u4e2a\u56de\u7b54\u5efa\u8bae source \u540e\u4e0d\u52a0\u659c\u6760\uff0c\u9632\u6b62 symlink \u7684\u95ee\u9898\uff1b\ntarget \u6700\u597d\u52a0\u659c\u6760\uff0c\u9632\u6b62\u9519\u62fc\u5bfc\u81f4\u7684\u95ee\u9898\u3002

\n

https://stackoverflow.com/a/24925767

\n

\u611f\u89c9\u6709\u70b9\u6ca1\u5403\u900f\uff0c\u6709\u6ca1\u6709\u5927\u624b\u5b50\u80fd\u89e3\u91ca\u4e0b\u3002

\n" }, { "author": { "url": "member/cloudL", "name": "cloudL", "avatar": "https://cdn.v2ex.com/avatar/74b7/c28d/215021_large.png?m=1487058482" }, "url": "t/346482", "date_modified": "2017-03-10T08:11:19+00:00", "content_html": "

\u5b89\u88c5\u5b8c\u7cfb\u7edf\u540e\uff0c\u6267\u884c\u4ee5\u4e0b\u4ee3\u7801\u540e\u5173\u673a\u3002\u7136\u540e\u628a\u7cfb\u7edf\u5236\u4f5c\u6210\u955c\u50cf\u5373\u53ef

\n

\u4fdd\u5b58\u4e3a\u4e00\u4e2a\u53ef\u6267\u884c\u7684 bash \u6587\u4ef6\uff0c\u6700\u597d\u5728 screen \u4e2d\u8fd0\u884c

\n

#\u628a\u4e0b\u9762\u7684 key \u6362\u6210\u6709\u6548\u7684 Plesk key

\n

key=A00100-C11604-BP7806-BP7662-SE5R68

\n

#\u4e00\u952e\u5b89\u88c5 Plesk

\n

sh <(curl https://autoinstall.plesk.com/one-click-installer || wget -O - https://autoinstall.plesk.com/one-click-installer)

\n

#\u83b7\u53d6\u4e00\u4e2a\u672c\u673a ip \u5730\u5740

\n

ip=ifconfig eth0 | grep \"inet addr\" | awk '{ print $2}' | awk -F: '{print $2}'

\n

if [ \"$ip\" = \"\" ]; then

\n
ip=`ifconfig eth0 | grep \"inet\" | awk '{ print $2}'`\n
\n

fi

\n

#\u521d\u59cb\u5316\u914d\u7f6e Plesk

\n

plesk bin init_conf --init -default-ip $ip -netmask 255.255.255.0 -iface eth0 -ip-type shared -license_agreed true -hostname example.com -shared_ips add:$ip -name \"John Doe\" -passwd mypass -phone 555-5555 -fax 333-3333 -email admin@example.com -company \"Megacompany Inc.\" -address \"45 Trail street\" -city \"New York\" -zip 10292 -country US -state NY

\n

#\u6fc0\u6d3b key

\n

plesk bin license -i $key

\n

#\u8bbe\u7f6e Plesk \u9ed8\u8ba4\u8bed\u8a00

\n

plesk bin locales --set-default zh-CN

\n

#\u66f4\u6539\u57df\u540d\u6ce8\u518c\u6216\u57df\u540d\u7ba1\u7406\u7684\u94fe\u63a5

\n

if [ ! -f \"/etc/centos-release\" ]; then

\n
path='/opt'\n
\n

else

\n
path='/usr/local'\n
\n

fi

\n

$path/psa/bin/panel_gui -p -domain_registration_url https://www.bisend.cn/domain

\n

$path/psa/bin/panel_gui -p -domain_management_url https://my.bisend.cn

\n

#\u4e0d\u663e\u793a Facebook Like \u94fe\u63a5\u4ee5\u52a0\u5feb Plesk \u9875\u9762\u52a0\u8f7d\u901f\u5ea6

\n

sed 's/;showLikeLink/showLikeLink/' $path/psa/admin/conf/panel.ini.sample >\n$path/psa/admin/conf/panel.ini

\n

#\u5b89\u88c5\u989d\u5916\u7684 extension

\n

wget https://my.bisend.cn/downloads/trustasiassltool-1.1.9-10.zip -P /root/

\n

plesk bin extension --install /root/trustasiassltool-1.1.9-10.zip

\n

#\u6e05\u9664\u5b89\u88c5 Key \u7684\u4fe1\u606f

\n

plesk bin cloning -u -prepare-public-image true -reset-license true -reset-init-conf true -skip-update true

\n

#\u4e0b\u6b21\u542f\u52a8 Plesk \u7684\u65f6\u5019\u91cd\u65b0\u6620\u5c04 ip

\n

plesk bin ipmanage --auto-remap-ip-addresses true

\n

#\u7d42\u308f\u308a

\n

echo \"finished\"

\n

windows \u4e2d\u53ea\u628a\u90e8\u5206\u64cd\u4f5c\u811a\u672c\u5316

\n

#\u6d4f\u89c8\u5668\u4e0b\u8f7d http://autoinstall-win.plesk.com/plesk-installer.exe

\n

#\u53cc\u51fb\u6253\u5f00\u6216\u8005 cmd \u6253\u5f00 plesk-installer.exe --console

\n

#LINUX: sh <(curl https://autoinstall.plesk.com/one-click-installer || wget -O - https://autoinstall.plesk.com/one-click-installer)

\n

#ip=ifconfig eth0 | grep \"inet addr\" | awk '{ print $2}' | awk -F: '{print $2}'\n#\u624b\u52a8\u83b7\u5f97 ip \u5e76\u66ff\u6362\u4e0b\u9762\u547d\u4ee4\u4e2d\u7684 ip

\n

plesk bin init_conf --init -license_agreed true -hostname example.com -shared_ips add:172.31.34.196 -name \"John Doe\" -passwd MyPass@123 -phone 555-5555 -fax 333-3333 -email admin@example.com -company \"Megacompany Inc.\" -address \"45 Trail street\" -city \"New York\" -zip 10292 -country US -state NY

\n

plesk bin license -i A00100-C11604-BP7806-BP7662-SE5R68

\n

plesk bin locales --set-default zh-CN #\u8bbe\u7f6e\u4e2d\u6587\u4e3a\u9ed8\u8ba4\u8bed\u8a00

\n

\"C:\\Program Files (x86)\\Plesk\\bin\\panel_gui\" -p -domain_registration_url https://www.bisend.cn/domain

\n

\"C:\\Program Files (x86)\\Plesk\\bin\\panel_gui\" -p -domain_management_url https://my.bisend.cn

\n

#\u624b\u52a8\u64cd\u4f5c\u4ee3\u66ff\u4e0b\u9762\u7684\u53e5\u5b50

\n

#sed \"s/;showLikeLink/showLikeLink/\" \"C:\\Program Files (x86)\\Plesk\\admin\\conf\\panel.ini.sample\" > \"C:\\Program Files (x86)\\Plesk\\admin\\conf\\panel.ini\"

\n

#\u624b\u52a8\u64cd\u4f5c\u4ee3\u66ff\u4e0b\u9762\u7684\u53e5\u5b50

\n

#wget https://my.bisend.cn/downloads/trustasiassltool-1.1.9-10.zip -P /root/

\n

#plesk bin extension --install /root/trustasiassltool-1.1.9-10.zip

\n

plesk bin cloning -u -prepare-public-image true -reset-license true -reset-init-conf true -skip-update true

\n

plesk bin ipmanage --auto-remap-ip-addresses true

\n

#windows \u4e2d\u4e0d\u9700\u8981

\n

#-default-ip 172.31.34.196 -netmask 255.255.255.0 -iface eth0 -ip-type shared

\n", "date_published": "2017-03-10T08:08:40+00:00", "title": "Plesk \u955c\u50cf\u5236\u4f5c(\u811a\u672c)", "id": "t/346482" }, { "author": { "url": "member/hatcloud", "name": "hatcloud", "avatar": "https://cdn.v2ex.com/avatar/d7a9/d8cd/65310_large.png?m=1402926643" }, "url": "t/141387", "date_modified": "2014-10-25T03:07:44+00:00", "content_html": "\u81ea\u5df1\u60f3\u5199\u4e00\u4e2a\u81ea\u52a8\u4eceGitHub\u4e0a\u66f4\u65b0\u6700\u65b0\u7684Hosts\u6587\u4ef6\u5230\u672c\u5730\u7684\u811a\u672c\uff0c\u5948\u4f55\u5b8c\u5168\u4e0d\u4f1aUnix\u7684\u811a\u672c\u7f16\u5199\u3002
\u5e0c\u671b\u8bf8\u4f4d\u80fd\u63d0\u4f9b\u4e2a\u7b80\u5355\u6559\u7a0b\u7684\u7f51\u9875
\u6216\u8005\u76f4\u63a5\u5e2e\u6211\u5199\u4e00\u4e2a\u5427\uff08\u4e0d\u4f1a\u88ab\u8bf4\u4f38\u624b\u515a\u5427\uff09

\u5728\u7ec8\u7aef\u81ea\u5df1\u8f93\u5165\u7684\u547d\u4ee4\u5982\u4e0b:
cd \u672c\u5730\u7684Git\u6587\u4ef6\u5939\u8def\u5f84
git pull
sudo cp imouto.host.txt /etc/hosts", "date_published": "2014-10-25T02:01:54+00:00", "title": "\u600e\u4e48\u5199 Mac \u4e0b\u7684\u811a\u672c\uff1f", "id": "t/141387" }, { "author": { "url": "member/undozen", "name": "undozen", "avatar": "https://cdn.v2ex.com/avatar/dc66/b445/27125_large.png?m=1379291686" }, "url": "t/65170", "date_modified": "2013-04-07T08:37:00+00:00", "content_html": "\u6bd4\u5982\u53ea\u80fdrm -rf sth
\u4e0d\u80fdrm sth -rf

\u6bd4\u5982 cp -r dir/ anotherdir/ \u76f8\u5f53\u4e8e cp -r dir/* anotherdir/\uff0c\u4f1a\u628a dir \u91cc\u9762\u7684\u4e1c\u897f\u590d\u5236\u5230 anotherdir/\u4e0b\uff0c\u800c gnu \u7684\u5de5\u5177\u4f1a\u590d\u5236\u5230 anotherdir/dir/\u4e0b

\u6240\u4ee5\u6211\u5728\u65b0\u7cfb\u7edf\u4e0a\u7b2c\u4e00\u4ef6\u4e8b\u4e00\u5b9a\u662f brew install coreutils

\u4f1a\u6709\u4eba\u66f4\u559c\u6b22\u524d\u8005\u5417\uff1f", "date_published": "2013-04-07T08:36:16+00:00", "title": "\u4f1a\u6709\u4eba\u89c9\u5f97unix\u7cfb\u7684\u547d\u4ee4\u884c\u5de5\u5177\u597d\u7528\u7684\u5417\uff0c\u76f8\u6bd4gnu\u7684\u6765\u8bf4", "id": "t/65170" }, { "author": { "url": "member/Livid", "name": "Livid", "avatar": "https://cdn.v2ex.com/avatar/c4ca/4238/1_large.png?m=1778374421" }, "url": "t/56065", "date_modified": "2012-12-28T05:34:35+00:00", "content_html": "http://www.nordier.com/v7x86/index.html", "date_published": "2012-12-28T05:34:26+00:00", "title": "V7/x86", "id": "t/56065" } ] } ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86