p The .Fl d option enables additional debugging output (which comes primarily from .Xr fsck 8 Ns -derived code).
p The .Fl F option indicates that .Ar filesystem is a file system image, rather than a raw character device. It will be accessed .Sq as-is , and no attempts will be made to read a disklabel.
p The .Fl n option disables writing to the device, preventing any changes from being made to the filesystem.
p The .Fl N option causes the superblock not to be marked dirty when .Nm exits. .Sh COMMANDS Besides the built-in .Xr editline 3 commands, .Nm supports these commands:
p l -tag -width indent -compact t Cm help Print out the list of accepted commands.
p t Cm inode Ar i-number Select inode .Ar i-number as the new current inode.
p t Cm back Revert to the previously current inode.
p t Cm clri Ar i-number Clear the inode .Ar i-number .
p t Cm lookup Ar name t Cm cd Ar name Find .Ar name in the current directory and make its inode the current inode. .Ar Name may be a multi-component name or may begin with slash to indicate that the root inode should be used to start the lookup. If some component along the pathname is not found, the last valid directory encountered is left as the active inode. This command is valid only if the starting inode is a directory.
p t Cm active t Cm print Print out the active inode.
p t Cm uplink Increment the active inode's link count.
p t Cm downlink Decrement the active inode's link count.
p t Cm linkcount Ar number Set the active inode's link count to .Ar number .
p t Cm ls List the current inode's directory entries. This command is valid only if the current inode is a directory.
p t Cm blks List the current inode's blocks numbers.
p t Cm findblk Ar disk block number ... Find the inode(s) owning the specified disk block(s) number(s). Note that these are not absolute disk blocks numbers, but offsets from the start of the partition.
p t Cm saveblks Ar filename Save the current inode's data into .Ar filename .
p t Cm rm Ar name t Cm del Ar name Remove the entry .Ar name from the current directory inode. This command is valid only if the current inode is a directory.
p t Cm ln Ar ino Ar name Create a link to inode .Ar ino under the name .Ar name in the current directory inode. This command is valid only if the current inode is a directory.
p t Cm chinum Ar dirslot Ar inum Change the i-number in directory entry .Ar dirslot to .Ar inum .
p t Cm chname Ar dirslot Ar name Change the name in directory entry .Ar dirslot to .Ar name . This command cannot expand a directory entry. You can only rename an entry if the name will fit into the existing directory slot.
p t Cm chtype Ar type Change the type of the current inode to .Ar type . .Ar type may be one of: .Em file , .Em dir , .Em socket , or .Em fifo .
p t Cm chmod Ar mode Change the mode bits of the current inode to .Ar mode . You cannot change the file type with this subcommand; use c chtype to do that.
p t Cm chflags Ar flags Change the file flags of the current inode to .Ar flags .
p t Cm chown Ar uid Change the owner of the current inode to .Ar uid .
p t Cm chgrp Ar gid Change the group of the current inode to .Ar gid .
p t Cm chgen Ar gen Change the generation number of the current inode to .Ar gen .
p t Cm mtime Ar time t Cm ctime Ar time t Cm atime Ar time t Cm birthtime Ar time Change the modification, change, access time, or birthtime (respectively) on the current inode to .Ar time . .Ar Time should be in the format .Em YYYYMMDDHHMMSS[.nsec] where .Em nsec is an optional nanosecond specification. If no nanoseconds are specified, the .Va mtimensec , .Va ctimensec , .Va atimensec , or .Va birthtimensec field will be set to zero. The birthtime field is only available on ufs2 filesystems.
p t Cm quit , Cm q , Cm exit , Aq Em EOF Exit the program. .El .Sh SEE ALSO .Xr editline 3 , .Xr fs 5 , .Xr clri 8 , .Xr fsck 8 .Sh HISTORY .Nm uses the source code for .Xr fsck 8 to implement most of the file system manipulation code. The remainder of .Nm first appeared in .Nx 1.1 . .Sh WARNING Use this tool with extreme caution -- you can damage an FFS file system beyond what .Xr fsck 8 can repair. .Sh BUGS Manipulation of .Dq short symlinks doesn't work (in particular, don't try changing a symlink's type). You must specify modes as numbers rather than symbolic names. There are a bunch of other things that you might want to do which .Nm doesn't implement.