已经找到“” 的记录352条
Linux fdformat命令

Linux fdformat命令

Linux 命令大全 Linux 命令大全

Linux fdformat命令用于对指定的软碟机装置进行低阶格式化。

使用这个指令对软碟格式化的时候,最好指定像是下面的装置:

  • /dev/fd0d360 磁碟机 A: ,磁片为 360KB 磁碟
  • /dev/fd0h1440 磁碟机 A: ,磁片为 1.4MB 磁碟
  • /dev/fd1h1200 磁碟机 B: ,磁片为 1.2MB 磁碟

如果使用像是 /dev/fd0 之类的装置,如果里面的磁碟不是标准容量,格式化可能会失败。在这种情况之下,使用者可以用 setfdprm 指令先行指定必要参数。

语法

fdformat [-n] device

参数

  • -n 关闭确认功能。这个选项会关闭格式化之后的确认步骤。

实例

fdformat -n /dev/fd0h1440

将磁碟机 A 的磁片格式化成 1.4MB 的磁片。并且省略确认的步骤。

Linux 命令大全 Linux 命令大全

Linux fsconf命令

Linux fsconf命令

Linux 命令大全 Linux 命令大全

Linux fsconf命令用于设置文件系统相关功能。

fsconf是Red Hat Linux发行版专门用来调整Linux各项设置的程序。

语法

fsconf [--check]

参数

  • --chedk 检查特定文件的权限。

Linux 命令大全 Linux 命令大全

Linux fsck.minix命令

Linux fsck.minix命令

Linux 命令大全 Linux 命令大全

Linux fsck.minix命令用于检查文件系统并尝试修复错误。

当minix文件系统发生错误时,可用fsck.minix指令尝试加以参考。

语法

fsck.minix [-aflmrsv][外围设备代号]

参数

  • -a 自动修复文件系统,不询问任何问题。
  • -f 强制对该文件系统进行完整检查,纵然该文件系统在慨略检查下没有问题。
  • -l 列出所有文件名称。
  • -m 使用类似MINIX操作系统的警告信息。
  • -r 采用互动模式,在执行修复时询问问题,让用户得以确认并决定处理方式。
  • -s 显示该分区第一个磁区的相关信息。
  • -v 显示指令执行过程。

Linux 命令大全 Linux 命令大全

Linux fsck 命令

Linux fsck 命令

Linux 命令大全 Linux 命令大全

Linux fsck(英文全拼:file system check)命令用于检查与修复 Linux 档案系统,可以同时检查一个或多个 Linux 档案系统。

语法

fsck [-sACVRP] [-t fstype] [--] [fsck-options] filesys [...]

参数

  • filesys : device 名称(eg./dev/sda1),mount 点 (eg. / 或 /usr)
  • -t : 给定档案系统的型式,若在 /etc/fstab 中已有定义或 kernel 本身已支援的则不需加上此参数
  • -s : 依序一个一个地执行 fsck 的指令来检查
  • -A : 对/etc/fstab 中所有列出来的 partition 做检查
  • -C : 显示完整的检查进度
  • -d : 列印 e2fsck 的 debug 结果
  • -p : 同时有 -A 条件时,同时有多个 fsck 的检查一起执行
  • -R : 同时有 -A 条件时,省略 / 不检查
  • -V : 详细显示模式
  • -a : 如果检查有错则自动修复
  • -r : 如果检查有错则由使用者回答是否修复

实例

检查 msdos 档案系统的 /dev/hda5 是否正常,如果有异常便自动修复 :

fsck -t msdos -a /dev/hda5

注意 此指令可与 /etc/fstab 相互参考操作来加以了解。

Linux 命令大全 Linux 命令大全

Linux ext2ed命令

Linux ext2ed命令

Linux 命令大全 Linux 命令大全

Linux ext2ed命令是ext2文件系统编辑程序。

ext2ed可直接处理硬盘分区上的数据,这指令只有Red Hat Linux才提供。

语法

ext2ed

一般指令:

  • setdevice[设备名称] 指定要处理的设备。
  • disablewrite 将ext2ed设为只读的状态。
  • enablewrite 将ext2ed设为可读写的状态。
  • help[指令] 显示个别指令的帮助。
  • next 移至下一个单位,单位会依目前所在的模式而异。
  • prev 移至前一个单位,单位会依目前所在的模式而异。
  • pgup 移至下一页。
  • pgdn 移至上一页。
  • set 修改目前的数据,参数会依目前所在的模式而异。
  • writedata 在执行此指令之后,才会实际修改分区中的数据。
  • ext2进入3种模式的指令
  • super 进入main superblock,即Superblock模式。
  • group<编号> 进入指定的group,即Group模式。
  • cd<目录或文件> 在inode模式下,进入指定的目录或文件,即Inode模式。
  • Superblock模式
  • gocopy<备份编号> 进入指定的superblock备份。
  • setactivecopy 将目前所在的superblock,复制到main superblock。
  • Group模式
  • blockbitmap 显示目前groupo的区块图。
  • inode 进入目前group的第一个inode。
  • inodebitmap 显示目前group的inode二进制码。
  • Inode模式
  • dir 进入目录模式。
  • file 进入文件模式。

Linux 命令大全 Linux 命令大全

Linux e2fsck命令

Linux e2fsck命令

Linux 命令大全 Linux 命令大全

Linux e2fsck命令用于检查使用 Linux ext2 档案系统的 partition 是否正常工作。

语法

e2fsck [-pacnydfvFV] [-b superblock] [-B blocksize] [-l|-L bad_blocks_file] [-C fd] device

参数说明

  • device : 预备检查的硬盘 partition,例如:/dev/sda1
  • -a : 对 partition 做检查,若有问题便自动修复,等同 -p 的功能
  • -b : 设定存放 superblock 的位置
  • -B : 设定单位 block 的大小
  • -c : 检查该partition 是否有坏轨
  • -C file : 将检查的结果存到 file 中以便查看
  • -d : 列印 e2fsck 的 debug 结果
  • -f : 强制检查
  • -F : 在开始检查前,将device 的 buffer cache 清空,避免有错误发生
  • -l bad_blocks_file : 将有坏轨的block资料加到 bad_blocks_file 里面
  • -L bad_blocks_file : 设定坏轨的block资料存到 bad_blocks_file 里面,若无该档则自动产生
  • -n : 将档案系统以[唯读]方式开启
  • -p : 对 partition 做检查,若有问题便自动修复
  • -v : 详细显示模式
  • -V : 显示出目前 e2fsck 的版本
  • -y : 预先设定所有检查时的问题均回答[是]

实例

检查 /dev/hda5 是否正常,如果有异常便自动修复,并且设定若有问答,均回答[是] :

e2fsck -a -y /dev/hda5

注意 :

大部份使用 e2fsck 来检查硬盘 partition 的情况时,通常都是情形特殊,因此最好先将该 partition umount,然后再执行 e2fsck 来做检查,若是要非要检查 / 时,则请进入 singal user mode 再执行。

Linux 命令大全 Linux 命令大全

Linux dd 命令

Linux dd 命令

Linux 命令大全 Linux 命令大全

Linux dd 命令用于读取、转换并输出数据。

dd 可从标准输入或文件中读取数据,根据指定的格式来转换数据,再输出到文件、设备或标准输出。

参数说明:

  • if=文件名:输入文件名,默认为标准输入。即指定源文件。
  • of=文件名:输出文件名,默认为标准输出。即指定目的文件。
  • ibs=bytes:一次读入bytes个字节,即指定一个块大小为bytes个字节。
    obs=bytes:一次输出bytes个字节,即指定一个块大小为bytes个字节。
    bs=bytes:同时设置读入/输出的块大小为bytes个字节。
  • cbs=bytes:一次转换bytes个字节,即指定转换缓冲区大小。
  • skip=blocks:从输入文件开头跳过blocks个块后再开始复制。
  • seek=blocks:从输出文件开头跳过blocks个块后再开始复制。
  • count=blocks:仅拷贝blocks个块,块大小等于ibs指定的字节数。
  • conv=<关键字>,关键字可以有以下11种:
    • conversion:用指定的参数转换文件。
    • ascii:转换ebcdic为ascii
    • ebcdic:转换ascii为ebcdic
    • ibm:转换ascii为alternate ebcdic
    • block:把每一行转换为长度为cbs,不足部分用空格填充
    • unblock:使每一行的长度都为cbs,不足部分用空格填充
    • lcase:把大写字符转换为小写字符
    • ucase:把小写字符转换为大写字符
    • swap:交换输入的每对字节
    • noerror:出错时不停止
    • notrunc:不截短输出文件
    • sync:将每个输入块填充到ibs个字节,不足部分用空(NUL)字符补齐。
  • --help:显示帮助信息
  • --version:显示版本信息

实例

在Linux 下制作启动盘,可使用如下命令:

dd if=boot.img of=/dev/fd0 bs=1440k 

将testfile文件中的所有英文字母转换为大写,然后转成为testfile_1文件,在命令提示符中使用如下命令:

dd if=testfile_2 of=testfile_1 conv=ucase 

其中testfile_2 的内容为:

$ cat testfile_2 #testfile_2的内容  
HELLO LINUX!  
Linux is a free unix-type opterating system.  
This is a linux testfile!  
Linux test 

转换完成后,testfile_1 的内容如下:

$ dd if=testfile_2 of=testfile_1 conv=ucase #使用dd 命令,大小写转换记录了0+1 的读入  
记录了0+1 的写出  
95字节(95 B)已复制,0.000131446 秒,723 KB/s  
cmd@hdd-desktop:~$ cat testfile_1 #查看转换后的testfile_1文件内容  
HELLO LINUX!  
LINUX IS A FREE UNIX-TYPE OPTERATING SYSTEM.  
THIS IS A LINUX TESTFILE!  
LINUX TEST #testfile_2中的所有字符都变成了大写字母 

由标准输入设备读入字符串,并将字符串转换成大写后,再输出到标准输出设备,使用的命令为:

dd conv=ucase 

输入以上命令后按回车键,输入字符串,再按回车键,按组合键Ctrl+D 退出,出现以下结果:

$ dd conv=ucase 
Hello Linux! #输入字符串后按回车键  
HELLO LINUX! #按组合键Ctrl+D退出,转换成大写结果  
记录了0+1 的读入  
记录了0+1 的写出  
13字节(13 B)已复制,12.1558 秒,0.0 KB/s 

Linux 命令大全 Linux 命令大全

Linux cfdisk命令

Linux cfdisk命令

Linux 命令大全 Linux 命令大全

Linux cfdisk命令用于磁盘分区。

cfdisk是用来磁盘分区的程序,它十分类似DOS的fdisk,具有互动式操作界面而非传统fdisk的问答式界面,您可以轻易地利用方向键来操控分区操作。

语法

cfdisk [-avz][-c <柱面数目>-h <磁头数目>-s <盘区数目>][-P <r,s,t>][外围设备代号]

参数说明:

  • -a 在程序里不用反白代表选取,而以箭头表示。
  • -c<柱面数目> 忽略BIOS的数值,直接指定磁盘的柱面数目。
  • -h<磁头数目> 忽略BIOS的数值,直接指定磁盘的磁头数目。
  • -P<r,s,t> 显示分区表的内容,附加参数"r"会显示整个分区表的详细资料,附加参数"s"会依照磁区的顺序显示相关信息,附加参数"t"则会以磁头,磁区,柱面的方式来显示资料。
  • -s<磁区数目> 忽略BIOS的数值,直接指定磁盘的磁区数目。
  • -v 显示版本信息。
  • -z 不读取现有的分区,直接当作没有分区的新磁盘使用。

实例

进行磁盘分区:

# cfsik

进行磁盘分区,使用箭头进行操作,而不使用反白表示:

# cfsik -a

进行磁盘分区,使用箭头进行操作,而不使用反白表示:

# cfsik -s 3

Linux 命令大全 Linux 命令大全

Linux badblocks命令

Linux badblocks命令

Linux 命令大全 Linux 命令大全

Linux badblocks命令用于检查磁盘装置中损坏的区块。

执行指令时须指定所要检查的磁盘装置,及此装置的磁盘区块数。

语法

badblocks [-svw][-b <区块大小>][-o <输出文件>][磁盘装置][磁盘区块数][启始区块]

参数说明

  • -b<区块大小> 指定磁盘的区块大小,单位为字节。
  • -o<输出文件> 将检查的结果写入指定的输出文件。
  • -s 在检查时显示进度。
  • -v 执行时显示详细的信息。
  • -w 在检查时,执行写入测试。
  • [磁盘装置] 指定要检查的磁盘装置。
  • [磁盘区块数] 指定磁盘装置的区块总数。
  • [启始区块] 指定要从哪个区块开始检查。

实例

查看系统当前硬盘信息。

# fdisk -l

例如,显示信息如下:

Disk /dev/sda: 298.9 GB, 298999349248 bytes
255 heads, 63 sectors/track, 36351 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         262     2104483+  82  Linux swap / Solaris
/dev/sda2   *         263       32898   262148670   83  Linux
/dev/sda3           32899       36351    27736222+  83  Linux

Disk /dev/sdb: 42.9 GB, 42949672960 bytes
64 heads, 32 sectors/track, 40960 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

通过命令扫描硬盘。

# badblocks -s -v /dev/sdnx

其中n表示硬盘设备名,x表示硬盘对应的分区号。例如需要检查"/dev/sda2",执行命令如下:

# badblocks -s -v /dev/sda2

Checking blocks 0 to 30681000
Checking for bad blocks (read-only test): 306809600674112/ 306810000000
30680964
30680965
30680966
30680967
30680968
30680969
30680970
30680971
30680972
30680973
...
done
Pass completed, 37 bad blocks found.其中,“37 bad blocks found”表示硬盘存在37个坏块。

Linux 命令大全 Linux 命令大全

Linux zipinfo命令

Linux zipinfo命令

Linux 命令大全 Linux 命令大全

Linux zipinfo命令用于列出压缩文件信息。

执行zipinfo指令可得知zip压缩文件的详细信息。

语法

zipinfo [-12hlmMstTvz][压缩文件][文件...][-x <范本样式>]

参数

  • -1 只列出文件名称。
  • -2 此参数的效果和指定"-1"参数类似,但可搭配"-h","-t"和"-z"参数使用。
  • -h 只列出压缩文件的文件名称。
  • -l 此参数的效果和指定"-m"参数类似,但会列出原始文件的大小而非每个文件的压缩率。
  • -m 此参数的效果和指定"-s"参数类似,但多会列出每个文件的压缩率。
  • -M 若信息内容超过一个画面,则采用类似more指令的方式列出信息。
  • -s 用类似执行"ls -l"指令的效果列出压缩文件内容。
  • -t 只列出压缩文件内所包含的文件数目,压缩前后的文件大小及压缩率。
  • -T 将压缩文件内每个文件的日期时间用年,月,日,时,分,秒的顺序列出。
  • -v 详细显示压缩文件内每一个文件的信息。
  • -x<范本样式> 不列出符合条件的文件的信息。
  • -z 如果压缩文件内含有注释,就将注释显示出来。

实例

显示压缩文件信息

[root@w3cschool.cc a]# zipinfo cp.zip 
Archive: cp.zip  486 bytes  4 files
-rw-r--r-- 2.3 unx    0 bx stor 24-May-10 18:54 a.c
-rw-r--r-- 2.3 unx    0 bx stor 24-May-10 18:54 b.c
-rw-r--r-- 2.3 unx    0 bx stor 24-May-10 18:54 c.c
-rw-r--r-- 2.3 unx    0 bx stor 24-May-10 18:54 e.c
4 files, 0 bytes uncompressed, 0 bytes compressed: 0.0%
[root@w3cschool.cc a]# 

显示压缩文件中每个文件的信息

[root@w3cschool.cc a]# zipinfo -v cp.zip 
Archive: cp.zip  486 bytes  4 files

End-of-central-directory record:
-------------------------------

 Actual offset of end-of-central-dir record:     464 (000001D0h)
 Expected offset of end-of-central-dir record:    464 (000001D0h)
 (based on the length of the central directory and its expected offset)

 This zipfile constitutes the sole disk of a single-part archive; its
 central directory contains 4 entries. The central directory is 248
 (000000F8h) bytes long, and its (expected) offset in bytes from the
 beginning of the zipfile is 216 (000000D8h).

 There is no zipfile comment.

Central directory entry #1:
---------------------------

 a.c

 offset of local header from start of archive:   0 (00000000h) bytes
 file system or operating system of origin:    Unix
 version of encoding software:           2.3
 minimum file system compatibility required:    MS-DOS, OS/2 or NT FAT
 minimum software version required to extract:   1.0
 compression method:                none (stored)
 file security status:               not encrypted
 extended local header:              no
 file last modified on (DOS date/time):      2010 May 24 18:54:26
 file last modified on (UT extra field modtime):  2010 May 24 18:54:26 local
 file last modified on (UT extra field modtime):  2010 May 24 10:54:26 UTC
 32-bit CRC value (hex):              00000000
 compressed size:                 0 bytes
 uncompressed size:                0 bytes
 length of filename:                3 characters
 length of extra field:              13 bytes
 length of file comment:              0 characters
 disk number on which file begins:         disk 1
 apparent file type:                binary
 Unix file attributes (100644 octal):       -rw-r--r--
 MS-DOS file attributes (00 hex):         none

 The central-directory extra field contains:
 - A subfield with ID 0x5455 (universal time) and 5 data bytes.
  The local extra field has UTC/GMT modification/access times.
 - A subfield with ID 0x7855 (Unix UID/GID) and 0 data bytes.

 There is no file comment.

Central directory entry #2:
---------------------------

 b.c

 offset of local header from start of archive:   54 (00000036h) bytes
 file system or operating system of origin:    Unix
 version of encoding software:           2.3
 minimum file system compatibility required:    MS-DOS, OS/2 or NT FAT
 minimum software version required to extract:   1.0
 compression method:                none (stored)
 file security status:               not encrypted
 extended local header:              no
 file last modified on (DOS date/time):      2010 May 24 18:54:26
 file last modified on (UT extra field modtime):  2010 May 24 18:54:26 local
 file last modified on (UT extra field modtime):  2010 May 24 10:54:26 UTC
 32-bit CRC value (hex):              00000000
 compressed size:                 0 bytes
 uncompressed size:                0 bytes
 length of filename:                3 characters
 length of extra field:              13 bytes
 length of file comment:              0 characters
 disk number on which file begins:         disk 1
 apparent file type:                binary
 Unix file attributes (100644 octal):       -rw-r--r--
 MS-DOS file attributes (00 hex):         none

 The central-directory extra field contains:
 - A subfield with ID 0x5455 (universal time) and 5 data bytes.
  The local extra field has UTC/GMT modification/access times.
 - A subfield with ID 0x7855 (Unix UID/GID) and 0 data bytes.

 There is no file comment.

Central directory entry #3:
---------------------------

 c.c

 offset of local header from start of archive:   108 (0000006Ch) bytes
 file system or operating system of origin:    Unix
 version of encoding software:           2.3
 minimum file system compatibility required:    MS-DOS, OS/2 or NT FAT
 minimum software version required to extract:   1.0
 compression method:                none (stored)
 file security status:               not encrypted
 extended local header:              no
 file last modified on (DOS date/time):      2010 May 24 18:54:26
 file last modified on (UT extra field modtime):  2010 May 24 18:54:26 local
 file last modified on (UT extra field modtime):  2010 May 24 10:54:26 UTC
 32-bit CRC value (hex):              00000000
 compressed size:                 0 bytes
 uncompressed size:                0 bytes
 length of filename:                3 characters
 length of extra field:              13 bytes
 length of file comment:              0 characters
 disk number on which file begins:         disk 1
 apparent file type:                binary
 Unix file attributes (100644 octal):       -rw-r--r--
 MS-DOS file attributes (00 hex):         none

 The central-directory extra field contains:
 - A subfield with ID 0x5455 (universal time) and 5 data bytes.
  The local extra field has UTC/GMT modification/access times.
 - A subfield with ID 0x7855 (Unix UID/GID) and 0 data bytes.

 There is no file comment.

Central directory entry #4:
---------------------------

 e.c

 offset of local header from start of archive:   162 (000000A2h) bytes
 file system or operating system of origin:    Unix
 version of encoding software:           2.3
 minimum file system compatibility required:    MS-DOS, OS/2 or NT FAT
 minimum software version required to extract:   1.0
 compression method:                none (stored)
 file security status:               not encrypted
 extended local header:              no
 file last modified on (DOS date/time):      2010 May 24 18:54:26
 file last modified on (UT extra field modtime):  2010 May 24 18:54:26 local
 file last modified on (UT extra field modtime):  2010 May 24 10:54:26 UTC
 32-bit CRC value (hex):              00000000
 compressed size:                 0 bytes
 uncompressed size:                0 bytes
 length of filename:                3 characters
 length of extra field:              13 bytes
 length of file comment:              0 characters
 disk number on which file begins:         disk 1
 apparent file type:                binary
 Unix file attributes (100644 octal):       -rw-r--r--
 MS-DOS file attributes (00 hex):         none

 The central-directory extra field contains:
 - A subfield with ID 0x5455 (universal time) and 5 data bytes.
  The local extra field has UTC/GMT modification/access times.
 - A subfield with ID 0x7855 (Unix UID/GID) and 0 data bytes.

 There is no file comment.

Linux 命令大全 Linux 命令大全

客户热线: