<!DOCTYPE html>
    <html lang="vi" xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#">
    <head>
<title>4 lệnh Linux &quot;ẩn&quot; cực kỳ hữu ích</title>
<meta name="description" content="4 lệnh Linux &quot;ẩn&quot; cực kỳ hữu ích - Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;www.nguoicodonvn2008.info&#x002F;vi&#x002F;news&#x002F;savefile&#x002F;kien-thuc-may-tinh&#x002F;4-lenh-linux-an-cuc-ky-huu-ich-11791.html">
<meta name="author" content=".: Nguoicodonvn2008.info - Cõi lòng người cô đơn :.">
<meta name="copyright" content=".: Nguoicodonvn2008.info - Cõi lòng người cô đơn :. [admin@nguoicodonvn2008.info]">
<meta name="robots" content="index, archive, follow, noodp">
<meta name="googlebot" content="index,archive,follow,noodp">
<meta name="msnbot" content="all,index,follow">
<meta name="generator" content="NukeViet v4.5">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:title" content="4 lệnh Linux &quot;ẩn&quot; cực kỳ hữu ích">
<meta property="og:type" content="website">
<meta property="og:description" content="Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;www.nguoicodonvn2008.info&#x002F;vi&#x002F;news&#x002F;savefile&#x002F;kien-thuc-may-tinh&#x002F;4-lenh-linux-an-cuc-ky-huu-ich-11791.html">
<meta property="og:site_name" content=".&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.">
<meta property="og:url" content="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/4-lenh-linux-an-cuc-ky-huu-ich-11791.html">
<link rel="shortcut icon" href="https://nguoicodonvn2008.info/favicon.ico">
<link rel="canonical" href="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/4-lenh-linux-an-cuc-ky-huu-ich-11791.html">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/" title="Tin Tức" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/karaoke-dual/" title="Tin Tức - Karaoke Dual" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/nhac-tre/" title="Tin Tức - Nhạc trẻ" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tru-tinh/" title="Tin Tức - Trữ tình" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/nuoc-ngoai/" title="Tin Tức - Nước ngoài" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/remix/" title="Tin Tức - Remix" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tam-su-tinh-yeu/" title="Tin Tức - Tâm sự tình yêu" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tho-suu-tam/" title="Tin Tức - Thơ sưu tầm" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/cuoc-song/" title="Tin Tức - Cuộc sống" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/phan-mem/" title="Tin Tức - Phần mềm" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/kien-thuc-may-tinh/" title="Tin Tức - Kiến thức máy tính" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/hoc-tap/" title="Tin Tức - Học tập" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tai-lieu/" title="Tin Tức - Tài liệu" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/de-thi/" title="Tin Tức - Đề thi" type="application/rss+xml">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/assets/css/font-awesome.min.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/bootstrap.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/style.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/style.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/news.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/custom.css" type="text/css">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/jquery/jquery.min.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/language/vi.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/DOMPurify/purify3.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/global.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/site.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/news.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/main.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/custom.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/bootstrap.min.js" type="text/javascript">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/bootstrap.non-responsive.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/style.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/style.non-responsive.css">
<link rel="StyleSheet" href="https://nguoicodonvn2008.info/themes/default/css/news.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/custom.css">
<style type="text/css">
	body{background: #fff;}
</style>
    </head>
    <body>
<div id="print">
	<div id="hd_print">
		<h2 class="pull-left">.&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.</h2>
		<p class="pull-right"><a title=".&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;." href="https://nguoicodonvn2008.info/">https://nguoicodonvn2008.info</a></p>
	</div>
	<div class="clear"></div>
	<hr />
	<div id="content">
		<h1>4 lệnh Linux &quot;ẩn&quot; cực kỳ hữu ích</h1>
		<ul class="list-inline">
			<li>Thứ sáu - 05/12/2025 04:12</li>
			<li class="hidden-print txtrequired"><em class="fa fa-print">&nbsp;</em><a title="In ra" href="javascript:;" onclick="window.print()">In ra</a></li>
			<li class="hidden-print txtrequired"><em class="fa fa-power-off">&nbsp;</em><a title="Đóng cửa sổ này" href="javascript:;" onclick="window.close()">Đóng cửa sổ này</a></li>
		</ul>
		<div class="clear"></div>
		<div id="hometext">
		</div>
				<div class="imghome">
			<img alt="4 lệnh Linux &quot;ẩn&quot; cực kỳ hữu ích" src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-1.jpg" width="460" class="img-thumbnail" />
		</div>
		<div class="clear"></div>
		<div id="bodytext" class="clearfix">
			<p style="text-align: justify;">Rất nhiều fan trung thành của Linux khăng khăng rằng ngày nay bạn có thể làm được hầu hết mọi việc mà không cần phải chạm vào terminal. Nhưng ngay cả đến năm 2025, nhiều người vẫn không đồng tình. Terminal không phải là di tích của quá khứ; nó là một trong những điểm mạnh lớn nhất của việc sử dụng Linux ngay từ đầu.<br />
<br />
Mọi người dùng thành thạo ít nhất nên biết những điều cơ bản. Một chút kiến ​​thức về shell và một vài phím tắt bash hữu ích có thể giúp bạn làm việc hàng ngày nhanh hơn đáng kể. Ngoài ra, có một số lệnh ít được chú ý mà hầu như không ai nhắc đến, mặc dù chúng hữu ích đến mức bạn không thể ngờ tới.</p>

<div style="text-align: justify;">&nbsp;</div>

<h2 style="text-align: justify;">Tìm kiếm nhanh hơn nữa với fzf</h2>

<figure>
<div style="text-align: justify;"><img alt="Tìm kiếm file bằng lệnh fzf trong terminal" data-adbro-processed="true" data-i="0" data-src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-1.jpg" data-was-processed="true" height="1031" src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-1.jpg" width="1650" /></div>

<figcaption>
<div style="text-align: justify;">Tìm kiếm file bằng lệnh&nbsp;fzf trong terminal</div>
</figcaption>
</figure>

<p style="text-align: justify;">Hầu hết các bản phân phối Linux đều cung cấp cho bạn khả năng tìm kiếm trên toàn hệ thống khá nhanh, nhưng có một cách thậm chí còn nhanh chóng và vượt trội hơn tất cả những cách khác.</p>

<p style="text-align: justify;">Fzf là một tiện ích terminal nhỏ gọn sử dụng thuật toán Fuzzy matching (kỹ thuật so khớp dữ liệu dựa trên mức độ tương đồng thay vì yêu cầu sự trùng khớp chính xác) để tìm kiếm file. Về cơ bản, điều này có nghĩa là bạn không cần nhập chính xác hay tên file đầy đủ để tìm thấy những gì mình cần. Bạn chỉ cần nhập một vài ký tự, thậm chí không theo thứ tự, và nó sẽ tự động tìm ra những kết quả trùng khớp gần nhất.</p>

<p style="text-align: justify;">Nó có sẵn thông qua hầu hết mọi trình quản lý gói chính thống, vì vậy bạn có thể cài đặt fzf bằng cách chạy lệnh cài đặt thông thường và thêm fzf vào cuối.</p>

<p style="text-align: justify;">Sau khi hoàn tất, bạn chỉ cần chạy lệnh sau để mở giao diện kiểu trình quản lý file ngay trong terminal. Tại đây, bạn có thể tìm kiếm file và nhận được đường dẫn file ngay lập tức.</p>

<pre id="pre0">
<code>fzf --style full \
--preview &#039;fzf-preview.sh {}&#039; --bind &#039;focus:transform-header:file --brief {}&#039;</code></pre>

<h2 style="text-align: justify;">Sử dụng tldr thay vì man</h2>

<figure>
<div style="text-align: justify;"><img alt="tldr giải thích lệnh pacman trong cửa sổ terminal" data-i="1" data-src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-2.jpg" data-was-processed="true" height="1092" src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-2.jpg" width="1650" /></div>

<figcaption>
<div style="text-align: justify;">tldr giải thích lệnh pacman trong cửa sổ terminal</div>
</figcaption>
</figure>

<p style="text-align: justify;">tldr có cùng chức năng như man, nhưng đúng như tên gọi, nó cung cấp cách giải thích đơn giản nhất có thể cho lệnh. Ví dụ, nếu muốn biết lệnh git hoạt động như thế nào, bạn chỉ cần nhập:</p>

<pre id="pre1">
<code>tldr git</code></pre>

<p style="text-align: justify;">Hãy xem so sánh bên dưới, với man bên trái, và tldr bên phải giải thích cùng một lệnh.</p>

<figure>
<div style="text-align: justify;"><img alt="" data-i="2" data-src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-3.jpg" data-was-processed="true" height="421" src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-3.jpg" width="738" /></div>
</figure>

<figure>
<div style="text-align: justify;"><img alt="" data-i="3" data-src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-4.jpg" data-was-processed="true" height="423" src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-4.jpg" width="748" /></div>
</figure>

<p style="text-align: justify;">Rõ ràng là không có sự cạnh tranh nào giữa hai lệnh này về tính đơn giản. Nhưng hãy chọn tldr thay vì man bất cứ lúc nào. Nếu hệ thống của bạn chưa có tldr, bạn có thể cài đặt nó bằng trình quản lý gói, giống như fzf.</p>

<p style="text-align: justify;"><strong>Lưu ý</strong>: Mặc dù công cụ này được gọi là tldr, nhưng tên gói chính thức là tlcr, vì vậy hãy đảm bảo sử dụng tên đó khi cài đặt.</p>

<div style="text-align: justify;">&nbsp;</div>

<h2 style="text-align: justify;">Alias giúp cuộc sống của bạn nhanh hơn rất nhiều</h2>

<figure>
<div style="text-align: justify;"><img alt="Fastfetch được gọi trong cửa sổ terminal thông qua alias" data-i="4" data-src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-5.jpg" data-was-processed="true" height="896" src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-5.jpg" width="1650" /></div>

<figcaption>
<div style="text-align: justify;">Fastfetch được gọi trong cửa sổ terminal thông qua alias</div>
</figcaption>
</figure>

<p style="text-align: justify;">Alias là một lệnh khác giúp bạn tiết kiệm rất nhiều thời gian. Về cơ bản, chúng là các shortcut tùy chỉnh mà bạn có thể gán cho bất kỳ lệnh nào trong terminal của mình. Nếu bạn thường xuyên lặp lại cùng một chuỗi văn bản dài, alias chính là cứu cánh.</p>

<p style="text-align: justify;">Ví dụ, thay vì chạy đi chạy lại cùng một lệnh dài để cập nhật hệ thống, bạn chỉ cần thiết lập một alias cho nó như thế này:</p>

<pre id="pre2">
<code>alias update = &quot;sudo apt update &amp;&amp; sudo apt upgrade -y&quot;</code></pre>

<p style="text-align: justify;">Giờ đây, tất cả những gì bạn cần làm là nhập lệnh update, và terminal sẽ chạy toàn bộ lệnh.</p>

<p style="text-align: justify;">Điều duy nhất cần lưu ý là alias không tồn tại theo mặc định, và bạn sẽ cần thêm chúng vào file cấu hình shell. Tác giả bài viết đã đặt một alias cho lệnh fzf đã đề cập trước đó, vì nó rất dài. Giờ chỉ cần nhập lệnh filesearch, và toàn bộ lệnh sẽ được thực thi ngay lập tức.</p>

<h2 style="text-align: justify;">Hiểu rõ quy trình khởi động với systemd-analyze</h2>

<figure>
<div style="text-align: justify;"><img alt="" data-i="5" data-src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-6.jpg" data-was-processed="true" height="1351" src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-6.jpg" width="2560" /></div>
</figure>

<figure>
<div style="text-align: justify;"><img alt="" data-i="6" data-src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-7.jpg" data-was-processed="true" height="1350" src="https://st.quantrimang.com/photos/image/2025/12/04/lenh-linux-an-huu-ich-7.jpg" width="2560" /></div>
</figure>

<p style="text-align: justify;">Systemd là trình quản lý hệ thống và service cốt lõi được hầu hết các bản phân phối Linux hiện đại sử dụng. Nó xử lý mọi thứ trong không gian khởi động và quản lý những thứ như service nào khởi động, theo thứ tự nào và cũng theo dõi chúng mất bao lâu.</p>

<p style="text-align: justify;">Do đó, systemd có thể cho bạn biết chính xác lý do tại sao hệ thống của bạn có thể mất quá nhiều thời gian để khởi động, thay vì bắt bạn phải đoán già đoán non. Lệnh đầu tiên bạn nên thử là:</p>

<pre id="pre3">
<code>systemd-analyze</code></pre>

<p style="text-align: justify;">Lệnh này cung cấp cho bạn bản tóm tắt đầy đủ về quy trình khởi động trên tất cả các thành phần chính của hệ điều hành. Nhưng nếu muốn tìm hiểu sâu hơn, bạn có thể chạy lệnh này:</p>

<pre id="pre4">
<code>systemd-analyze blame</code></pre>

<p style="text-align: justify;">Lệnh này cũng sẽ liệt kê mọi service đã khởi chạy trong quá trình khởi động, được sắp xếp theo thời gian khởi động của từng service. Nó hoàn hảo để phát hiện ngay các service chậm.</p>

<p style="text-align: justify;">Và nếu chừng đó vẫn chưa đủ, bạn thậm chí có thể tạo một timeline trực quan đầy đủ về quá trình khởi động của mình:</p>

<pre id="pre5">
<code>systemd-analyze plot &gt; bootanalysis.png</code></pre>

<p style="text-align: justify;">Lệnh này sẽ tạo ra một&nbsp;file SVG&nbsp;hiển thị từng service, thời gian khởi động của từng service và cách chúng chồng chéo lên nhau. Mở file này trong trình duyệt của bạn và bạn sẽ thấy biểu đồ đầy đủ về những gì đang diễn ra bên trong.</p>

<p style="text-align: justify;">Lệnh này cực kỳ hữu ích khi có sự cố bắt đầu xảy ra, có thể là sau khi cài đặt ứng dụng mới hoặc áp dụng bản cập nhật.</p>

<div style="text-align: justify;">&nbsp;</div>
		</div>
				<div id="author">
						<p>
				<strong>Nguồn tin:</strong>
				Quantrimang.com:
			</p>
		</div>
	</div>
	<div id="footer" class="clearfix">
		<div id="url">
			<strong>URL của bản tin này: </strong><a href="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/4-lenh-linux-an-cuc-ky-huu-ich-11791.html" title="4 lệnh Linux &quot;ẩn&quot; cực kỳ hữu ích">https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/4-lenh-linux-an-cuc-ky-huu-ich-11791.html</a>

		</div>
		<div class="clear"></div>
		<div class="copyright">
			&copy; .&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.
		</div>
		<div id="contact">
			<a href="mailto:admin@nguoicodonvn2008.info">admin@nguoicodonvn2008.info</a>
		</div>
	</div>
</div>
        <div id="timeoutsess" class="chromeframe">
            Bạn đã không sử dụng Site, <a onclick="timeoutsesscancel();" href="https://nguoicodonvn2008.info/#">Bấm vào đây để duy trì trạng thái đăng nhập</a>. Thời gian chờ: <span id="secField"> 60 </span> giây
        </div>
        <div id="openidResult" class="nv-alert" style="display:none"></div>
        <div id="openidBt" data-result="" data-redirect=""></div>
		</script>
		<div class="car-top">
  <span><img src="https://nguoicodonvn2008.info/themes/default/images/car.png" alt=""></span>
</div>
<script src="https://nguoicodonvn2008.info/assets/js/jquery/jquery.min.js"></script>
<script>var nv_base_siteurl="/",nv_lang_data="vi",nv_lang_interface="vi",nv_name_variable="nv",nv_fc_variable="op",nv_lang_variable="language",nv_module_name="news",nv_func_name="savefile",nv_is_user=0, nv_my_ofs=-4,nv_my_abbr="EDT",nv_cookie_prefix="nv4c_e856T",nv_check_pass_mstime=1738000,nv_area_admin=0,nv_safemode=0,theme_responsive=0,nv_recaptcha_ver=2,nv_recaptcha_sitekey="",nv_recaptcha_type="image",XSSsanitize=1;</script>
<script src="https://nguoicodonvn2008.info/assets/js/language/vi.js"></script>
<script src="https://nguoicodonvn2008.info/assets/js/DOMPurify/purify3.js"></script>
<script src="https://nguoicodonvn2008.info/assets/js/global.js"></script>
<script src="https://nguoicodonvn2008.info/assets/js/site.js"></script>
<script src="https://nguoicodonvn2008.info/themes/default/js/news.js"></script>
<script src="https://nguoicodonvn2008.info/themes/default/js/main.js"></script>
<script src="https://nguoicodonvn2008.info/themes/default/js/custom.js"></script>
<script type="application/ld+json">
        {
            "@context": "https://schema.org",
            "@type": "Organization",
            "url": "https://nguoicodonvn2008.info",
            "logo": "https://nguoicodonvn2008.info/uploads/angel.gif"
        }
        </script>
<script src="https://nguoicodonvn2008.info/themes/default/js/bootstrap.min.js"></script>
<script type="text/javascript">
var $scrolltop = $('.car-top');
$scrolltop.on('click', function () {
    $('html,body').animate({
        scrollTop: 0
    }, 800);
    $(this).addClass("car-run");
    setTimeout(function(){ $scrolltop.removeClass('car-run');}, 1000);
    return false;
});
$(window).on('scroll', function ()
{ 
    if($(window).scrollTop() >= 200)
    {
        $scrolltop.addClass("show");
        $scrolltop.addClass("car-down");
    }
    else
    {
       $scrolltop.removeClass("show");
       setTimeout(function(){ $scrolltop.removeClass('car-down');}, 300);
    }
});
</script>
</body>
</html>