Archive for November, 2010

Changing file ownership

Posted November 29, 2010 By grigoris

These are two commands to help us change the ownership of files, but we must be in the root or su mode first.

> chown <username> <file/folder> : used to change the owner of a file or folder

> chgrp <group> <file/folder> : used to change the group of a file or folder

> chown <username>.<group> <file/folder> : used to change the owner and the group in one step

> chown -R <username>.<group> <folder> : used to change the owner and the group of ALL files and directories under the parent <folder> (a very useful command !!)

(thanks to this post!)

Extracting rpm and deb packages

Posted November 4, 2010 By grigoris

[ Information from G-Loaded journal – many thanks! ]

The packages rpm and deb are used mainly by the package managers in order to easilly and successfully install any additional stuff. At the same time rpm and deb packages are also archives (cpio and ar archives respectively) that can be axtracted.

One way is of course to right click on the package and select extract as any nomal archived file (double-click will start the package manager and the installation process, something that we don’t want now!) .

A second way is through the command line:

For rpm (Fedora, RedHat, etc):
rpm2cpio mypackage.rpm | cpio -vid
and for deb (Ubuntu, Debian, etc), which contains three files (debian-binary, control.tar.gz, data.tar.gz – in which we are actually interested in!) :
ar vx mypackage.deb
tar -xzvf data.tar.gz

The -v option is optional, so if used then you get verbose output.

Then you can use the output (found on usr/ folder) as you want – my initial motivation was to to find a library needed for a 32bit program installed on a 64bit machine!.