≡ Menu

shell

In order to write DVD/DVD-RW from shell prompt you need to install a package called dvd+rw-tools.

DVD is another good option for backup, archiving, data exchange etc. You can install dvd+rw-tools with following commands. Also note that this package works under *BSD, HP-UX, Solaris and other UNIX like operating systems.

Debian installation:
# apt-get install 'dvd+rw-tools'

Fedora Core Linux installation:
# yum install 'dvd+rw-tools'

RedHat Enterprise Linux installation:
# up2date 'dvd+rw-tools'

In order to write DVD you need to install cdrecord tools.

How do I write DVD?

You need to use growisofs command, which combined mkisofs frontend/DVD recording program. From growisofs man page, "growisofs was originally designed as a frontend to mkisofs to facilitate appending of data to ISO9660 volumes residing on random-access media such as DVD+RW, DVD-RAM, plain files, hard disk partitions. In the course of development general purpose DVD recording support was implemented, and as of now growisofs supports not only random-access media, but even mastering of multiession DVD media such as DVD+R and DVD-R/-RW. In addition growisofs supports first-/single-session recording of arbitrary pre-mastered image (formatted as UDF, ISO9660 or any other file system, if formatted at all) to all supported DVD media types."

First create the ISO image
# mkisofs -r -o /tmp/var-www-disk1.iso /var/www

Now use the growisofs command to write the ISO onto the DVD:
# growisofs -Z /dev/dvd=/tmp/var-www-disk1.iso

To append more data for same DVD:
# growisofs -M /dev/dvd /tmp/file.1

To format (erase) a DVD:
# dvd+rw-format -force /dev/dvd
OR
# dvd+rw-format -force=full /dev/dvd

The dvd+rw-format command formats dvd disk in the specified dvd drive.

To display information about dvd drive and disk using dvd+rw-mediainfo command:
# dvd+rw-mediainfo /dev/dvd

See also:

The iftop command listens to network traffic on a named network interface, or on the first interface it can find which looks like an external interface if none is specified, and displays a table of current bandwidth usage by pairs of hosts. iftop is a perfect tool for remote Linux server over ssh session.
[click to continue…]

Use Crontab Command With sys account

Asked by Waman R. Kumar

Q. Ok, let me confess first, it was question asked in Linux job interview. Question was after typing crontab -u user -e or crontab -e command system gave back some error code to user, he further told me that crond and and other utilities are installed. How to fix this problem? Not to mentioned I was unable to answer question. So what is the solution to such unseen problem?

A. crontab is the program used to install, deinstall or list the tables used to drive the cron daemon/service in Vixie Cron. Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs (under Debian), they are not intended to be edited directly. So first you use crontab -e command. If variable EDITOR is not defined in your environment you will use ed text editor – it is a line-oriented text editor. Try following (under BASH)

$ export EDITOR=ed
$ crontab -u user -e

70
?

Type q and hit enter to exit. Now setup EDITOR to vim

$ export EDITOR=/usr/bin/vim
$ crontab -u user -e

Now it will open in vim/vi text editor. This kind of questions asked in Linux/UNIX job interview to test your basic knowledge of Operating system. So it is always good idea to define EDITOR variable in you shell startup file such as .bash_profile.

And, yes you can use use crontab command with sys account too:
# crontab -u sys -e

The superuser is a privileged user with unrestricted access to all files and commands. The superuser has the special UID (user ID) 0. You need to become super user (root) only when tasks need root permissions. Here is how to become a super user:
[click to continue…]

FreeBSD: Enable Colorized ls Output

FreeBSD has ls command to list directory contents. You can pass the -G option to the ls command to enable colorized output. For example, type the following command at shell prompt to get colorized output:
[click to continue…]