Linux command for disk and file system

Commands for disk and file system:

In this Disk and File system commands, it will display the free disk space along with total size and available space on all file system. We can also check the disk for an error and repair it.
df – it will display the free disk space
df –h it will display the total size and available space on all file system
mount – it make the disk accessible
mount –a /etc/fstab it will mount all file system located in the /etc/fstab file
mount –t msdos/dev/fd0/mnt mount the floppy drive with an msdos filesystem to /mnt
mount –t iso9660/dev/sr0/cd mount the cd-rom under the directory /cd
umount /mnt/cdrom it will unmount the cd-rom
fsck - it check the disk for an error
fsck /hda – it check the file system and repair it

Commands for File comparison:

In this File Comparison commands we will discuss about comparing of files line by line and also with byte by byte. We will also search for common files from no. of files

diff - it compares the files line by line

diff file1 file2 it compares the two files and shows where they are different

cmp - it comparing the two files byte by byte

cmp file1 file2 it compare the files and shows which file as more bytes

cmp –l file1 file2 it gives the detailed list of byte number and the different bytes in octal for each character.

comm – it will find out which is common

comm file1 file2 it will take common files from both of the files

0 comments:

Post a Comment