楼主: malimail

RH9 读书笔记

[复制链接]
论坛徽章:
0
11#
 楼主| 发表于 2003-8-14 02:02 | 只看该作者

续7

 Other document for print
man printcap - The manual page for the /etc/printcap printer configuration file.
map lpr - The manual page for the lpr command that allows you to print files from the command line.
man lpd - The manual page for the LPRng printer daemon.
man lprm - The manual page for the command line utility to remove print jobs from the LPRng spool queue.
man mpage - The manual page for the command line utility to print multiple pages on one sheet of paper.
man cupsd - The manual page for the CUPS printer daemon.
man cupsd.conf - The manual page for the CUPS printer daemon configuration file.
man classes.conf - The manual page for the class configuration file for CUPS.

 Open openoffice.org wirter
oowriter
Open openoffice.org calc
oocalc
Open openoffice.org impress
ooimpress
Open openoffice.org draw
oodraw

 Edit text file
kedit, gedit, vi (:q, :wq, :q!, I, esc)

 Open PDF file
xpdf

 Play audio
xmms,

 Manual Sound Card Con_guration
edit your /etc/modules.conf
alias sound sb
alias midi opl3
options opl3 io=0x388
options sb io=0x220 irq=7 dma=0,1 mpu_io=0x300

 The X Configuration Tool backs up your system's original video configuration file to
/etc/X11/XF86Config.backup in case you need it to switch back to a previous configuration.
Or redhat-config-xfree86

 Finding Games Online
http://www.linuxgaming.net - A website that covers Linux-compatible games in depth.
http://www.tuxgames.com - A store where you can buy games just for Linux.
http://www.linuxgames.com/ - a Linux gaming news site.
http://happypenguin.org/ - the Linux gaming repository.

使用道具 举报

回复
论坛徽章:
0
12#
 楼主| 发表于 2003-8-14 02:03 | 只看该作者

续8

 View image
gthumb (not included in RH9)
Edit image
gimp

 Digit camera
gtkam

 Shell fundamental
pwd - list current directory
cd path - change directory
cd - back to home directory
cd.. - move up one directory
cd../.. - move up two directory
cd ~otheruser - takes you to otheruser's login directory, if otheruser has granted you permission
su - change to root in your own login shell, exit to go back
su - - change to root in root login shell, exit to go back
ls - display content in current directory
ls -a - show all content begin with dot (dot files is acting like hiden file)
ls -al - show detail messages
other option for ls
-a - all. Lists all the files in the directory, including the hidden files (.filename). The .. and . at the top of your list refer to the parent directory and the current directory, respectively.
-l - long. Lists details about contents, including permissions (modes), owner, group, size, creation date, whether the file is a link to somewhere else on the system and where its link points.
-F - file type. Adds a symbol to the end of each listing. These symbols include / to indicate a directory; @ to indicate a symbolic link to another file; and * to indicate an executable file.
-r - reverse. Lists the contents of the directory from back to front.
-R - recursive. This option lists the contents of all directories below the current directory recursively.
-S - size. Sorts files by their sizes.
locate string - find file name include string in the hole system (include in slocate database which controled by cron daemon, using anacron on the machine which is not for continuing using 24 hours a day)
updatedb - Manually update slocate database
lpr filename - print file to printer
lpq - view the print job waiting in print queue
lprm job number - cancel print job
clear - clear terminal window
reset - reset the terminal window with the default value( useful when terminal window the text you are typing does not match the output on the monitor)
cat filename - display content of file
redirection, > - output, < - input, >> adding information to the file
head filename - read first few lines of the file
head -20 filename - read first 20 lines of the file
tail filename - read last 10 lines of the file
tail -f filename - read the new messages after last updated
grep string filename - get the lines with the string in file (-i for case-insensitive)
chmod (u g o a)(+ - =) (r w x) - change file permission
chmod xxx filename - r=4, w=2,x=1,-=0, so owner with r,w group with rw, other users with r should be chmod 664 filename

file filename - check the file type( for example: ascII text file)
file-rollar - an achieve and compress file tool
gzip(.gz), bzip2(.bz2), zip(.zip) - compress tool
gunzip, bunzip2, unzip - uncompress tool
tar -cvf filename.tar directory/file - archive file (-c - create a new archive. -f - when used with the -c option, use the filename specified for the creation of the tar file; when used with the -x option, unarchive the specified file. -t - show the list of files in the tar file. -v - show the progress of the files being archived. -x - extract files from an archive. -z - compress the tar file with gzip. -j - compress the tar file with bzip2.
touch filename - crate new file with the name of filename
cp source destination - copy files (source - filename, destination - destination directory, -i - interactive. Prompts you to confirm if the file is going to overwrite a file in your destination. This is a handy option because it can help prevent you from making mistakes. -r - recursive. Rather than just copying all the specified files and directories, this will copy the whole directory tree, subdirectories and all. -v - verbose. Shows the progress of the files as they are being copied. )
mv source destination - move files(source - filename, destination - destination directory, -i - interactive. This will prompt you if the file you have selected will overwrite an existing file in the destination directory. This is a good option, because like the -i option for cp, you will be given the chance to make sure you want to replace an existing file. -f - force. Overrides the interactive mode and moves without prompting. Unless you know what you are doing, this option is dangerous; be very careful about using it until you become more comfortable with your system. -v - verbose. Shows the progress of the files as they are being moved.
mkdir directoryname - make directory
rm directoryname - delete file or directory (-i - interactive. Prompts you to confirm the deletion. This option can stop you from deleting a file by mistake. -f - force. Overrides interactive mode and removes the file(s) without prompting. This might not be a good idea, unless you know exactly what you are doing. -v - verbose. Shows the progress of the files as they are being removed. -r - recursive. Will delete a directory and all files and subdirectories it contains.)
rmdir, rm -r direcotoryname - remove directory

 vi .bash_profile - edit path
source .bash_profile - effect the profile immediately

 mount fat of fat32 partition
mkdir /mnt/windows
mount -t vfat /dev/hda1 /mnt/windows
to automatically mount the fat or fat32 partition, edit /etc/fstab file, To navigate through directories or files with spaces, surround the name of the directory or file with quotation marks, as in ls "Program Files".

 to glimpse the history of your commands by typing history xx at the shell prompt( xx is the number of last typed xx command), or  less .bash_history at the shell prompt

 other short cut of command:
"Bang, bang": Typing !! (called "bang bang" executes the last command in the history.
"Bang number": Typing !number (as in !302) will execute the command which is numbered 302 in the history file.
"Bang string": Typing !string (as in !rpm) will execute a command with the most recent matching string from the history file.
[Up arrow] and [down arrow]: At the shell or GUI terminal prompt, you can press the up arrow to move back through previous commands in your history list (the down arrow will move you forward through the commands) until you find the command you want. Press [Enter] to execute the command, just as if you had typed it on the command line

使用道具 举报

回复
论坛徽章:
0
13#
 楼主| 发表于 2003-8-14 02:04 | 只看该作者

续9

 forgot password
1. At the boot loader menu, type [e] to enter into editing mode.
2. You will be presented with a boot entry listing. Look for the line that looks similar to the following:
kernel /vmlinuz-2.4.18-0.4 ro root=/dev/hda2
Press the arrow key until this line is highlighted and press [e].
3. Press the Spacebar once to add a blank space, then add the word single to tell GRUB to boot into single-user Linux mode. Press [Enter] to make the editing change take effect.
4. You will be brought back to the edit mode screen. From here, press and GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt
similar to the following:
sh-2.05#
5. You can now change the root password by typing
bash# passwd root
You will be asked to re-type the password for verification. Once you are finished, the password will be changed. You can then reboot by typing reboot at the prompt; then you can log in to root as you normally would.

 Changing Login from Console to X at Startup
Edit /etc/inittab file
Change id:3:initdefault: from a 3 to a 5.

 Compare dos and linux command
Command's Purpose                        MS-DOS         Linux         Basic Linux Example
Copies files                                         copy                 cp                 cp thisfile.txt /home/thisdirectory
Moves files                                         move                 mv                 mv thisfile.txt /home/thisdirectory
Lists files                                         dir                         ls                 ls
Clears screen                                         cls                         clear         clear
Closes shell prompt                        exit                         exit                 exit
Displays or sets date                        date                 date         date
Deletes files                                         del                         rm                 rm thisfile.txt
"Echoes" output to the screen        echo                 echo         echo this message
Edits files with simple editor         edit                         gedit(a)         gedit thisfile.txt
Compares the contents of files         fc                         diff                 diff file1 file2
Finds a string of text in a file        find                 grep         grep this word or phrase thisfile.txt
Formats a diskette                                 format a:         mke2fs or mformat(b)
/sbin/mke2fs /dev/fd0 (/dev/fd0 is the Linux equivalent of A
Displays command help                command /?        man(c)         man command
Creates a directory                         mkdir                 mkdir         mkdir directory
Views a file                                         more                 less(d)         less thisfile.txt
Renames a file                                 ren                         mv(e)         mv thisfile.txt thatfile.txt
Displays your location in the file system
chdir                 pwd         pwd
Changes directories with a specified path (absolute path)
cd pathname cd pathname
cd /directory/directory
Changes directories with a relative path
cd ..                 cd ..         cd ..
Displays the time                                 time                 date                date
Shows amount of RAM in use        mem                 free         free

使用道具 举报

回复
论坛徽章:
0
14#
 楼主| 发表于 2003-8-14 02:05 | 只看该作者

续10

 Other key short cut
[Ctrl] + [Alt] + [Backspace] = kills your current X session. Kills your graphical desktop session and returns you to the login screen. Use this if the normal exit procedure does not work.
[Ctrl] + [Alt] + [Delete] = shutdown and reboots your Red Hat Linux system. Shuts down your current session and reboots the OS. Use only when the normal shutdown procedure does not work.
[Ctrl] + [Alt] + [Fn] = switches screens. [Ctrl]+[Alt] + one of the function keys displays an available screen. By default, [F1] through [F6] are shell prompt screens and [F7] is the graphical desktop screen.
[Alt] + [Tab] = switches tasks in a graphical desktop environment. If you have more than one application open at a time, you can use [Alt] + [Tab] to switch among open tasks and applications.
[Ctrl] + [a] = moves cursor to the beginning of a line. This works in most text editors and in the URL field in Mozilla.
[Ctrl] + [d] = logout of (and close) shell prompt. Use this quick shortcut instead of typing exit or logout.
[Ctrl] + [e] = moves cursor to end of a line. This works in most text editors and in the URL field in Mozilla.
[Ctrl] + [l] = clears the terminal. This shortcut does the same thing as typing clear at a command line.
[Ctrl] + = clears the current line. If you are working in a terminal, use this shortcut to clear the current line from the cursor all the way to the beginning of the line.
[Middle Mouse Button] = pastes highlighted text. Use the left mouse button to highlight the text. Point the cursor to the spot where you want it pasted. Click the middle mouse button to paste it. In a two mouse system, if you configured your mouse to emulate a third mouse button, you can click
both the left and right mouse buttons simultaneously to perform a paste.
[Tab] = command autocomplete. Use this command when using a shell prompt. Type the first few characters of a command or filename and then press the [Tab] key. It will automatically complete the command or show all commands that match the characters you typed.
[Up] and [Down] Arrow = shows command history. When using a shell prompt, press the [up] or [down] arrow to scroll through a history of commands you have typed from the current directory. When you see the command you want to use, press [Enter].
clear = clears the shell prompt screen. Type this command to clear all visible data from the shell prompt screen.
exit = logout. Type this at a shell prompt to logout of the current user or root account.
history = shows history of commands. Type this at a shell prompt to see a numbered list of the previous 1000 commands you typed. To display a shorter list of previously used commands, type history followed by a space and a number. For example, history 20.
reset = refreshes the shell prompt screen. Type this at a shell prompt to refresh the screen if characters are unclear or appear corrupt.


Customize guide
 Create ext3 partition
1. Create the partition using parted or fdisk.
2. Format the partition with the ext3 file system using mkfs.
3. Label the partition using e2label.
4. Create the mount point.
5. Add the partition to /etc/fstab.

 Convert from ext2 to ext3 file system
/sbin/tune2fs -j /dev/hdbX
change the partition type from ext2 to ext3 in /etc/fstab.
when transition root partition, use mkinitrd to make a ram image to boot

使用道具 举报

回复
论坛徽章:
17
管理团队2006纪念徽章
日期:2006-04-16 22:44:45马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:36
15#
发表于 2003-8-14 23:06 | 只看该作者
能不能排一下版作成一个pdf,上传上来呢?

使用道具 举报

回复
论坛徽章:
0
16#
 楼主| 发表于 2003-8-14 23:35 | 只看该作者

Re:

我也是边看边整理的,还没有看完,我试着隔几天就贴一些

使用道具 举报

回复
论坛徽章:
0
17#
 楼主| 发表于 2003-8-18 23:33 | 只看该作者

续11

 Revert back to ext2 file system
Unmount the partition by umount /dev/hdbx
Next, change the file system type to ext2 by typing the following command as root:
/sbin/tune2fs -O ^has_journal /dev/hdb1
Then check the partition for errors by typing the following command as root:
/sbin/e2fsck -y /dev/hdb1
Then mount the partition again as ext2 file system by typing:
mount -t ext2 /dev/hdb1 /mount/point
Next, remove the .journal file at the root level of the partition by changing to the directory where it is mounted and typing: rm -f .journal
If you permanently change the partition to ext2, remember to update the /etc/fstab file.

 Add a swap partition
1. The hard drive can not be in use (partitions can not be mounted, and swap space can not be enabled). The easiest way to achieve this is to boot your system in rescue mode. When prompted to mount the file system, select Skip. Alternately, if the drive does not contain any partitions in use, you can unmount them and turn off all the swap space on the hard drive with the swapoff command.
2. Create the swap partition using parted or fdisk. Using parted is easier than fdisk; thus, only parted will be explained. To create a swap partition with parted:
At a shell prompt as root, type the command parted /dev/hdb, where /dev/hdb is the device name for the hard drive with free space.
At the (parted) prompt, type print to view the existing partitions and the amount of free space. The start and end values are in megabytes. Determine how much free space is on the hard drive and how much you want to allocate for a new swap partition.
At the (parted) prompt, type mkpartfs part-type linux-swap start end, where part-type is one of primary, extended, or logical, start is the starting point of the partition, and end is the end point of the partition.
Exit parted by typing quit.
3. Now that you have the swap partition, use the command mkswap to setup the swap partition. At a shell prompt as root, type the following:
mkswap /dev/hdb2
4. To enable the swap partition immediately, type the following command:
swapon /dev/hdb2
5. To enable it at boot time, edit /etc/fstab to include:
/dev/hdb2 swap swap defaults 0 0
The next time the system boots, it will enable the new swap partition.
6. After adding the new swap partition and enabling it, make sure it is enabled by viewing the output of the command cat /proc/swaps or free.

 Add a swap file
1. Determine the size of the new swap file and multiple by 1024 to determine the block size. For example, the block size of a 64 MB swap file is 65536.
2. At a shell prompt as root, type the following command with count being equal to the desired block size:
dd if=/dev/zero of=/swapfile bs=1024 count=65536
3. Setup the swap file with the command:
mkswap /swapfile
4. To enable the swap file immediately but not automatically at boot time:
swapon /swapfile
5. To enable it at boot time, edit /etc/fstab to include:
/swapfile swap swap defaults 0 0
The next time the system boots, it will enable the new swap file.
6. After adding the new swap file and enabling it, make sure it is enabled by viewing the output of the command cat /proc/swaps or free.

使用道具 举报

回复
论坛徽章:
0
18#
 楼主| 发表于 2003-8-18 23:37 | 只看该作者

续12

 To remove a swap partition:
1. The hard drive can not be in use (partitions can not be mounted, and swap space can not be enabled). The easiest way to achieve this it to boot your system in rescue mode. When prompted to mount the file system, select Skip.
Alternately, if the drive does not contain any partitions in use, you can unmount them and turn off all the swap space on the hard drive with the swapoff command.
2. At a shell prompt as root, execute the following command to make sure the swap partition is disabled (where /dev/hdb2 is the swap partition):
swapoff /dev/hdb2
3. Remove its entry from /etc/fstab.
4. Remove the partition using parted or fdisk. Only parted will be discussed. To remove the partition with parted:
 At a shell prompt as root, type the command parted /dev/hdb, where /dev/hdb is the device name for the hard drive with the swap space to be removed.
 At the (parted) prompt, type print to view the existing partitions and determine the minor number of the swap partition you wish to delete.
 At the (parted) prompt, type rm MINOR, where MINOR is the minor number of the partition you want to remove.
 Type quit to exit parted.

 To remove swap file
1. At a shell prompt as root, execute the following command to disable the swap file (where /swapfile is the swap file):
swapoff /swapfile
2. Remove its entry from /etc/fstab.
3. Remove the actual file:
rm /swapfile

 To move swap space
To move swap space from one location to another, follow the steps for removing swap space, and then follow the steps for adding swap space.

 How to use parted
Command                                                 Description
check minor-num                                         Perform a simple check of the file system
cp from to                 Copy file system from one partition to another; from and to are the minor numbers of the partitions
help                                                                 Display list of available commands
mklabel label                                                 Create a disk label for the partition table
mkfs minor-num file-system-type         Create a file system of type file-system-type
mkpart part-type fs-type start-mb end-mb
Make a partition without creating a new file system
mkpartfs part-type fs-type start-mb end-mb
Make a partition and create the specified file system
move minor-num start-mb end-mb         Move the partition
print (or cat /proc/partitions        )                Display the partition table
quit                                                                 Quit parted
resize minor-num start-mb end-mb         Resize the partition from start-mb to end-mb
rm minor-num                                         Remove the partition
select device                                                 Select a different device to configure
set minor-num flag state                         Set the flag on a partition; state is either on or off

使用道具 举报

回复
论坛徽章:
0
19#
 楼主| 发表于 2003-8-18 23:38 | 只看该作者

续13

 Format partition
/sbin/mkfs -t ext3 /dev/hdb3

 How to add a partition:
0.        boot in rescue mode
1. make partition
2. format partition
3. label partition
4. crate mount point
5. add to /etc/fstab (next time boot available or use mount /work can use it right now)

 how to label a partition
e2label /dev/hdb3 /work

 how to make mount point
mkdir /work

 how to edit /etc/fstab to add a record
LABEL=/work         /work         ext3         defaults                 1         2

 To mount the partition without rebooting, as root, type the command:
mount /work

 To remove a partition:
1. boot in rescue mode or unmount any partitions on the device and turn off any swap space on the device
2. parted ( parted /dev/had)
3. use print to view the current partition table and decide which partition to remove
4. remove partition use rm: rm minor_number
5. use print or cat /proc/partitions to confirm the change
6. remove the record from /etc/fstab

 to resize the partition
1. boot in rescue mode or unmount any partitions on the device and turn off any swap space on the device
2. parted ( parted /dev/had)
3. use print to view the current partition table and decide which partition to resize
4. To resize the partition, use the resize command followed by the minor number for the partition, the starting place in megabytes, and the end place in megabytes. For example:
resize 3 1024 2048
5. Use print to confirm the change
6. After rebooting the system into normal mode, use the command df to make sure the partition was mounted and is recognized with the new size.

使用道具 举报

回复
论坛徽章:
0
20#
 楼主| 发表于 2003-8-18 23:39 | 只看该作者

续14

 Disk quota
1. Enable quotas per file system by modifying /etc/fstab
As root, using the text editor of your choice, add the usrquota and/or grpquota options to the file systems that require quotas:
LABEL=/home                 /home         ext3         defaults,usrquota,grpquota         1         2
2. Remount the file system(s)
use the umount command followed by the mount to remount the file system. If the file system is currently in use, the easiest method for remounting the file system is to reboot the system.
3. Create the quota files and generate the disk usage table
quotacheck -acug /home (actually it should be quotacheck -acug, if add the filesystem, it won't work) The -a option means that all mounted non-NFS file systems in /etc/mtab are checked to see if quotas are enabled. The -c option specifies that the quota files should be created for each file system with quotas enabled, the -u specifies to check for user quotas, and the -g option specifies to check for group quotas.
If neither the -u or -g options are specified, only the user quota file is created. If only -g is specified, only the group quota file is created.
After the files are created, run the following command to generate the table of current disk usage per file system with quotas enabled:
quotacheck -avug
The options used are as follows:
a - Check all quota-enabled, locally-mounted file systems
v - Display verbose status information as the quota check proceeds
u - Check user disk quota information
g - Check group disk quota information
4. Assign quotas
To configure the quota for a user, as root in a shell prompt, execute the command:
edquota username
showing below:
Disk quotas for user testuser (uid 501):
Filesystem                 blocks                 soft                 hard        inodes         soft                 hard
/dev/hda3                 440436                 500000         550000         37418         0                 0
The first column is the name of the file system that has a quota enabled for it. The second column shows how many blocks the user is currently using. The next two columns are used to set soft and hard block limits for the user on the file system. The inodes column shows how many inodes the user is currently using. The last two columns are used to set the soft and hard inode limits for the user on the file system. A hard limit is the absolute maximum amount of disk space that a user or group can use. Once this limit is reached, no further disk space can be used. The soft limit defines the maximum amount of disk space that can be used. However, unlike the hard limit, the soft limit can be exceeded for a certain amount of time. That time is known as the grace period. The grace period can be expressed in seconds, minutes, hours, days, weeks, or months.
To verify that the quota for the user has been set, use the command:
quota testuser
To configure the quota for a group, edquota -g groupname, to verify, quota -g groupname
Change the block grace period or inode grace period: edquota -t

 Report on disk quota
repquota /mount_point or repquota -a to show all quota enabled file systems

 Keep quotas accurate run quotacheck periodically and after file system is not unmounted cleanly
quotacheck -avug
to periodically run the command, either use crontab -e command to schedule a periodic quotacheck of place a script that runs quotacheck in any one of the following directorys
/etc/cron.hourly; /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表