Submit Linux and UNIX Questions
|Knowledge Base||UNIX- and Linux- Variants|
|Red Hat Linux||SUSE Linux|
Interrelated Information Technology
|MS Operating Systems and Networks Questions||Web Design Questions|
|Web Server Questions||Programming Language Questions|
The Computer Education Techniques knowledge base is a service for answering questions, inclusive of the research and validation of the accuracy of information in the public domain. Citation of source documentation and examples are used to provide answers to the questions. Utilization of the information and reliance on the answers is done at your own risk.
|Q1||Our organization has recently updated to GRUB2. How can I ascertain where GRUB2 is installed?|
|A||GRUB2 incorporates a totally revised directory and file hierarchy. The menu.lst of GRUB legacy is no longer used.|
In order to find out where GRUB2 is installed, the user can run these two commands:
Device: sudo grub-probe -t device /boot/grub
UUID: sudo grub-probe -t fs_uuid /boot/grub
|Q2||How can a customized menu be created in GRUB2?|
|A||The user can create a custom file in which to menu entries. This file will not be overwritten. By default, a custom file named 40_custom is available for use in the /etc/grub.d folder. The
primary configuration file for changing menu display settings is grub and by default is located in the /etc/default folder.
Multiple files are used for configuring the menu:
1. /etc/default/grub .
2. All the files in the /etc/grub.d/ directory.
The main directories and files used by GRUB2 include:
The placement of the menu items in the grub.cfg menu is determined by the order in which the files in this directory are run. Files with a leading numeral are executed first, beginning with the lowest number. If files with alphabetic names exist, they are run after the numerically-named files.
Custom menu entries can be added to the 40_custom file or in a newly created file. Based on its name, 40_custom entries by default appear at the bottom of the menu. Only executable files generate output to grub.cfg during execution of update-grub.
By default the files in the /etc/grub.d folder are executable.
|Q3||What are the differences between GRUB and GRUB2?|
|A||GRUB2 incorporates a revised directory and file hierarchy. The menu.lst of GRUB legacy is no longer used. Automated searches for other operating systems, such as
MS Windows, are accomplished whenever update-grub is executed. Operating systems found will be placed in
the GRUB2 menu. Changes made in the configuration files will not take effect until the update-grub command is executed.
The GRUB2's default menu will look similar to GRUB; however, there are a number of differences:
|Q||How can man pages be formatted without the man or gruff utilities?|
|A||The man2html program translates groff text to HTML for viewing with a web browser. The man2html program and other similar programs can be downloaded from the web. There are a number of locations that one can download man2html, the developers site is
The unformatted manual pages typically are stored in the subdirectories of /usr/man, /usr/local/man; there can be other locations.
The nroff and less commands can be used to review text. These programs have MSDOS versions with an implementation of the man macro package available as well.
$ nroff -man /usr/man/man1/ls.1 | less
|Q||Is it possible to make a 1:1 copy of a data CD?|
|A||Yes a 1:1 copy can be made of a data CD. However, any errors that occur while reading the original will result in a defective copy.
Example 1: CD-writer and a separate CD-ROM drive.
Issue the command:
cdrecord -v dev=0,6,0 speed=2 -isosize /dev/scd0
The data stream is read from the CD-ROM drive attached as /dev/scd0 and written directly to the CD-writer.
Example 2: CD-writer only
First a read out has to be performed from the CD-ROM.
Issue the command:
dd if=/dev/scd0 of=cdimage
The command reads the content of the CD-ROM from the device /dev/scd0 and writes it into the file "cdimage". The contents of this file are equivalent to what mkisofs produces.
The newest versions cdrecord, includes a "readcd" tool in misc/. It will provide the same result as dd, but reads sectors on the CD-ROM multiple times in case of errors.
With an audio CD, cdrdao or cdda2wav will have to be used.
|Q||How can real time statistics for a Linux system be generated?|
The dstat man command provides realtime monitoring with the Linux operating system. A partial list of options includes: output system usage, memory usage, load times, network information for NFS, VMWare, CPU, sendmail, MySQL and other software usage.
The dstat command is a replacement which addresses the limitations associated with vmstat, iostat, and ifstat.
dstat provides the capability to:
|Q||How is logging turned off in bash?|
|A||In order have activity in the .bash_history file excluded from logging, appending a space character prior to the command.
The space bar is invoked prior to typing cat /etc/passwd .
|Q||How can a program be run at a specific time?|
The at command is used for executing a task at a specific time.
Perform the following steps:
A command prompt will appear where the command to be executed can be typed.
2. Type mplayer mymovie.avi .
3. Invoke Enter.
4. Then press Ctrl+D to exit the command line. The EOT character (Ctrl+D) in UNIX is different from the Control-Z in DOS. The DOS Control-Z byte is actually sent or placed in files to indicate where the text ends. In contrast, the
The job will run in the background and execute the command at the time requested.
5. In order to view a list of scheduled commands use:
6. In order to remove a task use:
where 1 is the job ID given by at -l.
|Q||Several applications perform extremely sluggishly when running simultaneously on the system. It is possible to ascertain whether an application is consuming excessive CPU resources?|
|A||Yes, this is done with the ps command.
ps -eo pcpu,pid,args | sort -k 1 -r | head -10
This will display a list of ten processes; the most cpu intensive application will be first on the list.
|Q||How can CPU usage of an application be controlled in Linux?|
|A||This is done by installing cpulimit; it can be used to restrict the CPU utilization of an application either by name or by process ID:
by application name
cpulimit -e firefox -l 30
This will limit Firefox from utilizing beyond a 30% CPU consumption.
by process number
cpulimit -p 3493 -l 40
This will limit process number 3493 to 40% CPU consumption.
cpulimit is a simple program which will limit the cpu usage of a process expressed in percentage, not in cpu time. This is useful to control batch jobs, in order to ensure that they do not consume excessive much cpu. It does not act on the nice value or other scheduling priorities, but on the real cpu usage. It also is able to itself to the overall system load, dynamically and quickly. It is available for downloaded from SourceForge.Net
|Q||How can directories be listed from the command line?|
|A||From a Terminal session use the ls –d * /.
It will list the directories of the current folder.
|Q||I am a new webmaster. What is a straightforward way to back up a website?|
|A||The rsync tool can be used to back up a directory on a computer and copy only the changed files to the backup computer. This is known as an incremental backup. An account will be required on the remote computer that the directories and files are being backed up from.
rsync -vare ssh firstname.lastname@example.org:/home/dave/mainsite/* /home/dave/backup/
All the files in /home/dave/ mainsite / on 192.168.0.2 are being copied to /home/dave/backup on the current machine.
|Q||How can battery power be conserved on a laptop computer running the Linux operating system?|
|A||In addition to optimizing input/output performance on a hard drive, the hdparm command can be used to extend the battery life on a laptop.
hdparm -y /dev/hdb
This command will cause the drive to switch to standby mode
hdparm -Y /dev/hdb
This command will switch to Sleep mode and set the Automatic spindown timeout.
hdparm -S 36 /dev/hdb
This command includes a numeric variable, representing units of blocks equal to seconds. A value of 36 x 5= 180 seconds = three minutes.
hdparm is a command line utility for the Linux and Windows operating systems to set and view ATA hard disk hardware parameters. It can set parameters such as drive caches, sleep mode, power management, acoustic management, and DMA settings. It can be downloaded from SourceForge.Net
|Q||We are evaluating whether to utilize an open source UNIX or Linux operating system for our WebLogic Server and Oracle database? Are there any limitations in the installation and boot partition?|
|A||In 2009, Oracle Corporation acquired Sun Microsystems hardware and open source software: Solaris
operating system, MySQL database, and Java programming language.
Our recommendation would be to use Solaris. Starting with the Solaris 10 release, it is now possible to install and boot the Solaris OS from a disk that is up to 2 terabytes in size. The VTOC label can be used on a disk of any size; however, the addressable space by the VTOC is limited to 2 terabytes. This feature enables disks that are larger than 2 terabytes to be used as boot drive. It removes the limitations of earlier releases of Solaris where it was not possible to install and boot the drive from a disk that was greater than 1 terabyte in size.
|Q||What is the difference between Ubuntu and Kubuntu, Shubuntu, and Edubuntu?|
|A||Ubuntu is an open source Linux operating system; it is available free of charge.
Ubuntu is maintained and
distributed by Canonical Ltd. Ubuntu uses the GNOME desktop environment. Kubuntu, Shubuntu, and Eduntu are subprojects of Ubuntu Linux.
|Q||What is new with ZFS and why is it considered an important component of UNIX-variant operating systems?|
|A||ZFS is a significant
enhancement to file system design and is already in use on Linux, Mac OS X,
and FreeBSD systems.
ZFS file systems are built on top of the concept of pools or "zpools". Instead of utilizing a volume manager on top of multiple drives, ZFS joins devices into storage pools - large data stores from which file systems can be built. This serves to greatly reduce the complexity and administrative overhead. ZFS file systems are not constrained by initial partitioning decisions. File systems can be added to as needed and new devices can be added at any time. This serves to facilitate the enlargement of the space available to all file systems. As a 128 bit file system, it can store 18 billion times more data than current 64-bit file systems. The maximum size of a single file has been increased by a factor of 16 times 2 as compared to the maximum size of a file in a 64 bit file system. ZFS addresses many of the issues associated with file system corruption and the problems associated with freeing free blocks crashes.
The zpool and zfs commands are used to work with ZFS.
Additional file systems can then be created within this file system.
|Q||What is the difference between the various ZIP formats: ZIP, GZIP, and PKZIP?|
|A||ZIP is an archive file format,
popularized on PCs, that contains multiple compressed files.
GZIP comes from a GNU project. It is a one file subset of the ZIP format. It is not possible to place a whole directory into a GZIP archive, just a single file. It's intended for compressing a tarball of many files.
PKZIP is a commercially available program that creates zip files.
All three use the deflate compression format, which is based on the LZ77 algorithm. This compression is also used by the ZLIB library and the PNG graphics file format PNG - (which uses ZLIB).
|Q||Our company uses multiple variants of UNIX and accordingly I will be required to write scripts that will work in different Shells. Will SYS-ED UNIX courses be able to accommodate my needs?|
|A||There are two main class of
There is also a rc which most people consider to be in a class by itself.
We demonstrate and teach how to write scripts that will work for the shells both from the Bourne shell category and the C shell category.
I work for a government municipality in a PC Windows environment. Will it be difficult to learn UNIX?
|A||Your previous experience with
non-UNIX operating systems will serve as a good foundation for learning
UNIX. Administering a UNIX system is not for novices. The UNIX operating
system is more "detail oriented" than Microsoft DOS/Windows. However there
is a commonality between DOS and UNIX commands.
|Q||I want to make sure that the version of UNIX used in class matches the version that I use at work.|
|A||The version can be ascertained by using the uname command. It is standard policy for SYS-ED to use the newest version of an operating system, and in the case of UNIX, the newest version of that variant. Upon request we will set up operating systems specific to what you utilize back on the job.|
|Q||I have an immediate need to learn how to set access privileges for my files. Which UNIX course should I taken in order to master the UNIX file system and become a network administrator?|
|A||The UNIX file access attributes
are different from their DOS counterparts. In UNIX, the read, write, and
execute privileges can be set according to who the user is.
The privileges are set using the chmod command:
Our recommendation would be to take the UNIX: Fundamentals - Level 1 course.
|Q||What is Linux?|
|A||Linux is a variant of the UNIX operating system. Every Linux system is based on the Linux kernel. The kernel manages computer hardware, performs multi-tasking and other essential things. These low-level functions are used by other programs. More commonly, "Linux" refers to the Linux Operating System.|
|Q||I will be coding and maintaining AIX on a z/OS system. Does SYS-ED offer AIX courses?|
|A||Yes, we offer AIX courses, but only on a private basis.|
|Q||We are interested in learning Solaris. Our company is using Solaris 2.x, 9, and Solaris 10. Which version would be best for me to learn?|
|A||There are differences between
the different versions of the Solaris Operating System. However, there would
be minimal impact on a Solaris fundamentals course.
The core content of a Solaris Fundamentals course would remain:
However, it is universally accepted that, all things being equal, the newest version of an operating system is the best one to learn.
|Q||In the early 1980’s I worked for an organization which used UNIX as its primary operating system. In my current position (with a different organization), I am now involved in evaluating Solaris as one of our mainstay operating systems. Does SYS-ED train on Solaris and how do you address the differences among the versions?|
|A||You are not alone, for many IT
professionals, the future is indeed to a large degree going back to the
past! Yes, we do train on Solaris and all our courses address and
demonstrate the changes in commands and the discontinued and new features.
Here is a concise summary:
Changes in Commands
The following commands have changed:
Removal of Features
A number of features have been removed including Netscape, admintool, /var/adm/passwd, PC fileviewer and others.
Enhancements to New Features
Several changes were made to sendmail and NFS; mostly for administrators.
The new features of Solaris will be listed/discussed and available for demonstration on the instructor’s machine.