[root@localhost boot]# fdisk-l <--使用 fdisk命令時(shí)候 出現(xiàn)如下錯(cuò)誤
bash: fdisk-l: command not found
[root@localhost boot]# whereis fdisk <--查詢(xún)fdisk命令的位置
fdisk: /sbin/fdisk /usr/share/man/man8/fdisk.8.gz
[root@localhost boot]# echo $PATH <---查詢(xún)環(huán)境變量
/nfs/smartsvn/bin:/usr/local/sbin:/sbin:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/java/jdk1.7.0_25/bin:/usr/dev/svnclient/smartsvn-7_5_2/bin
[root@localhost boot]# echo $PATH | grep /sbin/fdisk <--再次確認(rèn)確實(shí)沒(méi)有fdisk命令所在位置
[root@localhost boot]# ln -s /sbin/fdisk /usr/local/sbin <--fdisk添加到當(dāng)前命令搜索路徑中即可
[root@localhost boot]# cd /usr/local/sbin <--確認(rèn)fdisk已經(jīng)添加到環(huán)境變量
[root@localhost sbin]# ls -F |grep /sbin/fdisk
[root@localhost sbin]# ls -F
fdisk@
[root@localhost sbin]# fdisk -l<--使用fdisk命令
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000f1e94
Device Boot Start End Blocks Id System
/dev/sda1 * 1 39 307200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 39 2354 18598912 83 Linux
/dev/sda3 2354 2611 2064384 82 Linux swap / Solaris |