Computer >> Máy Tính >  >> Điện thoại thông minh >> Linux

20 Lệnh băm siêu hữu ích

Dưới đây là danh sách một số lệnh bash mà tôi sử dụng nhiều nhất và mô tả rất ngắn gọn về những gì tôi sử dụng chúng để làm.

ifconfig

Được sử dụng để tìm ra địa chỉ IP của bạn. (nhìn vào wlan0, dòng bắt đầu bằng ‘inet addr’)

[kmurray @ radon ~] $ / sbin / ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr:::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Số liệu:1
gói RX:19266 lỗi:0 bị giảm:0 vượt quá:0 khung:0
Gói TX:19266 lỗi:0 bị giảm:0 vượt qua:0 nhà cung cấp dịch vụ:0
> va chạm:0 txqueuelen:0
RX byte:963988 (941,3 KiB) byte TX:963988 (941,3 KiB)

wlan0 Liên kết encap:Ethernet HWaddr 00:1A:73:0F:0E:FD
inet addr:192.168.1.139 Bcast:192.168.1.255 Mặt nạ:255.255.255.0
inet6 addr:fe80 ::21a:73ff:fe0f:efd / 64 Phạm vi:Liên kết
LÊN BROADCAST CHẠY MULTICAST MTU:1500 Chỉ số:1
Các gói RX:8712 lỗi:0 bị rơi:0 vượt quá:0 khung:0
Gói TX:8944 lỗi:0 bị rớt:0 vượt quá:0 sóng mang:0
va chạm:0 txqueuelen:1000
Byte RX:8002586 (7,6 MiB) byte TX:3113446 (2,9 MiB)

route -n

Được sử dụng để tìm địa chỉ IP của cổng mặc định của bạn. (tìm dòng có chữ G trong cột Cờ}

[kmurray @ radon ~] $ / sbin / route -n
Bảng định tuyến Kernel IP
Destination Gateway Genmask Flags Metric Ref Sử dụng Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
0.0. 0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0

ip

Tôi sử dụng cái này tương tự như ifconfig và route.

[kmurray @ radon ~] $ / sbin / ip route
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.139
default qua 192.168.1.1 dev wlan0 proto static

[kmurray @ radon ~] $ / sbin / ip addr
1:lo: mtu 16436 qdisc noqueue state UNKNOWN
link / loopback 00:00:00:00:00:00 brd 00:00:00 :00:00:00
inet 127.0.0.1/8 phạm vi máy chủ lưu trữ
inet6 ::1/128 máy chủ phạm vi
hợp lệ_lft mãi mãi ưa thích_lft mãi mãi
2:eth0: mtu 1500 qdisc noop state DOWN qlen 1000
link / ether 00:16:d4:ec:25:4b brd ff:ff:ff:ff:ff:ff
3:wlan0: mtu 1500 qdisc pfifo_fast trạng thái UP qlen 1000
liên kết / ether 00:1a:73:0f:0e:fd brd ff:ff:ff:ff:ff:ff
inet 192.168.1.139/24 brd 192.168.1.255 phạm vi toàn cầu wlan0
inet6 fe80 ::21a:73ff:fe0f:efd / 64 liên kết phạm vi
valid_lft forever favourite_lft forever

ping

Được sử dụng để kiểm tra kết nối mạng.

[kmurray @ radon ~] $ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56 (84) byte dữ liệu.
64 byte từ 192.168.1.1:icmp_seq =1 ttl =64 time =1,23 ms
64 byte từ 192.168.1.1:icmp_seq =2 ttl =64 time =1,17 ms
64 byte từ 192.168.1.1:icmp_seq =3 ttl =64 time =1,14 ms
64 byte từ 192.168.1.1:icmp_seq =4 ttl =64 time =1,19 ms
^ C
- 192.168.1,1 ping thống kê -
4 gói được truyền, 4 gói nhận được, 0% mất gói, thời gian 3268ms
rtt min / avg / max / mdev =1.149 / 1.190 / 1.238 / 0.032 mili giây

theo dõi

Một công cụ kết nối mạng khác. Cái này cho bạn biết bạn phải trải qua bao nhiêu bộ định tuyến để kết nối với một máy chủ cụ thể.

[kmurray @ radon ~] $ traceroute simplehelp.net
theo dõi tới simplehelp.net (74.52.95.42), tối đa 30 bước, gói 60 byte
1 192.168.1.1 (192.168.1.1) 1,121 ms 2.010 ms 2,218 ms
2 24.68.178.1 (24.68.178.1) 25.950 mili giây * *
3 * * *
4 * * *
5 rc2bb-pos0-1-5-0.vc.shawcable.net (66.163 .77.185) 39.178 ms 128.371 ms 50.787 ms
6 rc2sj-pos6-0-0.cl.shawcable.net (66.163.77.70) 119.703 ms 76.364 ms 88.337 ms
7 rc2sj-ge2-0-0 .cl.shawcable.net (66.163.67.10) 110,862 ms 55,853 ms *
8 * rx0sj-comcast.cl.shawcable.net (66.163.67.110) 61,930 ms 109,439 ms
9 pos-0-8 -0-0-cr01.losangeles.ca.ibone.comcast.net (68,86,85,82) 79,587 ms 102,306 ms 81,225 ms
10 pos-0-9-0-0-cr01.dallas.tx.ibone. comcast.net (68.86.85.142) 120.064 ms 125.584 ms 118.207 ms
11 68.86.88.50 (68.86.88.50) 107.133 ms 109.350 ms 113,994 ms
12 te9-1.dsr02.dllstx3.theplanet.com ( 70,87.253.22) 87,928 ms 87,949 ms te9-1.dsr01.dllstx3.theplanet.com (70,87.253,6) 89,500 ms
13 76.fd.5746. static.theplanet.com (70,87.253.118) 99,789 ms 97,329 ms 100,789 ms
14 po1.car03.dllstx6.theplanet.com (12.96.160,5) 91,323 ms 91,788 ms po2.car03.dllstx6.theplanet.com (12,96 .160.37) 89,571 ms
15 2a.5f.344a.static.theplanet.com (74,52,95,42) 92,695 ms 92,601 ms 91,871 ms

máy chủ

Được sử dụng để tra cứu địa chỉ IP của một tên miền đủ điều kiện.

[kmurray @ radon ~] $ host simplehelp.net
simplehelp.net có địa chỉ 74.52.95.42
thư simplehelp.net được xử lý bởi 10 aspmx.l.google.com.

đào

Một công cụ truy vấn DNS nâng cao hơn.

[kmurray @ radon ~] $ đào simplehelp.net a

; <<>> DiG 9.5.0-P2 <<>> simplehelp.net a
;; tùy chọn toàn cục:printcmd
;; Có câu trả lời:
;; ->> HEADER <<- opcode:QUERY, status:NOERROR, id:25242;; cờ:qr rd ra; CÂU HỎI:1, ĐÁP ÁN:1, TỰ LUẬN:0, BỔ SUNG:0;; PHẦN CÂU HỎI:; simplehelp.net. VÀO A;; PHẦN TRẢ LỜI:simplehelp.net. 86238 TRONG A 74.52.95.42;; Thời gian truy vấn:1 msec;; MÁY CHỦ:192.168.1.1 # 53 (192.168.1.1);; KHI NÀO:Thứ Sáu, ngày 31 tháng 10 20:21:49 2008;; MSG SIZE rcvd:48 Điều này cho thấy địa chỉ IP của máy chủ nơi simplehelp.net cư trú là 74.52.95.42. [kmurray @ radon ~] $ đào simplehelp.net mx

; <<>> DiG 9.5.0-P2 <<>> simplehelp.net mx
;; tùy chọn toàn cục:printcmd
;; Có câu trả lời:
;; ->> HEADER <<- opcode:QUERY, status:NOERROR, id:17277;; cờ:qr rd ra; CÂU HỎI:1, ĐÁP ÁN:1, TỰ LUẬN:0, BỔ SUNG:2;; PHẦN CÂU HỎI:; simplehelp.net. TRONG MX;; PHẦN TRẢ LỜI:simplehelp.net. 86317 TRONG MX 10 aspmx.l.google.com.;; PHẦN BỔ SUNG:aspmx.l.google.com. 180 TRONG A 209.85.199.27aspmx.l.google.com. 180 TRONG A 209.85.199.114;; Thời gian truy vấn:40 msec;; MÁY CHỦ:192.168.1.1 # 53 (192.168.1.1);; KHI NÀO:Thứ Sáu, ngày 31 tháng 10 20:21:51 2008;; MSG SIZE rcvd:98 Điều này cho thấy rằng thư cho simplehelp.net được quản lý bởi aspmx.l.google.com và aspmx.l.google.com có ​​hai địa chỉ IP, 209.85.199.27 và 209.85.199.114. [kmurray @ radon ~] $ đào simplehelp.net ns

; <<>> DiG 9.5.0-P2 <<>> simplehelp.net ns
;; tùy chọn toàn cục:printcmd
;; Có câu trả lời:
;; ->> HEADER <<- opcode:QUERY, status:NOERROR, id:62957;; cờ:qr rd ra; CÂU HỎI:1, ĐÁP ÁN:2, TỰ LUẬN:0, BỔ SUNG:8;; PHẦN CÂU HỎI:; simplehelp.net. TẠI NS;; PHẦN TRẢ LỜI:simplehelp.net. 70617 TẠI NS ns1.theplanet.com.simplehelp.net. 70617 TẠI NS ns2.theplanet.com.;; PHẦN BỔ SUNG:ns1.theplanet.com. 172785 TRONG A 70.86.61.133ns2.theplanet.com. 172785 TRONG A 70.86.61.135ns1.theplanet.com. 172785 TRONG A 70.86.61.134ns2.theplanet.com. 172785 TRONG A 70.87.7.73ns1.theplanet.com. 172785 TRONG A 70.87.7.71ns1.theplanet.com. 172785 TRONG A 70.87.7.70ns2.theplanet.com. 172785 TRONG A 70.86.61.136ns2.theplanet.com. 172785 TRONG A 70,87,7,72;; Thời gian truy vấn:33 msec;; MÁY CHỦ:192.168.1.1 # 53 (192.168.1.1);; KHI NÀO:Thứ Sáu, 31 tháng 10 20:21:55 2008;; MSG SIZE rcvd:209 Điều này cho thấy rằng DNS cho simplehelp.net được xử lý bởi ns1.theplanet.com và ns2.theplanet.com. Nó cũng cho thấy rằng các máy chủ định danh này có nhiều địa chỉ IP.

iwlist

Nhận thông tin từ giao diện không dây. (cái này cần được chạy dưới dạng root)

[root @ radon ~] # iwlist wlan0 scan
wlan0 Scan hoàn tất:
Ô 01 - Địa chỉ:00:10:18:90:20:DB
ESSID:”Coffee”
Chế độ:Master
> Kênh:6
Tần số:2.437 GHz (Kênh 6)
Chất lượng =96/100 Mức tín hiệu:-37 dBm Mức ồn =-70 dBm
Khóa mã hóa:tắt
Bit Tốc độ:1 Mb / s; 2 Mb / giây; 5,5 Mb / giây; 11 Mb / giây; 6 Mb / s
9 Mb / s; 12 Mb / giây; 18 Mb / giây; 24 Mb / giây; 36 Mb / s
48 Mb / s; 54 Mb / s
Thêm:tsf =0000017f91cc818a
Thêm:Báo hiệu lần cuối:19ms trước
Ô 02 - Địa chỉ:00:11:50:6E:BC:3A
ESSID:“Belkin Traveler”
Chế độ:Chính
Kênh:1
Tần số:2,412 GHz (Kênh 1)
Chất lượng =88/100 Mức tín hiệu:-44 dBm Độ ồn =-70 dBm
Khóa mã hóa:tắt
Tốc độ bit:1 Mb / s; 2 Mb / giây; 5,5 Mb / giây; 11 Mb / giây; 6 Mb / s
12 Mb / s; 24 Mb / giây; 36 Mb / giây; 9 Mb / giây; 18 Mb / s
48 Mb / s; 54 Mb / s
Thêm:tsf =0000017f13571181
Thêm:Báo hiệu lần cuối:601ms trước
Ô 03 - Địa chỉ:00:17:9A:9C:14:28
ESSID:Chế độ “Abby”
:Chính
Kênh:6
Tần số:2.437 GHz (Kênh 6)
Chất lượng =50/100 Mức tín hiệu:-79 dBm Độ ồn =-70 dBm Khóa mã hóa
:tắt Tốc độ bit
:1 Mb / s; 2 Mb / giây; 5,5 Mb / giây; 11 Mb / giây; 6 Mb / s
9 Mb / s; 12 Mb / giây; 18 Mb / giây; 24 Mb / giây; 36 Mb / s
48 Mb / s; 54 Mb / s
Thêm:tsf =00000000cbe364d6
Thêm:Báo hiệu lần cuối:272ms trước
Ô 04 - Địa chỉ:00:18:D1:A8:E8:1A
ESSID:”Gigaset815 ″
Chế độ:Chính
Kênh:4
Tần số:2.427 GHz (Kênh 4)
Chất lượng =45/100 Mức tín hiệu:-83 dBm Độ ồn =-70 dBm Khóa mã hóa
:trên
IE:WPA Phiên bản 1
Mật mã nhóm:TKIP
Mật mã ghép nối (1):TKIP
Bộ xác thực (1):PSK
> Tốc độ bit:1 Mb / s; 2 Mb / giây; 5,5 Mb / giây; 11 Mb / giây; 22 Mb / s
6 Mb / s; 9 Mb / giây; 12 Mb / giây; 18 Mb / giây; 24 Mb / s
36 Mb / s; 48 Mb / giây; 54 Mb / s
Thêm:tsf =0000015633a50e12
Thêm:Báo hiệu lần cuối:571ms trước

Điều này cho thấy rằng máy tính của tôi hiện nhìn thấy bốn mạng không dây khác nhau trong khu vực cùng với tên, kênh, cường độ tín hiệu và chúng có được mã hóa hoặc mở hay không.

iwconfig

Giống như ifconfig, nhưng để biết thông tin về cài đặt không dây của bạn.

[kmurray @ radon ~] $ / sbin / iwconfig
không có tiện ích mở rộng không dây.
eth0 không có tiện ích mở rộng không dây.
wlan0 IEEE 802.11bg ESSID:”Coffee”
Chế độ:Tần số được quản lý:2.437 GHz Điểm truy cập:00 :10:18:90:20:DB
Bit Rate =54 Mb / s Tx-Power =27 dBm
Thử lại giới hạn tối thiểu:7 RTS thr:off Fragment thr =2352 B
Liên kết Chất lượng =96/100 Mức tín hiệu:-37 dBm Độ ồn =-70 dBm
Rx không hợp lệ nwid:0 Rx không hợp lệ crypt:0 Rx không hợp lệ frag:0
Tx quá nhiều lần thử lại:0 Sai không hợp lệ:0 Bỏ lỡ beacon:0

Điều này cho thấy rằng tôi hiện đang kết nối với mạng không dây có tên Coffee ở tốc độ 54 Mb / giây và cường độ tín hiệu rất tốt là 96%.

miễn phí

Dung lượng bộ nhớ và dung lượng hoán đổi được sử dụng / trống.

[kmurray @ radon ~] $ miễn phí -m
tổng số bộ đệm được chia sẻ miễn phí đã sử dụng được lưu vào bộ đệm
Mem:2017 1659 357 0 42 1078
- / + bộ đệm / bộ đệm:538 1478
Swap:1983 0 1983
>

gắn kết

Không có bất kỳ tham số nào, được sử dụng để hiển thị hệ thống tệp được gắn kết.

[kmurray @ radon ~] $ mount
/ dev / mapper / VolGroup00-LogVol00 on / type ext3 (rw, noatime)
proc on / proc type proc (rw)
sysfs on / sys type sysfs (rw)
devpts trên / dev / pts type devpts (rw, gid =5, mode =620)
/ dev / sda2 on / boot type ext3 (rw, noatime)
tmpfs on / dev / shm type tmpfs (rw)
none on / proc / sys / fs / binfmt_misc type binfmt_misc (rw)
sunrpc on / var / lib / nfs / rpc_pipefs type rpc_pipefs (rw)
fusectl on / sys / fs / fuse / results type fusectl (rw)
gvfs-fuse-daemon on /home/kmurray/.gvfs type fuse.gvfs-fuse-daemon (rw, nosuid, nodev, user =kmurray)
/ dev / sda1 on / media / disk type fuseblk (rw, nosuid, nodev, allow_other, blksize =4096)

Các dòng thú vị ở trên là các dòng chỉ ra / dev / mapper / VolGroup00-LogVol00 on /, / dev / sda2 on / boot và / dev / sda1 on / media / disk.

df

Hiển thị mức sử dụng dung lượng đĩa.

[kmurray @ radon ~] $ df -h
Kích thước hệ thống tập tin Đã sử dụng Thời gian sử dụng% Được gắn trên
/ dev / sda2 190M 19M 162M 11% / boot
tmpfs 1009M 1.1M 1008M 1% / dev / shm
gvfs -fuse-daemon 60G 44G 16G 74% /home/kmurray/.gvfs
/ dev / sda1 31G 29G 2,5G 93% / media / disk

Điều này cho thấy / dev / sda1 gần như đầy ở 93%. Đã đến lúc xóa một số tệp hoặc nâng cấp đĩa.

du

Hiển thị mức sử dụng dung lượng đĩa trong một thư mục.

[kmurray @ radon ~] $ du -hc Tài liệu / N95 / tutorial /
380K Tài liệu / N95 / tutorial / done / bluetooth gps
480K Tài liệu / N95 / tutorial / done / putty phông chữ
1.4M Tài liệu / N95 / hướng dẫn / done / gparted
1.1M Documents / N95 / tutorial / done / gnome hệ thống tệp từ xa
1.4M Documents / N95 / tutorial / done / phím tắt gnome
2.1M Documents / N95 / tutorial / done / download helper
992K Documents / N95 / tutorial / done / mconnection
1008K Documents / N95 / tutorial / done / snap links
5.0M Documents / N95 / tutorial / done / watermark gimp
1,2 triệu Tài liệu / N95 / hướng dẫn / thực hiện / cách sử dụng đĩa gnome
208 nghìn Tài liệu / N95 / hướng dẫn / thực hiện / máy tính nâng cao
544 nghìn Tài liệu / N95 / hướng dẫn / thực hiện / putty / orig
964 nghìn tài liệu / N95 / hướng dẫn / thực hiện / putty
848 nghìn tài liệu / N95 / hướng dẫn / thực hiện / wifi ap
1,4 triệu tài liệu / N95 / hướng dẫn / thực hiện / imap gmail
872K tài liệu / N95 / tutorial / done / unsigned apps
884K Tài liệu / N95 / tutorial / done / taskman
1.1M Tài liệu / N95 / tutorial / done / downthemall
916K Documents/N95/tutorials/done/tethering bt
432K Documents/N95/tutorials/done/install apps wifi http
924K Documents/N95/tutorials/done/tethering usb
320K Documents/N95/tutorials/done/install stuff via bluetooth
416K Documents/N95/tutorials/done/smb4s60
1.1M Documents/N95/tutorials/done/download statusbar
308K Documents/N95/tutorials/done/install stuff via usb
828K Documents/N95/tutorials/done/nokia step counter
4.3M Documents/N95/tutorials/todo
52M Documents/N95/tutorials/
52M total

This shows that my N95 tutorials directory is using a total of 52M and the breakdown of each directory’s size.

head

Display the first few lines of a file.

[kmurray@radon ~]$ head /var/log/yum.log
Jun 13 22:30:33 Installed:bash-completion-20060301-10.noarch
Jun 13 22:31:31 Installed:yum-downloadonly-1.1.13-2.fc9.noarch
Jun 14 06:20:11 Installed:swfdec-0.6.6-1.fc9.i386
Jun 14 06:20:13 Installed:swfdec-gtk-0.6.6-1.fc9.i386
Jun 14 06:20:14 Installed:swfdec-mozilla-0.6.0-1.fc9.i386
Jun 14 06:34:41 Updated:libxml2-2.6.32-2.fc9.i386
Jun 14 06:34:41 Updated:dbus-glib-0.74-8.fc9.i386
Jun 14 06:34:42 Updated:libselinux-2.0.64-2.fc9.i386
Jun 14 06:34:43 Updated:e2fsprogs-libs-1.40.8-3.fc9.i386
Jun 14 06:34:43 Updated:audit-libs-1.7.4-1.fc9.i386

By default, head displays the first 10 lines. head -20 /var/log/yum.log would show the first 20 lines. You can use any arbitrary number.

tail

Display the last few lines of a file.

[kmurray@radon ~]$ tail /var/log/yum.log
Oct 30 23:19:56 Updated:6:kdebase-libs-4.1.2-5.fc9.i386
Oct 30 23:19:57 Updated:6:kdemultimedia-libs-4.1.2-2.fc9.i386
Oct 30 23:19:57 Updated:ksysguardd-4.1.2-6.fc9.i386
Oct 30 23:19:58 Updated:phonon-backend-xine-4.1.2-5.fc9.i386
Oct 30 23:20:08 Updated:kdebase-runtime-4.1.2-5.fc9.i386
Oct 30 23:20:11 Updated:kdebase-workspace-libs-4.1.2-6.fc9.i386
Oct 30 23:20:21 Updated:kdebase-workspace-4.1.2-6.fc9.i386
Oct 30 23:20:27 Updated:6:kdebase-4.1.2-5.fc9.i386
Oct 30 23:20:39 Installed:kdebase-runtime-libs-4.1.2-5.fc9.i386
Oct 30 23:20:42 Updated:6:kdemultimedia-4.1.2-2.fc9.i386

By default, tail displays the last 10 lines. tail -30 /var/log/yum.log would show the last 30 lines. You can use any arbitrary number.

grep

Search for a specific string within a file. (use zgrep to search a gzipped file)

[kmurray@radon ~]$ grep firefox /var/log/yum.log
Jun 19 16:19:33 Updated:firefox-3.0-1.fc9.i386
Jul 24 04:48:06 Updated:firefox-3.0.1-1.fc9.i386
Oct 18 03:13:52 Updated:firefox-3.0.2-1.fc9.i386

This shows that “firefox” is listed three times in this file.

type

Determine which directory a command is in.

[kmurray@radon ~]$ type ping
ping is hashed (/bin/ping)

Ahh, so ping lives in /bin.

locate

Locate any arbitrary file on the filesystem.

[kmurray@radon ~]$ locate *.rpm
/home/kmurray/Download/VirtualBox-2.0.2_36488_fedora9-1.i386.rpm
/home/kmurray/Download/VirtualBox-2.0.4_38406_fedora9-1.i386.rpm
/home/kmurray/Download/skype-2.0.0.72-fc5.i586.rpm
/home/kmurray/Download/synaptics-0.14.6-8.fc9.i386.rpm

I have four rpm files on this computer, all of them in /home/kmurray/Download.

file

Determine what type a file is.

[kmurray@radon ~]$ file /bin/ping
/bin/ping:setuid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

ping is a binary file.

[kmurray@radon ~]$ file Mythbusters.S02E04.flv
Mythbusters.flv:Macromedia Flash Video

Mythbusters.S02E04.flv is a video.

[kmurray@radon ~]$ file /var/log/yum.log
/var/log/yum.log:ASCII text

/var/log/yum.log is a plain text file.

history

Shows what commands you have been running on the command line.

[kmurray@radon ~]$ history

991 du -hc Documents/N95/tutorials/
992 ls /var/log/messages
993 tail /var/log/messages
994 ls
995 ls /var/log/
996 ls -lh /var/log/
997 tail /var/log/yum.log
998 head /var/log/yum.log
999 grep firefox /var/log/yum.log
1000 sudo su –
1001 cd src/
1002 ls
1003 tar -xvzf TrueCrypt\ 6.1\ Source.tar.gz
1004 cd truecrypt-6.1-source/
1005 ls
1006 less Readme.txt
1007 make
1008 less Readme.txt
1009 make
1010 make
1011 cd
1012 cd .VirtualBox/VDI/
1013 ls
1014 cat RawUSBsdb.vdi
1015 mv RawUSBsdb.vdi RawUSBsdb1G.vdi
1016 cp RawUSBsdb1G.vdi RawUSBsdb2G.vdi
1017 vim RawUSBsdb2G.vdi
1018 rm RawUSBsdb2G.vdi
1019 pwd
1020 VBoxManage internalcommands createrawvmdk -filename /home/kmurray/.VirtualBox
1021 cat RawUSBsdb2G.vdi
1022 cd

In order to discover which commands I use most so I could write this list, I used a combination of five different commands all piped together:

history | awk {‘print $2’} | sắp xếp | uniq | less

awk {‘print $2’} causes only the second column of the output to be displayed, sort puts everything in alphabetical order, uniq cuts out all the duplicates, and less causes the output to be displayed one screen at a time.

If you have any favourite bash commands that you would like to share, please tell us about them in the comments below.