Hi friends! Tonight I am back with 2 simple but useful Linux tricks. First one is about formatting a USB Pen Drive and another one is about making a file unchangeable. So let’s start-

                                                 Format A USB Pen Drive

  • First of all get the USB drive name by issuing fdisk-l command. It will list all the partitions currently available. Suppose it is /dev/sdb1
  • Once you get got the name then issue mkfs.vfat /dev/sdb1

Now your USB drive is completely formatted. Time for another trick-

                                               Make A File Unchangeable

This is quite simple. Suppose we have a file called info.txt. Now we can make it unchangeable by issuing just a single command

chattr+i info.txt

Now even the root user can’t delete it rename it modify it. Only root can reset it attribute using chattr-i info.txt to get the control over this file. I hope you like this.

Enhanced by Zemanta