查看到flash中有舊版本IOS資料夾
switch#dir
Directory of flash:/
2 -rwx 1596 Sep 1 2016 14:44:22 +08:00 vlan.dat
3 -rwx 5465 Sep 8 2016 10:11:30 +08:00 config.text
4 -rwx 4120 Sep 8 2016 10:11:30 +08:00 multiple-fs
6 -rwx 4896 Sep 8 2016 10:11:30 +08:00 private-config.text
7 drwx 192 May 9 2011 13:51:25 +08:00 c2960-lanbasek9-mz.122-46.SE
8 -rwx 9822428 Nov 9 2016 19:56:25 +08:00 c2960-lanbasek9-mz.122-55.SE11.bin
若一般要刪除flash中的檔案,會執行delete或rmdir
delete主要是刪除檔案非資料夾。
rmdir是刪除資料夾,但資料夾內要為空。
switch#dir flash:/c2960-lanbasek9-mz.122-46.SE/
Directory of flash:/c2960-lanbasek9-mz.122-46.SE/
8 drwx 4800 May 9 2011 13:49:01 +08:00 html
552 -rwx 7241051 May 9 2011 13:51:25 +08:00 c2960-lanbasek9-mz.122-46.SE.bin
553 -rwx 533 May 9 2011 13:51:25 +08:00 info
switch#rmdir flash:/c2960-lanbasek9-mz.122-46.SE
Remove directory filename [c2960-lanbasek9-mz.122-46.SE]?
Delete flash:/c2960-lanbasek9-mz.122-46.SE [confirm]
%Error Removing dir flash:c2960-lanbasek9-mz.122-46.SE (Directory not empty)
此時我們就可以採用以下命令來刪除一個不為空的資料夾
switch#delete /recursive /force flash:/c2960-lanbasek9-mz.122-46.SE
/recursive 刪除指定資料夾下的檔案及資料夾
/force 刪除並不給出提示
switch#dir
Directory of flash:/
2 -rwx 1596 Sep 1 2016 14:44:22 +08:00 vlan.dat
3 -rwx 5465 Sep 8 2016 10:11:30 +08:00 config.text
4 -rwx 4120 Sep 8 2016 10:11:30 +08:00 multiple-fs
6 -rwx 4896 Sep 8 2016 10:11:30 +08:00 private-config.text
7 -rwx 9822428 Nov 9 2016 19:56:25 +08:00 c2960-lanbasek9-mz.122-55.SE11.bin
留言列表