Linux terminal commands ไม่จำเป็นต้องน่าเบื่อ หลายคำสั่ง cool, fun, และ entertaining สำหรับ users
บทความนี้ discuss pro-Linux command tricks ประหยัดเวลา ความหงุดหงิด และเพิ่ม productivity
Pause & Run Linux Terminal Commands ใน Background
เคยพิมพ์ text ไปครึ่งทางในไฟล์ ตระหนักอยากเพิ่มคำสั่งอื่นใน terminal แตไม่ได้เพราะเปิด text file ใน foreground mode?
กลับไป Linux terminal command line โดยไม่ interrupt สิ่งที่ทำ: กด CTRL+Z pause foreground application
ตอนนี้รัน additional commands ที่อยากได้ จบแล้ว กลับไป previously paused session ด้วย fg ใน terminal window แล้วกด return
ใช้ & Search Wikipedia ใน Linux Terminal
หลายคนใช้ Wikipedia ค้นหา knowledge database กว้างใหญ่ Google มัก push Wikipedia บนสุด search results ช่วยหาข้อมูลเร็ว
Linux users ประหยัดเวลามากด้วยการ access Wikipedia ใน terminal ใช้ Wikit ได้คำตอบเร็วใน Linux distribution
Wikit Linux terminal command line แสดง summaries ของ search topics จาก Wikipedia เริ่มติดตั้ง Node.js บนเครื่อง
รันคำสั่งบน Mint, Ubuntu, หรือ Debian:
sudo apt-get install nodejs
sudo apt-get install npm
ติดตั้ง Wikit ด้วยคำสั่งง่าย:
sudo npm install wikit -g
ติดตั้ง Wikit เสร็จ ได้ Wikipedia summaries ด้วยคำสั่ง:
wikit <search query>
Note: ใช้ multi-word queries ได้
Steam Locomotive (รถไฟไอน้ำ)
อยากดู steam locomotive วิ่งข้าม Linux terminal จากขวาไปซ้าย? อยากเพิ่มความสนุกในวัน พิมพ์คำสั่ง:
$ sudo apt-get install sl
ถ้า sl program ไม่ได้ติดตั้ง ต้องติดตั้ง:
$ sudo apt-get install sl
Cowsay
สร้าง ASCII (American Standard Code for Information Interchange) cow (Cowsay) ใน terminal และใช้ Cowthink ให้มันคิด
ติดตั้ง Cowsay (สำหรับ Debian OS) ด้วยคำสั่ง:
root@tecmint:~# apt-get install cowsay
สั่งให้วัวคิดและพูดด้วยคำสั่ง:
root@tecmint:~# cowsay I Love nix
ติดตั้ง Aquarium ใน Terminal
เพลิดเพลินกับลึกลับของทะเลจากใน terminal ด้วย ASCIIQuarium ถ้าใช้ Fedora ติดตั้งง่าย เพราะอยู่ใน repositories คำสั่ง:
$ sudo dnf install asciiquarium
ถ้าใช้ distribution อื่น ไป homepage ดูวิธีดาวน์โหลด
หรือติดตั้ง Term-Animation Perl module พิมพ์ใน command line terminal:
$ sudo apt-get install libcurses-perl
$ cd /tmp
$ wget https://search.cpan.org/CPAN/authors/id/K/KB/KBAUCOM/Term-Animation-2.4.tar.gz
$ tar -zxvf Term-Animation-2.4.tar.gz
$ cd Term-Animation-2.4/
$ perl Makefile.PL && make && make test
$ sudo make install
ต่อไป พิมพ์จาก Linux terminal command prompt:
$ cd /tmp
$ wget https://www.robobunny.com/projects/asciiquarium/asciiquarium.tar.gz
$ tar -zxvf asciiquarium.tar.gz
$ cd asciiquarium_1.0/
$ sudo cp asciiquarium /usr/local/bin
$ sudo chmod 0755 /usr/local/bin/asciiquarium
ดู aquarium ด้วยคำสั่ง:
$ perl /usr/local/bin/asciiquarium
Browsh
Browsh เป็น simple, open-source, และ modern text-based browser มีประโยชน์ตอนไม่มี good Internet connection ช่วย avoid draining battery
เล่น videos และอะไรที่ regular browser ทำได้ แตเกิดใน terminal environments
ติดตั้ง Browsh ใน Linux ต้อง run latest version of Firefox และ terminal client with true color support
มี prerequisites ข้างต้น download right package สำหรับ Linux distribution ติดตั้งเสร็จ รัน Browsh บน terminal:
$ browsh
Mouse และ key functions ส่วนใหญ่ทำงานเหมือน desktop browser basic functions:
- BACKSPACE go back in history
- CTRL+l focus URL bar
- F1 open documentation
- CTRL+r reload page
- ARROW KEYS, PageUP, PageDown scroll
- CTRL+t open new tab
- CTRL+w close tab
- CTRL+q exit program
Lolcat
พิมพ์ข้อความสีสันสวยงาม rainbow colors ด้วย lolcat ติดตั้งด้วย code:
# apt-get install lolcat
Link กับ Linux terminal commands อื่นๆ ดู output สีรุ้งใน terminal
Search Hard Drive Errors
ใช้ smartctl monitor reliability ของ hard drive, predict drive failures, และ perform drive self-tests
ติดตั้ง smartctl ใน Ubuntu:
$ sudo apt-get install smartmontools
Start service:
$ sudo /etc/init.d/smartmontools start
ใช้กับ distributions อื่นและดูตัวอย่าง: Smartctl – Monitoring and Analysis tool for Hard drive
Cpanel Backup & Restore
Backup และ restore cPanel account files เร็วและง่ายด้วยคำสั่ง:
/scripts/pkgacct username /scripts/restoracct username
สร้าง Bootable Drive
สร้าง USB bootable drive จาก iso ด้วย single terminal command:
$ dd if=/home/user/Downloads/ubuntu.iso of=/dev/sdb1 bs=512M; sync
คำสั่งข้างบนสร้าง USB drive (/dev/sdb1) เป็น Debian bootable drive
ถ้าใช้เวลามากบน command line ตัวอย่างข้างบนอธิบาย tricks และ shortcuts เพิ่ม productivity
คุณยังใช้ Linux terminal commands ที่ไม่เกี่ยวกับงาน เพื่อความสนุกได้