Pages

Running .dat files in linux and using vlc

.dat files which are generally vedio files are played easily in windows media player, but in linux not all players support .dat files.

We can use one of the following methods to run a .dat file

1. using vlc
vlc by default throws error when we try to run a .dat file.



To run a .dat in a vedio cd file using vlc do the following



The file in the cd should start playing automatically.

2. We can use the gxine player to run .dat file



Once the installation is done a new player called "gxine" will appear under sound and video menu which will directly play the .dat file with out any problems.

3. We can install windows media player using wine and run the .dat file from the windows media player.


du: Finding the file/folder size from command line in linux

To find the amount of space occupied by any file or folder in the system we can use the command du.

Let us say we have a folder test which contains the files file1,file2,file3,temp

To find the size of the folder test



The first column Indicates the size of the folder and the second column gives the name of the folder. By default du also lists the sizes of only the sub folders and not of files.
In case we want to have a look at the size of the files too we can use the option "-a"



The size column if displayed with no suffix can be difficult to read for bigger sized files, to make the reading easier we can use the option "-h" which sill convert it into more human readable form



The suffix K indicating the size is in Kilo bytes. For Mega bytes it will be M for giga G etc.
If we just want the size of the folder and not its sub folders we can use the option "-s"



We can also pass file names to find the size of a file instead of a folder.



Thus we can easily find the space occupied by any file or folder on the system using the du command

Different ways to find the linux kernel version

Here are two ways to find out the currently running kernel version of linux

1. Using uname to find the linux kernel version



2. Using sysctl to find the linux kernel version



3. Using proc entry to find the linux kernel version


No manual entry for pthread_create

While learning pthreads, if you try to have look at the man pages of pthread and get the error



Then you need to install the package manpages-posix-dev. If you are running debian based systems you can run the command.



Once the package is installed you should be able see the man pages for all posix related functions.

Finding the filesystem type of a partition in linux

To find the type of filesystem a partition or a media is of we can use the commands "df" or "mount".

Using df



The column with the heading "Type" gives the filesystem type. So the partition /dev/sda1 is of type ext4

To find the filesystem type of a specific partition pass the partition as the argument.



Using mount



As listed the partition /dev/sda1 is of type ext4.
We can find the specific partition type by combining mount with grep.