Home >> Linux (page 2396)


Explain fstab file in linux

Everybody wants to know about /etc/fstab file It has a little bit different /etc/fstab file because the partitions, devices and their properties are different on different systems. But the basic structure of fstab is always the same. Here’s an example of the contents of /etc/fstab: /dev/hda2        /                        ext2                defaults                                 1 1 ... Read More »

How to make a File “immutable” or “unalterable”

If you want that no one can delete or modify any File in Linux, mean it cannot be changed or deleted even by root. Note this works on (ext2/ext3) filesystems. And, yes, root can delete after it’s changed back. As root: [amit@localhost] # chattr +i filename And to change it back: [amit@localhost] # chattr -i filename List attributes [amit@localhost] # ... Read More »

Bash Script – Burning contents to CDR disk

Bash Script Using ls to create a table of contents for burning a CDR disk #!/bin/bash # ex40.sh (burn-cd.sh) # Script to automate burning a CDR. SPEED=10 # May use higher speed if your hardware supports it. IMAGEFILE=cdimage.iso CONTENTSFILE=contents # DEVICE=/dev/cdrom For older versions of cdrecord DEVICE=”1,0,0″ DEFAULTDIR=/opt # This is the directory containing the data to be burned. # ... Read More »

how to set number permanently in vi editor

It is very easy to put numbers on every line in file while opening it with VI EDITOR First Option Step 1 : create a file in your Root Directory with name .exrc [root@root ~]# cd /root [root@root ~]# cd vi .exrc set number :wq Step 2 : Magic Begins [root@root ~]# now try to open any file through vi ... Read More »

how to flush mailq in sendmail or postfix

Some time many mail were in stuck queue, now there are two options either flush all mail to send them forcefully or delete them permanently. Traditional ” # sendmail -q” command flushes mail queue. Under Postfix, just enter the following to flush the mail queue # postfix flushor # postfix -f To see mail queue, enter: # mailq To remove ... Read More »