Posts Tagged "Linux"

Viewing the Conent of Large Text Files in Linux

Ubuntu

Imagine that you have a 10mb text file. To view its content you could use famous text editors in gnome such as GEdit, but because the file is too big it’s hard for the editor to display the content. The most efficient way to view such files would be to use the terminal. Using the terminal commands you can select the portion of the file that you like to see.
You could use the head command to see the first few lines of the file.
$ head FILE

Or tail to view the last few lines of the file:
$ tail FILE

You could also use the “n” parameter in the command to specify the number of lines you like to see:
$ tail -n25 FILE

In order to view lines, which are neither at the beginning nor at the end of the file you could use the following command:
$ more +num10 FILE | head -n20
 
That displays 20 lines starting from line 10.

Read More

Reading ntfs partitions linux

 

here is how to read the ntfs partions without the need of being under root accont:
the first thing you need to to is to edit the fstab file, just use you favorite editor to edit this file im using vi editor:

su vi /etc/fstab

here is how my fstab file look like there are other ways to do it either,…

 

# /etc/fstab: static file system information.

#
#
proc            /proc           proc    defaults                        0       0
/dev/sda7       /               ext2    defaults,errors=remount-ro        0       1
/dev/sda2       /media/sda2     ntfs    ro,user,users,uid=1000            0       0
/dev/sda5       /media/sda5     ntfs    ro,user,users,uid=1000            0       0
/dev/sda6       /media/sda6     ntfs    ro,user,users,uid=1000            0       0
/dev/sda8       none            swap    sw                                0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto                    0       0

so far
there is no stable library which enables the user to write to the NTFS partitions. Although if you have fat32 partitions you will have no problem editing them.

Read More

Searching for files/folders linux

There are many ways to look for files in linux konsole you could use commands such as find, whereis. The best way to do that I belive is to use the locate command there are two steps to do, first update the data base to add the newly added files to it, then use the locate command to look for the file:

su updatedb
su locate filename

it’s extremely fast and so far I have tested it on many files and it’s working perfectly fineworking perfectly fine

Read More

Remove/uninstall Lilo/Grub

If you are planning to remove linux from your hard disk even if you format the linux partition you would again get the dual boot menu, to unistall it do one of the following:

For Windows 95/98 etc:
Use a dos boot disk and at the command prompt type:
fdisk /mbr

For Windows XP:
Boot off the XP Installation CD and go into rescue mode. From there run the command:
fixmbr

Read More

Ubuntu installing CVS server

CVS is a great tool when it comes to group projects. Using CVS you don’t need to be worried about redundancy in code,…
many information such as the person who edited the file and when it was edited are saved by cvs.
It also avoids the problem of over witing on someone elses code,…
To install a cvs server do the following steps:

#update the source list
sudo apt-get update
# Install CVS install CVS files:
sudo apt-get install cvs
#install CVS server:
sudo apt-apt install cvsd

When prompted in the cvsd installation process for Repository, type in “/cvsroot”.
at this point the CVS server is installed now we configure the cvs root and user accounts:

# Configure CVS
#goto /var/lib/cvsd and build the cvsroot:
sudo cvsd-buildroot /var/lib/cvsd
#create the folder cvsroot:
sudo mkdir cvsroot
#initilizing the repository
sudo cvs -d /var/lib/cvsd/cvsroot init
sudo chown -R cvsd:cvsd cvsroot
#create a user and password:
sudo cvsd-passwd /var/lib/cvsd/cvsroot +pourya
#and then change the Authentication type:
sudo vi /var/lib/cvsd/cvsroot/CVSROOT/config
#important: make sure that you uncomment the “SystemAuto=no” line.
#Otherwise the users may not be able to login to the repository
# Test the repository:
cvs -d :pserver:pourya@localhost:/cvsroot login
cvs -d :pserver:pourya@localhost:/cvsroot checkout
#In case you need to restart the server do:
sudo /etc/init.d/cvsd restart

If you get a connection refused message you would need to do the following to resolve the issue:

vi /etc/cvsd/cvsd.conf
#find the line containing the following
Listen * 2401
#change * to your servers IP. For instance in my case I had to change it to following:
Listen 192.168.1.104 2401
Read More