<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>System File (系统文件) &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-sep-2022.github.io/category/system/system-space-system-directory-system-file/system-file/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-sep-2022.github.io/</link>
	<description></description>
	<lastBuildDate>Wed, 07 Sep 2022 07:38:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[命令] Linux 命令 locate （查找文件）</title>
		<link>https://eternalcenter-sep-2022.github.io/locate/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 01 Aug 2022 12:50:19 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=27463</guid>

					<description><![CDATA[内容一：locate 命令的安装 1.1 安装 locate 命令 1.2 更新 locate 数据库 （注意：如果不更新 locate 数据库，在使用 locate 命令后可能会报错 ） 内容二：locate 命令的选项 1) -b 或者 &#8211;basename 只显示使用指定模式匹配名称的条目2) -c 或者 &#8211;count 只显示找的数量3) -e 或者 &#8211;existing 只显示存在的条目4) -i 或者 &#8211;ignore-case 查找时忽略大小写5) -r 或者 &#8211;regexp 使用正则表达式6) &#8211;regex 使用扩展正则表达式 内容三：locate 命令的案例 3.1 案例一：查找包含 passwd 的文件 3.2 案例二：在 /etc/ 目录下查找以 sh 开头的文件 3.3 案例三：在当前目录下查找以 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/locate/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令 locate （查找文件）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：locate 命令的安装</h3>



<h4>1.1 安装 locate 命令</h4>



<pre class="wp-block-code"><code># dnf install mlocate</code></pre>



<h4>1.2 更新 locate 数据库</h4>



<pre class="wp-block-code"><code># updatedb</code></pre>



<p>（<br>注意：如果不更新 locate 数据库，在使用 locate 命令后可能会报错</p>



<pre class="wp-block-code"><code>locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory</code></pre>



<p>）</p>



<h3>内容二：locate 命令的选项</h3>



<p>1) -b 或者 &#8211;basename 只显示使用指定模式匹配名称的条目<br>2) -c 或者 &#8211;count 只显示找的数量<br>3) -e 或者 &#8211;existing 只显示存在的条目<br>4) -i 或者 &#8211;ignore-case 查找时忽略大小写<br>5) -r 或者 &#8211;regexp 使用正则表达式<br>6) &#8211;regex 使用扩展正则表达式</p>



<h3>内容三：locate 命令的案例</h3>



<h4>3.1 案例一：查找包含 passwd 的文件</h4>



<pre class="wp-block-code"><code># locate passwd</code></pre>



<h4>3.2 案例二：在 /etc/ 目录下查找以 sh 开头的文件</h4>



<pre class="wp-block-code"><code># locate /etc/sh</code></pre>



<h4>3.3 案例三：在当前目录下查找以 r 开头的文件并忽略大小写</h4>



<pre class="wp-block-code"><code># locate -i ~/r</code></pre>



<h4>3.4 案例四：使用正则表达式超找包含 1.txt 或 2.txt 的文件</h4>



<pre class="wp-block-code"><code># locate -r &#91;1-2].txt</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 文件 profile 和 bashrc （用户登录环境的设置）</title>
		<link>https://eternalcenter-sep-2022.github.io/profile-bashrc/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 29 Jul 2022 06:43:12 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege (系统权限)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<category><![CDATA[System User (系统用户)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=27441</guid>

					<description><![CDATA[内容一：profile 文件 1.1 profile 全局文件的位置 （影响所有用户） 1.2 profile 局部文件的位置 （只影响单个用户） 或者： 或者： 1.3 profile 文件的作用 在用户登录时设置用户的环境变量，只在用户登录时才会生效 1.4 登录 Linux 时执行 profile 文件的顺序 第一步，执行： 第二步，按以下顺序一一尝试执行以下 3 个文件中的 1 个，当执行成功后则停止尝试下 1 个文件： 第三步：开始调用解释器 （如果是调用 bash 解释器，则继续执行登录 bash 时执行 bashrc 文件的顺序） 内容二：bashrc 文件 2.1 bashrc 全局文件的位置 （影响所有用户） 或者： 2.2 bashrc 局部文件的位置 （只影响单个用户） 2.3 bashrc 文件的作用 在用户使用 bash 解释器或登录 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/profile-bashrc/" class="more-link">Continue reading<span class="screen-reader-text"> "[内容] Linux 文件 profile 和 bashrc （用户登录环境的设置）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：profile 文件</h3>



<h4>1.1 profile 全局文件的位置 （影响所有用户）</h4>



<pre class="wp-block-code"><code>/etc/profile</code></pre>



<h4>1.2 profile 局部文件的位置 （只影响单个用户）</h4>



<pre class="wp-block-code"><code>~/.bash_profile</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code>~/.bash_login</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code>~/.profile</code></pre>



<h4>1.3 profile 文件的作用</h4>



<p>在用户登录时设置用户的环境变量，只在用户登录时才会生效</p>



<h4>1.4 登录 Linux 时执行 profile 文件的顺序</h4>



<p>第一步，执行：</p>



<pre class="wp-block-code"><code>/etc/profile</code></pre>



<p>第二步，按以下顺序一一尝试执行以下 3 个文件中的 1 个，当执行成功后则停止尝试下 1 个文件：</p>



<pre class="wp-block-code"><code>~/.bash_profile
~/.bash_login
~/.profile</code></pre>



<p>第三步：开始调用解释器</p>



<p>（如果是调用 bash 解释器，则继续执行登录 bash 时执行 bashrc 文件的顺序）</p>



<h3>内容二：bashrc 文件</h3>



<h4>2.1 bashrc 全局文件的位置 （影响所有用户）</h4>



<pre class="wp-block-code"><code>/etc/bashrc</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code>/etc/bash.bashrc</code></pre>



<h4>2.2 bashrc 局部文件的位置 （只影响单个用户）</h4>



<pre class="wp-block-code"><code>~/.bashrc</code></pre>



<h4>2.3 bashrc 文件的作用</h4>



<p>在用户使用 bash 解释器或登录 bash 解释器时设置用户的环境变量，每次调用 bash 解释器时都会生效</p>



<h4>2.4 使用 bash 或登录 bash 时执行 bashrc 文件的顺序</h4>



<p>第一步，执行以下 2 个文件中的 1 个：</p>



<pre class="wp-block-code"><code>/etc/bashrc
/etc/bash.bashrc</code></pre>



<p>第二步，执行：</p>



<pre class="wp-block-code"><code>~/.bashrc</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] audit 的设置 （日志保存时间）</title>
		<link>https://eternalcenter-sep-2022.github.io/audit-log-save-time/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 18 Jul 2022 01:45:08 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26972</guid>

					<description><![CDATA[方法一：通过 audit 配置文件设置 1.1 设置 audit 日志的保存时间 确保部分内容如下： （补充：这里以1) 开启 audit 日志 （local_events = yes） （write_logs = yes）2) 将 audit 日志写入 /var/log/audit/audit.log 文件 （log_file = /var/log/audit/audit.log）3) audit 日志每达到 8M 大小就将旧的 audit 日志进行备份并创建新的 audit 日志 （max_log_file = 8） （max_log_file_action = ROTATE），也可以修改成： max_log_file_action = keep_logs4) 旧的 audit 日志保存 5 份 （num_logs =5）为例） 1.2 让设置的 audit 时间生效 方法二：通过 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/audit-log-save-time/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] audit 的设置 （日志保存时间）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>方法一：通过 audit 配置文件设置</h3>



<h4>1.1 设置 audit 日志的保存时间</h4>



<pre class="wp-block-code"><code># vim /etc/audit/auditd.conf</code></pre>



<p>确保部分内容如下：</p>



<pre class="wp-block-code"><code>......
local_events = yes
......
write_logs = yes
......
log_file = /var/log/audit/audit.log
......
max_log_file = 8
......
num_logs =5
......
max_log_file_action = ROTATE
......</code></pre>



<p>（<br>补充：这里以<br>1) 开启 audit 日志 （local_events = yes） （write_logs = yes）<br>2) 将 audit 日志写入 /var/log/audit/audit.log 文件 （log_file = /var/log/audit/audit.log）<br>3) audit 日志每达到 8M 大小就将旧的 audit 日志进行备份并创建新的 audit 日志 （max_log_file = 8） （max_log_file_action = ROTATE），也可以修改成： max_log_file_action = keep_logs<br>4) 旧的 audit 日志保存 5 份 （num_logs =5）<br>为例<br>）</p>



<h4>1.2 让设置的 audit 时间生效</h4>



<pre class="wp-block-code"><code># service auditd restart</code></pre>



<h3>方法二：通过 logrotate 配置文件设置</h3>



<h4>2.1 设置 audit 日志的保存时间</h4>



<pre class="wp-block-code"><code># vim /etc/logrotate.d/auditd</code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code>/var/log/audit/*
{
rotate 30
daily
missingok
compress
delaycompress
postrotate
touch /var/log/audit/audit.log ||:
chmod 0600 /var/log/audit/audit.log ||:
service auditd restart
endscript
}</code></pre>



<p>（<br>补充：这里以：<br>1) 备份的日志文件保留 30 份 （rotate 30）<br>2) 每天将现在的日志文件进行备份并生成新的日志文件 （dayly）<br>）</p>



<h4>2.2 让设置的 audit 时间生效</h4>



<pre class="wp-block-code"><code># systemctl restart logrotate.service</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 rpm2cpio 和 cpio （提取 RPM 文件 （安装包） 里的子文件）</title>
		<link>https://eternalcenter-sep-2022.github.io/rpm2cpio-cpio/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 07 Jul 2022 10:40:04 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Software (系统软件)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26464</guid>

					<description><![CDATA[内容一：rpm2cpio 命令和 cpio 命令的减价 1.1 rpm2cpio 命令 将 RPM 文件 （安装包） 转换为 cpio 格式 1.2 cpio 命令 从 cpio 格式中的 RPM 文件 （安装包） 中提取子文件 内容二：rpm2cpio 命令和 cpio 命令的格式 内容三：cpio 命令的选项 1) -i 即 copy-in 模式，还原 RPM 文件 （安装包） 里的子文件2) -d 在还原的过程中创建对应的目录3) -v 显示还原的过程 内容四：rpm2cpio 命令的案例 （安装 RPM 文件 （安装包）） 4.1 拷贝要安装的 RPM 文件 （安装包） 到当前目录 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/rpm2cpio-cpio/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令 rpm2cpio 和 cpio （提取 RPM 文件 （安装包） 里的子文件）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：rpm2cpio 命令和 cpio 命令的减价</h3>



<h4>1.1 rpm2cpio 命令</h4>



<p>将 RPM 文件 （安装包） 转换为 cpio 格式</p>



<h4>1.2 cpio 命令</h4>



<p>从 cpio 格式中的 RPM 文件 （安装包） 中提取子文件</p>



<h3>内容二：rpm2cpio 命令和 cpio 命令的格式</h3>



<pre class="wp-block-code"><code># rpm2cpio &lt;RPM file (installation package)&gt; | cpio -idv &lt;absolute path of the file&gt;</code></pre>



<h3>内容三：cpio 命令的选项</h3>



<p>1) -i 即 copy-in 模式，还原 RPM 文件 （安装包） 里的子文件<br>2) -d 在还原的过程中创建对应的目录<br>3) -v 显示还原的过程</p>



<h3>内容四：rpm2cpio 命令的案例 （安装 RPM 文件 （安装包））</h3>



<h4>4.1 拷贝要安装的 RPM 文件 （安装包） 到当前目录</h4>



<p>（步骤略）</p>



<h4>4.2 创建用于提取 RPM 文件 （软件包） 的目录</h4>



<pre class="wp-block-code"><code># mkdir bash</code></pre>



<p>（补充：这里以创建 bash 目录为例）</p>



<h4>4.3 进入用于提取 RPM 文件 （软件包） 的目录</h4>



<pre class="wp-block-code"><code># cd bash</code></pre>



<p>（补充：这里以进入 bash 目录为例）</p>



<h4>4.4 提取 RPM 文件 （安装包） 里的子文件</h4>



<pre class="wp-block-code"><code># rpm2cpio ../bash-4.3-83.23.1.x86_64.rpm | cpio -ivd</code></pre>



<p>（补充：这里以提取 bash-4.3-83.23.1.x86_64.rpm RPM 文件 （安装包） 为例）</p>



<h4>4.5 显示提取 RPM 文件 （安装包） 子文件后的目录</h4>



<pre class="wp-block-code"><code># ls
bin etc usr</code></pre>



<h4>4.6 在当前目录将提取的子文件拷贝到 /bin 目录</h4>



<pre class="wp-block-code"><code># cp -rpv bin/* /bin
'bin/bash' -&gt; '/bin/bash'
'bin/sh' -&gt; '/bin/sh'</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] audit 日志时间格式的转换</title>
		<link>https://eternalcenter-sep-2022.github.io/time-format-conversion/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 07 Jul 2022 08:00:02 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[Storage Service (存储服务)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26438</guid>

					<description><![CDATA[步骤一：创建用于 audit 转换日志时间格式的脚本 创建以下内容： （补充：这里以创建名为 time_format_conversion.pl 的用于转换 audit 日志时间格式的脚本为例） 步骤二：转换 audit 日志时间格式 或者： 或者： 或者： 或者： 或者： （补充：这里以使用名为 time_format_conversion.pl 的用于转换 audit 日志时间格式的脚本为例）]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：创建用于 audit 转换日志时间格式的脚本</h3>



<pre class="wp-block-code"><code># vim time_format_conversion.pl</code></pre>



<p>创建以下内容：</p>



<pre class="wp-block-code"><code>s/(1\d{9})/localtime($1)/e</code></pre>



<p>（补充：这里以创建名为 time_format_conversion.pl 的用于转换 audit 日志时间格式的脚本为例）</p>



<h3>步骤二：转换 audit 日志时间格式</h3>



<pre class="wp-block-code"><code># cat /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># less /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># more /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># head /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># tail /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># tail -f /var/log/audit/audit.log | perl -p time_format_conversion.pl</code></pre>



<p>（补充：这里以使用名为 time_format_conversion.pl 的用于转换 audit 日志时间格式的脚本为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 dd （读取内容并进行完整复制）</title>
		<link>https://eternalcenter-sep-2022.github.io/dd/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 06 Jul 2022 15:17:59 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26430</guid>

					<description><![CDATA[内容一：dd 命令介绍 1.1 dd 命令简介 dd 是 device driver 单词的缩写，主要用于读取内容并进行完整复制，甚至可以直接复制系统环境 1.2 dd 命令的选项 1) bs= 同时设置单次输入或单词输出的数据块 （block） 的大小为 个字节，此选项也可以使用 ibs 选项设置单次输入和 obs 选项来分别设置单词输出。2) ibs= 设置单次输入的数据块 （block） 的大小为 个字节，默认为 512 字节3) obs= 设置单次输出的数据块 （block） 的大小为 个字节，默认为 512 字节4) count= 设置总共要复制的数据块数量为 N 个数量 1.3 可配合 dd 命令使用的文件 1) /dev/null 空设备，任何进入此文件的数据都会被删除，一般用于删除输出内容2) /dev/zero 二进制的零流，可以连续不断地产生二进制零流，一般用于对设备和文件进行初始化3) /dev/urandom 随机数流，可以连续不断地产生随机数流，一般用于清除机密数据，用随机的数据完全覆盖磁盘 内容二：dd 命令的案例 2.1 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/dd/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令 dd （读取内容并进行完整复制）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：dd 命令介绍</h3>



<h4>1.1 dd 命令简介</h4>



<p>dd 是 device driver 单词的缩写，主要用于读取内容并进行完整复制，甚至可以直接复制系统环境</p>



<h4>1.2 dd 命令的选项</h4>



<p>1) bs= 同时设置单次输入或单词输出的数据块 （block） 的大小为 个字节，此选项也可以使用 ibs 选项设置单次输入和 obs 选项来分别设置单词输出。<br>2) ibs= 设置单次输入的数据块 （block） 的大小为 个字节，默认为 512 字节<br>3) obs= 设置单次输出的数据块 （block） 的大小为 个字节，默认为 512 字节<br>4) count= 设置总共要复制的数据块数量为 N 个数量</p>



<h4>1.3 可配合 dd 命令使用的文件</h4>



<p>1) /dev/null 空设备，任何进入此文件的数据都会被删除，一般用于删除输出内容<br>2) /dev/zero 二进制的零流，可以连续不断地产生二进制零流，一般用于对设备和文件进行初始化<br>3) /dev/urandom 随机数流，可以连续不断地产生随机数流，一般用于清除机密数据，用随机的数据完全覆盖磁盘</p>



<h3>内容二：dd 命令的案例</h3>



<h4>2.1 与分区相关的案例</h4>



<h5>2.1.1 案例一：备份分区</h5>



<pre class="wp-block-code"><code># dd if=/dev/sda1 of=/root/sda1_backup.img</code></pre>



<p>（补充：这里以将分区 /dev/sda1 备份成文件 /root/sda1_backup.img 为例）</p>



<h5>2.1.2 案例二：还原分区</h5>



<pre class="wp-block-code"><code># dd if=/root/sda1_backup.img of=/dev/sda1</code></pre>



<p>（补充：这里以将文件 /root/sda1_backup.img 还原到分区 /dev/sda1 为例）</p>



<h5>2.1.3 案例三：复制分区</h5>



<pre class="wp-block-code"><code># dd if=/dev/sda1 of=/dev/sda2</code></pre>



<p>（补充：这里以将分区 /dev/sda1 复制到分区 /dev/sda2 为例）</p>



<h4>2.2 与硬盘相关的案例</h4>



<h5>2.2.1 案例一：备份硬盘</h5>



<pre class="wp-block-code"><code># dd if=/dev/sda of=/root/sda_backup.img</code></pre>



<p>（补充：这里以将硬盘 /dev/sda 备份成文件 /root/sda_backup.img 为例）</p>



<h5>2.2.2 案例二：还原硬盘</h5>



<pre class="wp-block-code"><code># dd if=/root/sda_backup.img of=/dev/sda</code></pre>



<p>（补充：这里以将文件 /root/sda_backup.img 还原到硬盘 /dev/sda1 为例）</p>



<h5>2.2.3 案例三：复制硬盘</h5>



<pre class="wp-block-code"><code># dd if=/dev/sda of=/dev/sdb</code></pre>



<p>（补充：这里以将硬盘 /dev/sda 复制到硬盘 /dev/sdb 为例）</p>



<h4>2.3 与内存相关的案例</h4>



<h5>2.3.1 案例一：备份内存</h5>



<pre class="wp-block-code"><code># dd if=/dev/meme of=/root/mem_backup.img</code></pre>



<p>（补充：这里以将内存备份成文件 /root/mem_backup.img 为例）</p>



<h5>2.3.2 案例二：还原内存</h5>



<pre class="wp-block-code"><code># dd if=/root/mem_backup.img of=/dev/meme</code></pre>



<p>（补充：这里以将文件 /root/mem_backup.img 还原到内存为例）</p>



<h4>2.4 与软盘相关的案例</h4>



<h5>2.4.1 案例一：备份软盘</h5>



<pre class="wp-block-code"><code># dd if=/dev/fd0 of=/root/fd0_backup.img count=1 bs=1440k</code></pre>



<p>（补充：这里以将软盘备份成文件 /root/fd0_backup.img 为例）</p>



<h5>2.4.2 案例二：还原软盘</h5>



<pre class="wp-block-code"><code># dd if=/root/fd0_backup.img of=/dev/fd0 count=1 bs=1440k</code></pre>



<p>（补充：这里以将文件 /root/fd0_backup.img 还原到软盘为例）</p>



<h4>2.5 与光盘相关的案例</h4>



<h5>2.5.1 案例一：备份光盘</h5>



<pre class="wp-block-code"><code># dd if=/dev/cdrom of=/root/cd_backup.img</code></pre>



<p>（补充：这里以将光盘备份成文件 /root/cd_backup.img 为例）</p>



<h5>2.5.2 案例二：还原光盘</h5>



<pre class="wp-block-code"><code># dd if=/root/cd_backup.img of=/dev/cdrom</code></pre>



<p>（补充：这里以将文件 /root/cd_backup.img 还原到光盘为例）</p>



<h4>2.6 与预估硬盘性能相关的案例</h4>



<h5>2.6.1 案例一：预估硬盘写入性能</h5>



<pre class="wp-block-code"><code># dd if=/dev/zero bs=1024 count=1000000 of=/root/1GB.file</code></pre>



<p>（补充：这里以生成 1 个 1 GB 大小的文件，根据生成时间判断文件大小为例）</p>



<h5>2.6.2 案例二：预估硬盘读取性能</h5>



<pre class="wp-block-code"><code># dd if=/root/1GB.file bs=64k | dd of=/dev/null</code></pre>



<p>（补充：这里以读取 1 个 1 GB 大小的文件，根据读取时间判断文件大小为例）</p>



<h5>2.6.3 案例三：预估多大的块大小写入性能最佳</h5>



<p>（分别执行以下命令）</p>



<pre class="wp-block-code"><code># time dd if=/dev/zero bs=1024 count=1000000 of=/root/1GB.file</code></pre>



<pre class="wp-block-code"><code># time dd if=/dev/zero bs=2048 count=500000 of=/root/1GB.file</code></pre>



<pre class="wp-block-code"><code># time dd if=/dev/zero bs=4096 count=250000 of=/root/1GB.file</code></pre>



<p>（补充：这里以分别生成 1024、2048 和 4096 块大小的 1 GB 大小的文件，根据生成时间判断多大的块大小写入性能最佳为例）</p>



<h4>2.7 与清除机密数据相关的案例</h4>



<pre class="wp-block-code"><code># dd if=/dev/urandom of=/dev/sda</code></pre>



<p>（补充：这里以清除硬盘 /dev/sda 上的机密数据为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] 文件或目录的监控 （audit 版）</title>
		<link>https://eternalcenter-sep-2022.github.io/monitor-directory-file-audit/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Tue, 05 Jul 2022 10:18:15 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System General Log (系统普通日志)]]></category>
		<category><![CDATA[System Log (系统日志)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege (系统权限)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Security Log (系统安全日志)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26264</guid>

					<description><![CDATA[步骤一：使用 audit 监控文件或目录 1.1 在 audit 的策略里添加要监控的目录或文件 1.1.1 案例一：监控某个目录以及目录下的目录和文件 添加以下内容： （补充：这里以监控目录 /tmp 里的目录和文件为例） 1.1.2 案例二：监控某个文件 添加以下内容： （补充：这里以监控目录 /dev/null 文件为例） 1.2 让监控目录或文件的配置生效 步骤二：显示 audit 监控记录 （补充：记录里的1) nametype=CREATE 字段代表创建2) nametype=NORMAL 字段代表普通3) nametype=DELETE 字段代表删除） 或者： （补充：这里以显示文件被修改的记录为例）]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：使用 audit 监控文件或目录</h3>



<h4>1.1 在 audit 的策略里添加要监控的目录或文件</h4>



<h5>1.1.1 案例一：监控某个目录以及目录下的目录和文件</h5>



<pre class="wp-block-code"><code># vim /etc/audit/rules.d/audit.rules</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
-a exit,always -F dir=/tmp -F perm=rwxa</code></pre>



<p>（补充：这里以监控目录 /tmp 里的目录和文件为例）</p>



<h5>1.1.2 案例二：监控某个文件</h5>



<pre class="wp-block-code"><code># vim /etc/audit/rules.d/audit.rules</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
-a exit,always -S unlink -S unlinkat -S rmdir -S rename -S renameat -F path=/dev/null</code></pre>



<p>（补充：这里以监控目录 /dev/null 文件为例）</p>



<h4>1.2 让监控目录或文件的配置生效</h4>



<pre class="wp-block-code"><code># service auditd restart</code></pre>



<h3>步骤二：显示 audit 监控记录</h3>



<pre class="wp-block-code"><code># cat /var/log/audit</code></pre>



<p>（<br>补充：记录里的<br>1) nametype=CREATE 字段代表创建<br>2) nametype=NORMAL 字段代表普通<br>3) nametype=DELETE 字段代表删除<br>）</p>



<p>或者：</p>



<pre class="wp-block-code"><code># sudo ausearch -i -k user-modify</code></pre>



<p>（补充：这里以显示文件被修改的记录为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux tr 命令 （内容替换）</title>
		<link>https://eternalcenter-sep-2022.github.io/tr/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 24 Jun 2022 13:58:41 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[Language (语言)]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Shell Basic (基础)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26148</guid>

					<description><![CDATA[内容一：tr 命令的简介 1.1 tr 命令的格式 1.2 tr 命令的原理 将 &#60;section 1&#62; 里的内容替换成 &#60;section 2&#62; 里的内容 内容二：tr 命令的选项 1) -c 或者 &#8211;complement 改变除了某内容外的所有内容2) -d 或者 &#8211;delete 删除某内容3) -s 或者 &#8211;squeeze-repeats 将相临重复的某个字符缩减成 1 个4) -t 或者 &#8211;truncate-set1 将 &#60;section 1&#62; 里的内容缩减成和 &#60;section 2&#62; 里的内容一样长 内容三：tr 命令的参数 1) \ 反斜杠2) \b 退格3) \f 换页4) \n 换行5) \r 回车6) &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/tr/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux tr 命令 （内容替换）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：tr 命令的简介</h3>



<h4>1.1 tr 命令的格式</h4>



<pre class="wp-block-code"><code># tr &lt;option&gt; &lt;section 1&gt; &lt;sectiong 2&gt;</code></pre>



<h4>1.2 tr 命令的原理</h4>



<p>将 &lt;section 1&gt; 里的内容替换成 &lt;section 2&gt; 里的内容</p>



<h3>内容二：tr 命令的选项</h3>



<p>1) -c 或者 &#8211;complement 改变除了某内容外的所有内容<br>2) -d 或者 &#8211;delete 删除某内容<br>3) -s 或者 &#8211;squeeze-repeats 将相临重复的某个字符缩减成 1 个<br>4) -t 或者 &#8211;truncate-set1 将 &lt;section 1&gt; 里的内容缩减成和 &lt;section 2&gt; 里的内容一样长</p>



<h3>内容三：tr 命令的参数</h3>



<p>1) \ 反斜杠<br>2) \b 退格<br>3) \f 换页<br>4) \n 换行<br>5) \r 回车<br>6) \t 水平制表符<br>7) \v 垂直制表符<br>8) &lt;character 1&gt;-&lt;character 2&gt; 从某个字符到另 1 个字符，例如：a-z、a-Z、0-9<br>9) [&lt;character&gt;*] 在 &lt;section 2&gt; 中可用，&lt;character&gt; 会复制得和 &lt;section 1&gt; 中一样长<br><em>10) </em>[&lt;character&gt;*&lt;frequency&gt;] 将 &lt;character&gt; 复制 &lt;frequency&gt; 次，若以 0 开头，则视为八进制<br>11 [:alnum:] 所有字母和数字<br>12 [:alpha:] 所有字母<br>13 [:blank:] 所有呈水平排列的空白字符<br>14 [:cntrl:] 所有控制字符<br>15 [:digit:] 所有数字<br>16 [:graph:] 所有可打印字符，但不包括空格<br>17 [:lower:] 所有小写字母<br>18 [:print:] 所有可打印字符，包括空格<br>19 [:punct:] 所有标点字符<br>20 [:space:] 所有呈水平或垂直排列的空白字符<br>21 [:upper:] 所有大写字母<br>22 [:xdigit:] 所有十六进制数<br>23 [=字符=] 所有和指定字符相等的字符</p>



<h3>内容三：tr 命令的案例</h3>



<h4>3.1 案例一：替换某内容外的所有内容</h4>



<pre class="wp-block-code"><code># echo 'zmyb' | tr -c zmy a
zmyaa</code></pre>



<p>（补充：这里以将内容 zmyb 中 zmy 以外的内容替换成内容 a 为例）</p>



<p>（注意：zmyb 后面还有一个结尾符号，所以结果会多 1 个内容 a）</p>



<h4>3.2 案例二：删除某内容</h4>



<pre class="wp-block-code"><code># echo 'zmy' | tr -d m
zy</code></pre>



<p>（补充：这里以删除内容 zmy 中的内容 m 为例）</p>



<h4>3.3 案例三：将相临重复的某个字符缩减成 1 个</h4>



<pre class="wp-block-code"><code># echo zmmy | tr -s m
zmy</code></pre>



<p>（补充：这里以将内容 zmmy 中多个字符 m 压缩成 1 个为例）</p>



<h4>3.4 案例四：替换字符，并将要匹配的内容缩减成和要替换的内容一样长</h4>



<p>如果是正常情况：</p>



<pre class="wp-block-code"><code>zhumingyu@laptop:~/Test&gt; echo abeabe | tr ab c
ccecce</code></pre>



<p>（补充：这里以将内容 abeabe 中的内容 ab 替换成内容 c 为例）</p>



<p>如果是缩减的情况</p>



<pre class="wp-block-code"><code>zhumingyu@laptop:~/Test&gt; echo abeabe | tr -t ab c
cbecbe</code></pre>



<p>（补充：这里以将内容 abeabe 中的内容 a 替换成内容 c 为例）</p>



<p>（注意：这里 tr -t ab c 中内容 c 是 1 个字符，所以内容 ab 会被压缩成 1 个字符 a）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 lsof （显示进程）</title>
		<link>https://eternalcenter-sep-2022.github.io/lsof/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 23 Jun 2022 10:06:50 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Performance (系统性能)]]></category>
		<category><![CDATA[System Process (系统进程)]]></category>
		<category><![CDATA[System Process & System Performance (系统进程 & 系统性能)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<category><![CDATA[System User (系统用户)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=26135</guid>

					<description><![CDATA[内容一：lsof 命令输出结果 内容二：lsof 命令输出结果简介 1) COMMAND 进程名2) PID （Process Id） PID 号3) USER 用户4) FD 文件描述信息（补充：cwd 代表当前目录，txt 代表 txt 文件，rtd 代表 root 目录，mem 代表内存映射文件）5) TYPE 文件类型（补充：DIR 代表当前目录，REG 代表普通文件，CHR 代表字符，a_inode 代表 Inode 文件，FIFO 代表管道或者 socket文件，netlink 代表网络，unkonwn 代表未知）6) DEVICE 设备 ID7) SIZE/OFF 进程大小8) NODE 文件的 Inode 号9) NAME 路径或链接 内容三：lsof 使用案例 3.1 案例一：显示已经被删除的文件 3.2 案例二：显示用户已打开的案例 3.2.1 显示某用户已打开的文件 &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/lsof/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令 lsof （显示进程）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：lsof 命令输出结果</h3>



<pre class="wp-block-code"><code># lsof | more
COMMAND     PID   TID    USER   FD      TYPE             DEVICE  SIZE/OFF       NODE NAME
systemd       1          root  cwd       DIR              251,1      4096          1 /
......</code></pre>



<h3>内容二：lsof 命令输出结果简介</h3>



<p>1) COMMAND 进程名<br>2) PID （Process Id） PID 号<br>3) USER 用户<br>4) FD 文件描述信息<br>（补充：cwd 代表当前目录，txt 代表 txt 文件，rtd 代表 root 目录，mem 代表内存映射文件）<br>5) TYPE 文件类型<br>（补充：DIR 代表当前目录，REG 代表普通文件，CHR 代表字符，a_inode 代表 Inode 文件，FIFO 代表管道或者 socket文件，netlink 代表网络，unkonwn 代表未知）<br>6) DEVICE 设备 ID<br>7) SIZE/OFF 进程大小<br>8) NODE 文件的 Inode 号<br>9) NAME 路径或链接</p>



<h3>内容三：lsof 使用案例</h3>



<h4>3.1 案例一：显示已经被删除的文件</h4>



<pre class="wp-block-code"><code># lsof | grep deleted</code></pre>



<h4>3.2 案例二：显示用户已打开的案例</h4>



<h5>3.2.1 显示某用户已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -u zhumingyu mingyuzhu</code></pre>



<p>（补充：这里以显示用户 zhumingyu 和 mingyuzhu 已打开的文件为例）</p>



<h5>3.2.2 不显示某用户已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -u mingyuzhu</code></pre>



<p>（补充：这里以不显示用户 mingyuzhu 已打开的文件为例）</p>



<h4>3.3 案例三：显示进程已打开的文件</h4>



<h5>3.3.1 显示某进程已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -p 1024</code></pre>



<p>（补充：这里以显示 PID 号是 1024 已打开的文件为例）</p>



<h5>3.3.2 不显示某进程已打开的所有文件</h5>



<pre class="wp-block-code"><code># lsof -p ^1024</code></pre>



<p>（补充：这里以不显示 PID 号是 1024 已打开的文件为例）</p>



<h5>3.3.3 显示某几个进程已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -p 1,2,3</code></pre>



<p>（补充：这里以显示 PID 号是 1、2 和 3 已打开的文件为例）</p>



<h4>3.4 案例四：显示已打开的网络文件</h4>



<h5>3.4.1 显示所有已打开的网络文件</h5>



<pre class="wp-block-code"><code># lsof -i</code></pre>



<h5>3.4.2 显示所有 IPv4 协议已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i 4</code></pre>



<h5>3.4.3 显示所有 IPv6 协议已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i 6</code></pre>



<h5>3.4.4 显示所有 TCP 协议已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i TCP</code></pre>



<h5>3.4.5 显示所有 TCP 协议已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i UDP</code></pre>



<h5>3.4.6 显示某个 TCP 端口或者 UDP 端口已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i:22</code></pre>



<p>（补充：这里以显示 TCP 或者 UPD 的 22 端口已打开的文件为例）</p>



<h5>3.4.7 显示某个 TCP 端口已打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i TCP:22</code></pre>



<p>（补充：这里以显示 TCP 的 22 端口已打开的文件为例）</p>



<h5>3.4.8 显示某几个 TCP 端口打开的文件</h5>



<pre class="wp-block-code"><code># lsof -i TCP:1-1024</code></pre>



<p>（补充：这里以显示 TCP 的 1 端口到 1024 端口打开的文件为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 xz （打包、解包、压缩和解压文件）</title>
		<link>https://eternalcenter-sep-2022.github.io/xz/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 11 Jun 2022 12:29:30 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23814</guid>

					<description><![CDATA[内容一：压缩并创建 （压缩） 包 （文件） 1.1 压缩并创建 （压缩） 包 （文件） （不保留原文件） 1.1.1 压缩并创建 （压缩） 包 （某 1 个文件） （不保留原文件） （补充：压缩后的文件会以 xz 后缀结尾） 1.1.2 压缩并创建 （压缩） 包 （某几个文件） （不保留原文件） （补充：压缩后的文件会各自以 xz 后缀结尾） 1.2 压缩并创建 （压缩） 包 （文件） （保留原文件） 1.2.1 压缩并创建 （压缩） 包 （某 1 个文件） （保留原文件） （补充：压缩后的文件会以 xz 后缀结尾） 1.2.2 压缩并创建 （压缩） 包 （某几个文件） （保留原文件） （补充：压缩后的文件会各自以 xz &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/xz/" class="more-link">Continue reading<span class="screen-reader-text"> "[命令] Linux 命令 xz （打包、解包、压缩和解压文件）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>内容一：压缩并创建 （压缩） 包 （文件）</h3>



<h4>1.1 压缩并创建 （压缩） 包 （文件） （不保留原文件）</h4>



<h5>1.1.1 压缩并创建 （压缩） 包 （某 1 个文件） （不保留原文件）</h5>



<pre class="wp-block-code"><code># xz -z &lt;file&gt;</code></pre>



<p>（补充：压缩后的文件会以 xz 后缀结尾）</p>



<h5>1.1.2 压缩并创建 （压缩） 包 （某几个文件） （不保留原文件）</h5>



<pre class="wp-block-code"><code># xz -z &lt;file 1&gt; &lt;file 2&gt; &lt;file 3&gt; ......</code></pre>



<p>（补充：压缩后的文件会各自以 xz 后缀结尾）</p>



<h4>1.2 压缩并创建 （压缩） 包 （文件） （保留原文件）</h4>



<h5>1.2.1 压缩并创建 （压缩） 包 （某 1 个文件） （保留原文件）</h5>



<pre class="wp-block-code"><code># xz -zk &lt;file&gt;</code></pre>



<p>（补充：压缩后的文件会以 xz 后缀结尾）</p>



<h5>1.2.2 压缩并创建 （压缩） 包 （某几个文件） （保留原文件）</h5>



<pre class="wp-block-code"><code># xz -zk &lt;file 1&gt; &lt;file 2&gt; &lt;file 3&gt; ......</code></pre>



<p>（补充：压缩后的文件会各自以 xz 后缀结尾）</p>



<h3> 内容二：解压 （压缩） 包</h3>



<h4>2.1 解压 （压缩） 包 （不保留原文件）</h4>



<h5>2.1.1 解压 （压缩） 包 （某 1 个 （压缩） 包） （不保留原 （压缩） 包）</h5>



<pre class="wp-block-code"><code># xz -d &lt;(compressed) package&gt;</code></pre>



<p>（注意：可以用 xz 命令解压的压缩包会以 xz 后缀结尾）</p>



<h5>2.1.2 解压 （压缩） 包 （某几个 （压缩） 包） （不保留原 （压缩） 包）</h5>



<pre class="wp-block-code"><code># xz -d &lt;(compressed) package 1&gt; &lt;(compressed) package 2&gt; &lt;(compressed) package 3&gt; ......</code></pre>



<p>（补充：解压后的文件会各自去掉 xz 后缀）</p>



<p>（注意：可以用 xz 命令解压的压缩包会以 xz 后缀结尾）</p>



<h4>2.2 解压 （压缩） 包 （保留原文件）</h4>



<h5>2.2.1 解压 （压缩） 包 （某 1 个 （压缩） 包） （保留原文件）</h5>



<pre class="wp-block-code"><code># xz -dk &lt;(compressed) package&gt;</code></pre>



<p>（注意：可以用 xz 命令解压的压缩包会以 xz 后缀结尾）</p>



<h5>2.2.2 解压 （压缩） 包 （某几个 （压缩） 包） （保留原文件）</h5>



<pre class="wp-block-code"><code># xz -dk &lt;(compressed) package 1&gt; &lt;(compressed) package 2&gt; &lt;(compressed) package 3&gt; ......</code></pre>



<p>（补充：解压后的文件会各自去掉 xz 后缀）</p>



<p>（注意：可以用 xz 命令解压的压缩包会以 xz 后缀结尾）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 目录的重新挂载</title>
		<link>https://eternalcenter-sep-2022.github.io/remount/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Thu, 09 Jun 2022 11:16:53 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23734</guid>

					<description><![CDATA[内容一：手动重新挂载目录 （补充：这里以带 nosuid、nodev 和 noexec 参数重新挂载 /dev/shm 目录为例） 内容二：开机自动重新挂载目录 添加以下内容： （补充：这里以带 nosuid、nodev 和 noexec 参数重新挂载 /dev/shm 目录为例）]]></description>
										<content:encoded><![CDATA[
<h3>内容一：手动重新挂载目录</h3>



<pre class="wp-block-code"><code># mount -o remount,nosuid,nodev,noexec /dev/shm</code></pre>



<p>（补充：这里以带 nosuid、nodev 和 noexec 参数重新挂载 /dev/shm 目录为例）</p>



<h3>内容二：开机自动重新挂载目录</h3>



<pre class="wp-block-code"><code># vim /etc/fstab</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
tmpfs /dev/shm tmpfs defaults,nosuid,nodev,noexec 0 0</code></pre>



<p>（补充：这里以带 nosuid、nodev 和 noexec 参数重新挂载 /dev/shm 目录为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[内容] Linux 某个所属组里有哪些用户的显示</title>
		<link>https://eternalcenter-sep-2022.github.io/group-display/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Wed, 08 Jun 2022 02:50:05 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Login Security (系统登录安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Privilege (系统权限)]]></category>
		<category><![CDATA[System Privilege Security (系统权限安全)]]></category>
		<category><![CDATA[System Process Security (系统进程安全)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<category><![CDATA[System User (系统用户)]]></category>
		<category><![CDATA[System User & System Privilege (系统用户 & 系统权限)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23715</guid>

					<description><![CDATA[方法一：通过 /etc/group 配置文件显示某个附属所属组里有哪些用户 （注意：此方法并不能显示出把这些所属组当作主要所属组的用户） 方法二：通过 /etc/passwd 配置文件和 id 命令等显示主要所属组和附属所属组 （补充：可以通过肉眼比对此命令的输出结果来判断其主要所属组和附属所属组）]]></description>
										<content:encoded><![CDATA[
<h3>方法一：通过 /etc/group 配置文件显示某个附属所属组里有哪些用户</h3>



<pre class="wp-block-code"><code># cat /etc/group</code></pre>



<p>（注意：此方法并不能显示出把这些所属组当作主要所属组的用户）</p>



<h3>方法二：通过 /etc/passwd 配置文件和 id 命令等显示主要所属组和附属所属组</h3>



<pre class="wp-block-code"><code># for i in `cat /etc/passwd | egrep -v "nologin$|false$|half|sync|shutdown|halt" | awk -F: '{print $1}'`; do id $i; done | sort -k2</code></pre>



<p>（补充：可以通过肉眼比对此命令的输出结果来判断其主要所属组和附属所属组）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 软硬链接保护的开启 （防止通过软硬链接执行无权限执行的文件）</title>
		<link>https://eternalcenter-sep-2022.github.io/opening-of-soft-and-hard-link-protection/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 14 May 2022 14:41:31 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23561</guid>

					<description><![CDATA[步骤一：开启软硬链接保护 1.1 修改 /etc/sysctl.conf 文件 添加以下内容： 1.2 设置系统正在运行的 fs.protected_symlinks 参数和 fs.protected_hardlinks 参数 步骤二：显示软硬链接保护的开启状态 2.1 显示 /etc/sysctl.conf 文件里的 fs.protected_symlinks 参数和 fs.protected_hardlinks 参数 2.2 显示系统正在运行的 fs.protected_symlinks 参数和 fs.protected_hardlinks 参数]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：开启软硬链接保护</h3>



<h4>1.1 修改 /etc/sysctl.conf 文件</h4>



<pre class="wp-block-code"><code># vim /etc/sysctl.conf</code></pre>



<p>添加以下内容：</p>



<pre class="wp-block-code"><code>......
fs.protected_hardlinks = 1
fs.protected_symlinks = 1</code></pre>



<h4>1.2 设置系统正在运行的 fs.protected_symlinks 参数和 fs.protected_hardlinks 参数</h4>



<pre class="wp-block-code"><code># sysctl -w fs.protected_symlinks = 1
# sysctl -w fs.protected_hardlinks = 1</code></pre>



<h3>步骤二：显示软硬链接保护的开启状态</h3>



<h4>2.1 显示 /etc/sysctl.conf 文件里的 fs.protected_symlinks 参数和 fs.protected_hardlinks 参数</h4>



<pre class="wp-block-code"><code># grep "fs\.protected_hardlinks" /etc/sysctl.conf /etc/sysctl.d/*
fs.protected_hardlinks = 1</code></pre>



<pre class="wp-block-code"><code># grep "fs\.protected_symlinks" /etc/sysctl.conf /etc/sysctl.d/*
fs.protected_symlinks = 1</code></pre>



<h4>2.2 显示系统正在运行的 fs.protected_symlinks 参数和 fs.protected_hardlinks 参数</h4>



<pre class="wp-block-code"><code># sysctl fs.protected_symlinks
fs.protected_symlinks = 1
# sysctl fs.protected_hardlinks
fs.protected_hardlinks = 1</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[排错] 解决 Linux 运行 gzip 命令时报错 “gzip: &#8230;&#8230;.xz: unknown suffix &#8212; ignored”</title>
		<link>https://eternalcenter-sep-2022.github.io/debug-gzip-wtmp-xz-unknown-suffix-ignored/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 29 Apr 2022 13:37:57 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23417</guid>

					<description><![CDATA[报错代码 解决方法]]></description>
										<content:encoded><![CDATA[
<h2>报错代码</h2>



<pre class="wp-block-code"><code>gzip: .......xz: unknown suffix -- ignored</code></pre>



<h2>解决方法</h2>



<pre class="wp-block-code"><code># xz -d &lt;file&gt;</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[排错] 解决 Linux 运行 tar 命令时报错 “tar: This does not look like a tar archive”</title>
		<link>https://eternalcenter-sep-2022.github.io/debug-tar-this-does-not-look-like-a-tar-archive/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 11 Apr 2022 15:06:31 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=23010</guid>

					<description><![CDATA[报错代码 解决方法 或者：]]></description>
										<content:encoded><![CDATA[
<h2>报错代码</h2>



<pre class="wp-block-code"><code>tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors</code></pre>



<h2>解决方法</h2>



<pre class="wp-block-code"><code># gzip -d &lt;file&gt;</code></pre>



<p>或者：</p>



<pre class="wp-block-code"><code># xz -d &lt;file&gt;</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 paster (将多个文件里内容合并，后 1 个文件里的每 1 行内容添加到前 1 个文件里对应每 1 行内容的后面)</title>
		<link>https://eternalcenter-sep-2022.github.io/paster/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sat, 26 Mar 2022 14:24:27 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=22444</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code># paste &lt;first file> &lt;second file> ......</code></pre>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[命令] Linux 命令 uniq （文件里字符重复的管理）</title>
		<link>https://eternalcenter-sep-2022.github.io/uniq/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Fri, 26 Nov 2021 14:17:52 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System Operation (系统操作)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=19136</guid>

					<description><![CDATA[案例一：uniq 命令去重 （补充：这里以给 test.txt 文件里的字符为例） 案例二：uniq 只显示重复的行 （补充：这里以只显示 test.txt 文件里重复的行为例） 案例三：uniq 只显示不重复的行 （补充：这里以只显示 test.txt 文件里不重复的行为例） 案例四：显示每个字符出现的次数 （补充：这里以显示 test.txt 每个字符出现的次数为例）]]></description>
										<content:encoded><![CDATA[
<h3>案例一：uniq 命令去重</h3>



<pre class="wp-block-code"><code># cat test.txt 
a1
b2
c3
a1
d2
e3
a1
c3

# sort test.txt  | uniq
a1
b2
c3
d2
e3</code></pre>



<p>（补充：这里以给 test.txt 文件里的字符为例）</p>



<h3>案例二：uniq 只显示重复的行</h3>



<pre class="wp-block-code"><code># cat test.txt 
a1
b2
c3
a1
d2
e3
a1
c3

# sort test.txt  | uniq -d
a1
c3</code></pre>



<p>（补充：这里以只显示 test.txt 文件里重复的行为例）</p>



<h3>案例三：uniq 只显示不重复的行</h3>



<pre class="wp-block-code"><code># cat test.txt 
a1
b2
c3
a1
d2
e3
a1
c3

# sort test.txt  | uniq -u
b2
d2
e3</code></pre>



<p>（补充：这里以只显示 test.txt 文件里不重复的行为例）</p>



<h3>案例四：显示每个字符出现的次数</h3>



<pre class="wp-block-code"><code># cat test.txt 
a1
b2
c3
a1
d2
e3
a1
c3

# sort test.txt  | uniq -c
      3 a1
      1 b2
      2 c3
      1 d2
      1 e3</code></pre>



<p>（补充：这里以显示 test.txt 每个字符出现的次数为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 加密压缩 （tar 版）</title>
		<link>https://eternalcenter-sep-2022.github.io/encryption-compression-tar/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 15 Nov 2021 15:52:52 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=18392</guid>

					<description><![CDATA[步骤一：创建测试文件 （补充：这里以创建 test.txt 文件为例） 步骤二：加密压缩文件或目录 2.1 交互式加密压缩文件或目录 （补充：1) 这里以将 test.txt 文件加密压缩成 test1.tar.gz （压缩）包为例2) 如果要以 bzip2 的格式进行压缩，则将命令中的 -zcf 换成 -jcvf 将 test1.tar.gz 换成 test1.tar.bz23) 如果要以 xz 的格式进行压缩，则将命令中的 -zcf 换成 -Jcvf 将 test1.tar.gz 换成 test1.tar.xz） 2.2 非交互式加密压缩文件或目录 （补充：1) 这里以将 test.txt 文件加密压缩成 test1.tar.gz （压缩）包并且将密码设置为 eternalcenter 为例2) 如果要以 bzip2 的格式进行压缩，则将命令中的 -zcf 换成 -jcvf 将 test1.tar.gz 换成 test2.tar.bz23) 如果要以 xz &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/encryption-compression-tar/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] Linux 加密压缩 （tar 版）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：创建测试文件</h3>



<pre class="wp-block-code"><code># touch test.txt</code></pre>



<p>（补充：这里以创建 test.txt 文件为例）</p>



<h3>步骤二：加密压缩文件或目录</h3>



<h4>2.1 交互式加密压缩文件或目录</h4>



<pre class="wp-block-code"><code># tar -zcf - test.txt | openssl des3 -salt | dd of=test1.tar.gz
enter des-ede3-cbc encryption password:
Verifying - enter des-ede3-cbc encryption password:
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
0+1 records in
0+1 records out
224 bytes copied, 7.04902 s, 0.0 kB/s</code></pre>



<p>（<br>补充：<br>1) 这里以将 test.txt 文件加密压缩成 test1.tar.gz （压缩）包为例<br>2) 如果要以 bzip2 的格式进行压缩，则将命令中的 -zcf 换成 -jcvf 将 test1.tar.gz 换成 test1.tar.bz2<br>3) 如果要以 xz 的格式进行压缩，则将命令中的 -zcf 换成 -Jcvf 将 test1.tar.gz 换成 test1.tar.xz<br>）</p>



<h4>2.2 非交互式加密压缩文件或目录</h4>



<pre class="wp-block-code"><code># tar -zcf - test.txt | openssl des3 -salt -f eternalcenter | dd of=test2.tar.gz
des3: Unrecognized flag f
des3: Use -help for summary.
0+0 records in
0+0 records out
0 bytes copied, 0.00376576 s, 0.0 kB/s</code></pre>



<p>（<br>补充：<br>1) 这里以将 test.txt 文件加密压缩成 test1.tar.gz （压缩）包并且将密码设置为 eternalcenter 为例<br>2) 如果要以 bzip2 的格式进行压缩，则将命令中的 -zcf 换成 -jcvf 将 test1.tar.gz 换成 test2.tar.bz2<br>3) 如果要以 xz 的格式进行压缩，则将命令中的 -zcf 换成 -Jcvf 将 test1.tar.gz 换成 test2.tar.xz<br>）</p>



<h3>步骤三：解压加密文件或目录</h3>



<h4>3.1 交互式解压加密文件或目录</h4>



<h5>3.1.1 删除原测试目录和里面的文件</h5>



<pre class="wp-block-code"><code># rm -rf test.txt</code></pre>



<p>（补充：这里以删除 test.txt 文件为例）</p>



<h5>3.1.2 交互式解压加密文件或目录</h5>



<pre class="wp-block-code"><code># dd if=test2.tar.gz | openssl des3 -d | tar zxf -
0+1 records in
0+1 records out
224 bytes copied, 0.000589721 s, 380 kB/s
enter des-ede3-cbc decryption password:
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.</code></pre>



<p>（<br>补充：<br>1) 这里以解压 test2.tar.gz （压缩）包为例<br>2) 如果是 bzip2 格式的（压缩）包，则将命令中的 -zxf 换成 -jcvf 将 test1.tar.gz 换成 test1.tar.bz2<br>3) 如果是 xz 格式的（压缩）包，则将命令中的 -zxf 换成 -Jcvf 将 test1.tar.gz 换成 test1.tar.xz<br>）</p>



<h4>3.2 非交互式解压加密文件或目录</h4>



<h5>3.2.1 删除原测试目录和里面的文件</h5>



<pre class="wp-block-code"><code># rm -rf test.txt</code></pre>



<p>（补充：这里以删除 test.txt 文件为例）</p>



<h5>3.2.2 非交互式解压加密文件或目录</h5>



<pre class="wp-block-code"><code># dd if=test1.tar.gz | openssl des3 -d -k eternalcenter | tar zxf -
0+1 records in
0+1 records out
224 bytes copied, 0.000574539 s, 390 kB/s
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.</code></pre>



<p>（<br>补充：<br>1) 这里以解压 test1.tar.gz （压缩）包并且解压密码为 eternalcenter 为例<br>2) 如果是 bzip2 格式的（压缩）包，则将命令中的 -zxf 换成 -jcvf 将 test1.tar.gz 换成 test1.tar.bz2<br>3) 如果是 xz 格式的（压缩）包，则将命令中的 -zxf 换成 -Jcvf 将 test1.tar.gz 换成 test1.tar.xz<br>）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux 加密压缩 （zip 版）</title>
		<link>https://eternalcenter-sep-2022.github.io/encryption-compression-zip/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Mon, 15 Nov 2021 15:48:09 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System Directory (系统目录)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Storage (系统存储)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=18388</guid>

					<description><![CDATA[步骤一：创建测试目录和测试文件 （补充：这里以创建 test 目录和里面的 test.txt 文件为例） 步骤二：加密压缩文件或目录 2.1 交互式加密压缩文件或目录 （补充：这里以将 test 目录和里面的 test.txt 文件加密压缩成 test1.zip （压缩）包为例） 2.2 非交互式加密解压文件或目录 （补充：这里以将 test 目录和里面的 test.txt 文件加密压缩成 test2.zip （压缩）包并且将密码设置为 eternalcenter 为例） 步骤三：解压加密文件或目录 3.1 交互式解压加密文件或目录 3.1.1 删除原测试目录和里面的文件 （补充：这里以删除 test 目录和里面的文件为例） 3.1.2 交互式解压加密文件或目录 （补充：这里以解压 test2.zip （压缩）包为例） 3.2 非交互式解压加密文件或目录 3.2.1 删除原测试目录和里面的文件 （补充：这里以删除 test 目录和里面的文件为例） 3.2.2 非交互式解压加密文件 （补充：这里以解压 test2.zip （压缩）包并且解压密码为 eternalcenter 为例）]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：创建测试目录和测试文件</h3>



<pre class="wp-block-code"><code># mkdir test
# touch test/test.txt</code></pre>



<p>（补充：这里以创建 test 目录和里面的 test.txt 文件为例）</p>



<h3>步骤二：加密压缩文件或目录</h3>



<h4>2.1 交互式加密压缩文件或目录</h4>



<pre class="wp-block-code"><code># zip -re test1.zip test
Enter password: 
Verify password: 
  adding: test/ (stored 0%)
  adding: test/test.txt (stored 0%)</code></pre>



<p>（补充：这里以将 test 目录和里面的 test.txt 文件加密压缩成 test1.zip （压缩）包为例）</p>



<h4>2.2 非交互式加密解压文件或目录</h4>



<pre class="wp-block-code"><code># zip -rP eternalcenter test2.zip test
  adding: test/ (stored 0%)
  adding: test/test.txt (stored 0%)</code></pre>



<p>（补充：这里以将 test 目录和里面的 test.txt 文件加密压缩成 test2.zip （压缩）包并且将密码设置为 eternalcenter 为例）</p>



<h3>步骤三：解压加密文件或目录</h3>



<h4>3.1 交互式解压加密文件或目录</h4>



<h5>3.1.1 删除原测试目录和里面的文件</h5>



<pre class="wp-block-code"><code># rm -rf test</code></pre>



<p>（补充：这里以删除 test 目录和里面的文件为例）</p>



<h5>3.1.2 交互式解压加密文件或目录</h5>



<pre class="wp-block-code"><code># unzip test2.zip
Archive:  test2.zip
   creating: test/
&#91;test2.zip] test/test.txt password: 
 extracting: test/test.txt</code></pre>



<p>（补充：这里以解压 test2.zip （压缩）包为例）</p>



<h4>3.2 非交互式解压加密文件或目录</h4>



<h5>3.2.1 删除原测试目录和里面的文件</h5>



<pre class="wp-block-code"><code># rm -rf test</code></pre>



<p>（补充：这里以删除 test 目录和里面的文件为例）</p>



<h5>3.2.2 非交互式解压加密文件</h5>



<pre class="wp-block-code"><code># unzip -P eternalcenter test1.zip 
Archive:  test1.zip
   creating: test/
 extracting: test/test.txt  </code></pre>



<p>（补充：这里以解压 test2.zip （压缩）包并且解压密码为 eternalcenter 为例）</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>[步骤] Linux rm 命令的监控</title>
		<link>https://eternalcenter-sep-2022.github.io/rm-monitor/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 07 Nov 2021 13:29:10 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[System (系统)]]></category>
		<category><![CDATA[System File (系统文件)]]></category>
		<category><![CDATA[System File Security (系统文件安全)]]></category>
		<category><![CDATA[System Network & System Security & System Log (系统网络 & 系统安全 & 系统日志)]]></category>
		<category><![CDATA[System Operation & System Setting & System Software (系统操作 & 系统设置 & 系统软件)]]></category>
		<category><![CDATA[System Security (系统安全)]]></category>
		<category><![CDATA[System Setting (系统设置)]]></category>
		<category><![CDATA[System Storage & System Directory & System File (系统存储 & 系统目录 & 系统文件)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=18208</guid>

					<description><![CDATA[步骤一：将原来的 rm 命令进行备份 步骤二：创建一个记录 rm 命令使用的脚本 步骤三：给记录 rm 命令使用的脚本执行权限 步骤四：下次使用 rm 命令后就可以监控 /var/log/rm_command.log 日志了 （步骤略）]]></description>
										<content:encoded><![CDATA[
<h3>步骤一：将原来的 rm 命令进行备份</h3>



<pre class="wp-block-code"><code># cp /usr/bin/rm  /usr/bin/rm.original</code></pre>



<h3>步骤二：创建一个记录 rm 命令使用的脚本</h3>



<pre class="wp-block-code"><code># cat /usr/bin/rm
#!/bin/bash
log=/var/log/rm_command.log
echo "The $$ is calling rm command" &gt;&gt; $log
echo "The full command is $*" &gt;&gt; $log
echo
echo "now use this command to get more information: /bin/ps axwwo user,pid,ppid,%cpu,%mem,vsz,rss,stat,time,cmd" &gt;&gt;$log
/bin/ps axwwo user,pid,ppid,%cpu,%mem,vsz,rss,stat,time,cmd &gt;&gt;$log
/usr/bin/rm.original $*
echo "============================================================" &gt;&gt;$log</code></pre>



<h3>步骤三：给记录 rm 命令使用的脚本执行权限</h3>



<pre class="wp-block-code"><code># chmod 755 /usr/bin/rm.original</code></pre>



<h3>步骤四：下次使用 rm 命令后就可以监控 /var/log/rm_command.log 日志了</h3>



<p>（步骤略）</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
