text:
Vietnamese/Tense

Unlike Western languages, Vietnamese doesn't change the ending of the verb (that is, verbs don't conjugate) to express when the statement occurs (the statement's tense). Instead, Vietnamese relies on context to express tense. So, where textbooks for other languages will need to spend chapters and chapters, or pages and pages, to teach you how to change tense, we'll teach you in one page! See what we mean by simple?

Tense words
One way to do this is to add certain words either before the verb itself, or at the end of the sentence, or both:

Present tense
As in most languages, you don't have to do anything special for the present tense – no words expressing tense need to be added. Example:

Tôi học I study

Present progressive tense
Place đang in front of the verb. Example:

Tôi đang học I am studying

Past tense
Either place đã in front of the verb, or place rồi at the end of the sentence. You can use both, and it often sounds better when you do use both, but it's not necessary, because both words mean "already." Example:

Anh đã</rb> <rb>học</rb> He  already studied</rt>

can also be written as:

<rb>Anh học</rb> <rb style="font-weight: bold">rồi</rb> He   studied already</rt>

Whereas many other languages have two past tenses – the preterite and imperfect past – Vietnamese has only one.

Future tense
Place sẽ (will, shall, is about to, plans to) in front of the verb. Example:

<rb>Anh</rb> <rb style="font-weight: bold">sẽ</rb> <rb>học</rb> He will study</rt>

Time words
There is another, more natural way of expressing tense. Just use words that express time in the sentence:

Present tense
Again, you don't have to do anything special here. But sometimes it's helpful to add hôm nay (today) at the beginning or end of the sentence, just to clear things up.

Present progressive tense
Place words like bây giờ (now) or phrases like ngay bây giờ (right now) at the beginning or end of the sentence.

Past tense
Place words like hôm qua (yesterday) at the beginning or end of the sentence, or words like mới (recently) right before the verb. You can do both, actually.

Future tense
Place words like ngày mai (tomorrow) at the beginning or end of the sentence.

Context
Although other methods of expressing tense also rely on context in the sentence, another way to express tense has to do with common sense. For example, in the sentence,. ..

(More to come.)

title: Vietnamese/Tense


text:
User:Maio~enwikibooks

w:User:Maio

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: User:Maio~enwikibooks


text:
Physics Study Guide/Fluids

Buoyancy
Buoyancy is the force due to pressure differences on the top and bottom of an object under a fluid (gas or liquid).

Net force = buoyant force - force due to gravity on the object

Bernoulli's Principle
Fluid flow is a complex phenomenon. An ideal fluid may be described as:

 * The fluid flow is steady i.e its velocity at each point is constant with time.
 * The fluid is incompressible. This condition applies well to liquids and in certain circumstances to gases.
 * The fluid flow is non-viscous. Internal friction is neglected. An object moving through this fluid does not experience a retarding force. We relax this condition in the discussion of Stokes' Law.
 * The fluid flow is irrotational. There is no angular momentum of the fluid about any point. A very small wheel placed at an arbitrary point in the fluid does not rotate about its center. Note that if turbulence is present, the wheel would most likely rotate and its flow is then not irrotational.

As the fluid moves through a pipe of varying cross-section and elevation, the pressure will change along the pipe. The Swiss physicist Daniel Bernoulli (1700-1782) first derived an expression relating the pressure to fluid speed and height. This result is a consequence of conservation of energy and applies to ideal fluids as described above.

Consider an ideal fluid flowing in a pipe of varying cross-section. A fluid in a section of length $$\Delta x_1$$ moves to the section of length $$\Delta x_2$$ in time $$\Delta t$$. The relation given by Bernoulli is:

where:
 * $$P$$ is pressure at cross-section
 * $$h$$ is height of cross-section
 * $$\rho$$ is density
 * $$v$$ is velocity of fluid at cross-section

In words, the Bernoulli relation may be stated as:

As we move along a streamline the sum of the pressure ($$P$$), the kinetic energy per unit volume and the potential energy per unit volume remains a constant.

(To be concluded)

title: Physics Study Guide/Fluids


text:
LPI Linux Certification/LPIC1 Exam 101/Linux Installation & Package Management

Section Overview

 * Design hard disk layout
 * Install a boot manager
 * Make and install programs from source
 * Manage shared libraries
 * Use Debian package management
 * Use Red Hat Package Manager (RPM)

Installation de Linux and Gestion des packages (LPIC101)


text:
LPI Linux Certification/LPIC1 Exam 101/GNU & Unix Commands

Section Overview

 * 1.103.1 Work on the command line
 * 1.103.2 Process text streams using filters
 * 1.103.3 Perform basic file management
 * 1.103.4 Use streams, pipes, and redirects
 * 1.103.5 Create, monitor, and kill processes
 * 1.103.6 Modify process execution priorities
 * 1.103.7 Search text files using regular expressions
 * 1.103.8 Perform basic file editing operations using VI

 * Unix and Linux

Overview
Unix is the original Internet Operating System (NFS, TCP/IP, RPC, ...). Linux is a Unix clone written from scratch by Linus Torvalds with assistance from a world wide team of developers across the Net. Properties of both systems are: Linux aims toward POSIX compliance and supports also other standard API's such as BSD and SVR4. Linux has all the features you would expect in a modern Unix, including true multitasking/multiple-users, virtual memory, shared libraries, demand loading, shared copy-on-write executables, proper memory management and TCP/IP networking.
 * Portable, multi-user, multiprocessing
 * Device-independent input/output
 * Shared resources, high performance and highly secure
 * Line commands
 * GUI

More and more companies and organizations are selecting Linux because of its performance, low cost, and royalty free license.

Unix and Linux
Unix is the original Internet Operating System written in 1970 developed at A&T Bell Labs. Distributed freely to government and universities. Different entities did support different distributions. Most varieties of Unix carry copyright licenses.
 * System V
 * BSD
 * SCO

Linux was released in 1991 by Linus Torvalds. The model of Linux licence is copy left from GPL. Linux implement most of the System V and BSD Unix commands. Use the man pages to determine the version.

Logging In and Out
The logging In session is the first step to access a Linux system. You need a login ID and a password to be able to start using the system. The login ID root is the super user ID that has all privileges, normally assigned to the System Administrator. When a log in session is successful it will set some environment variables and start the shell that has been assigned to the login ID account.

Examples of variables set at log in time: $HOME, $SHELL, $PATH, and more. By changing the file /etc/login.defs the administrator can customize some login parameters and variables for all the users.

Examples of some of them: UID_MIN 500 UID_MAX 60000 UMASK 022 ENV_PATH /usr/local/bin:/usr/bin:/bin To logout use the exit or logout command.

Password
Nobody can see your password, not even the administrator. To change passwords for users or groups, use passwd.

passwd [options]

Common options:
 * -l, -u : Lock and unlock an account.
 * -g [| r]: Used for group.
 * -g set a password for group and -r removes it.
 * -x|n : Maximum and minimum number of days a password remain valid.

As a general rule a password must:
 * Have a minimum length
 * Not contain any English language words
 * Contain non-alphanumeric characters
 * Contain a mixture of uppercase and lower case letters.

User information
For every user account, there is a line defined in the file /etc/passwd. The encrypted password is stored in /etc/shadow. The format of /etc/passwd is:

root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/bin/bash daemon:x:2:2:Daemon:/sbin:/bin/bash yann:x:500:100:Yann Forget:/home/yann:/bin/bash

The x field is the old location for the password.

The format of /etc/shadow is:

root:IMXweyiV816gg:11996:0:10000:::: bin:!*:8902:0:10000:::: daemon:*:8902:0:10000:::: yann:GoIM8j1S.IuTY:11996:0:99999:7:::

The * for the encrypted password means there is no password defined yet. The ! Before the encrypted password means the account is locked.

Group information
For every group of users there is a line in file /etc/group. The encrypted password is stored in /etc/gshadow. The format of /etc/group is:

root:x:0:root bin:x:1:root,bin,daemon daemon:x:2: video:x:33:yann

The format of /etc/gshadow is:

root:*:root:root bin:*:root:root daemon:*:root:root video:*:root:root,yann

Passwords for group are not often implemented since you have to pass to members of a group the password.

Misc. Commands
To get information on a logging In session, use id.

id [options] [username]

Common options: -g : Print only the group ID. -u : Print only the user ID.

Example:

$ id uid=0(root) gid=0(root) groups=0(root), 1(bin), 14(uucp), 15(shadow),16(dialout)

To run a shell with another user ID and group ID, use su.

su [options] [username]

Common options: -s : Select another shell.

Example:

$ su toto passwd:

Shell
A Shell is a command line interpreter and:
 * Prompts for commands.
 * Interprets command which can include:
 * I/O redirection, pipes, filename generation, etc.
 * Executes commands.
 * Executes scripting language.

There are several popular shells:
 * sh: Bourne shell, the standard scripting shell.
 * csh: Berkeley shell, job control, command history, alias.
 * ksh: Korn shell, Bourne syntax with Berkeley features.
 * bash: Bourne Again shell, free, Korn-like shell.
 * t csh: Free, Berkeley clone with many extensions.

Most shells let you customize your prompt and environment. For bash the prompt variable is PS1. For bash the file that can be used for the customization of the environment are:
 * .bashrc Executed for each new bash session
 * .bash_profile Executed at logging In time
 * .bash_logout Executed at logging Out time

Exercises

 * Exercises results

Overview
Description: ''Candidates should should be able to apply filters to text streams. Tasks include sending text files and output streams through text utility filters to modify the output, and using standard UNIX commands found in the GNU textutils package.''

Key files terms and utilities include: <tt>cat cut expand fmt head join nl od paste pr sed sort split tac tail tr unexpand uniq wc</tt>

Pattern matching and wildcards
Wildcard is a pattern matching mechanism for filenames. The purpose of wildcard is to increase productivity: Locate files that you don't fully remember. Locate files that have something in common. Work with a group of files rather than individual.

The shell interprets these special characters: ! @ # $ % ^ & * { } [ ] | \ ; ~ ' " ` ?

The characters used for wildcard are: ? *  [  ]  ~

If you use the wildcard characters the shell will try to generate a file from them. Try the following: echo all files *

Special wildcard characters ? match any one character. * Any string [abcfghz] One char set [a-z] One char in range [!x-z] Not in set ~ Home directory ~user User home directory

Examples: ? One character filenames only [aA]??? Four characters, starting with a or A. ~toto pathname of toto home directory [!0-9]* All string not starting with a number.

What about these commands? ls [a-z][A-Z]??.[uk] ls big* ls a???a ls ??*

Shell and wildcards
A shell command line can be a simple command or more complex. ls -l [fF]* ls *.c | more ls -l [a-s]* | mail `users`

The first event in the shell is to interpret wildcards. Only the shell interprets unquoted wildcards.

Quoting
Do quote to prevent the shell to interpret the special characters and to transform multiple words into one shell word.

echo 'He did it, "Why?"' echo 'Because "#@&^:-)"' echo '$VAR='Me
 * 'string' Nearly everything within the quote is literal:

echo "What's happening?" echo "I don't know but check this $ANSWER"
 * "string" Like 'string' but interprets $, \, !:

echo \$VAR=Me echo What\'s happening\?
 * The backslash \ treats the following character as literal:

echo \\
 * How could we display the backslash? With the following line:

Comments
You can add comments in a command line or a script. Use the character #. A white space must immediately precede #.

Examples: echo $HOME # Print my Home directory echo "### PASSED ###" # Only this part is a comment echo The key h#, not g was pressed.

Commands

 * cat, tac: Concatenate files and print on the standard output.
 * head, tail: Output the first and last part of files.
 * nl: Number lines of files.
 * wc: Print the number of bytes, words, and lines in files.
 * cut: Remove sections from each line of files.
 * tr: Translate or delete character.
 * expand, unexpand: Convert tabs to spaces and space to tabs.
 * paste: Merge lines of files.
 * join: Join lines of two files on a common field.
 * uniq: Remove duplicate lines from a sorted file.
 * split: Split a file into pieces.
 * fmt: Simple optimal text formatter.
 * pr: Convert text files for printing.
 * sort: Sort lines of text files.
 * od: Dump files in octal and other formats.

Concatenate files
To concatenate files, use cat. cat [options] [files...] tac [options] [files...]

The results are displayed to the standard output.

Common options: -s: never more than one single blank line. -n: number all output line.

Examples:

cat file # Display file to the stdout. cat chapter* # Display all chapters to stdout. cat -n -s file # Display file with line number with single blank line.

To concatenate files in reverse order, use tac.

View the beginning and the end of a file
To view only few lines at the beginning or at the end of a file, use head or tail. head [options] [files...] tail [options] [files...]

The results are displayed to the standard output.

Common options: -n: number of lines to be displayed. (head and tail) -c: number of bytes to be displayed. (head and tail) -f: append output. (tail) -s #: iteration for new data every # sec. (tail)

Examples:

head file # Display the first 10 lines of file. head -n 2 file # Display the first 2 lines of file. tail -c 10 file # Display the last 10 bytes of file. tail -f -s 1 /var/log/messages Display the last 10 lines of messages, block and check for new data every second.

Numbering file lines
To add the line number to a file, use nl. nl [options] [files...]

The results are displayed to the standard output.

Common options: -i #: increment line number by #. -b: numbering style: a: number all lines t: non empty line n: number no line -n: numbering format: rz: right justified ln: left justified.

Examples: nl file # Add the line number in each line in the file. nl -b t -n rz file # Add the line number to each non-empty line with zero-completed format.

Counting items in a file
To print the number of lines, words and characters of a file, use wc. wc [options] [files...]

The results are displayed to the standard output.

Common options: -c: the byte size. -m: the number of character. -w: the number of word. -l: the number of line. -L: length of the longest line.

Examples: wc *.[ch] # Display the number of lines, words, and characters for all files .c or .h. wc -L file # Display the size of the longest line. wc -w file # Display the number of words.

Cutting fields in files
To remove sections from each line of files, use cut. cut [options] [files...]

The results are displayed to the standard output.

Common options: -b #: Extract the byte at position #. -f #: Extract the field number #.

Examples: cut -b 4 file # Extract and display the 4th byte of each line of file. cut -b 4,7 file # Extract and display the 4th and 7th byte of each line. cut -b -2,4-6, 20- file cut -f 1,3 -d: /etc/passwd # Extract the username and ID of each line in /etc/passwd.
 * 1) Extract character 1 and 2, 4 to 6 and 20 to the end of the line for each line of file.

The default delimiter is TAB but can be specified with -d.

Characters conversion
To translate the stdin to stdout, use tr. tr [options] SET1 SET2

Common options: -d: delete character in SET1. -s: replace sequence of character in SET1 by one.

Examples: tr ‘a‘ 'A' # Translate lower a with A tr ‘[A-Z]’ ‘[a-z]’ # Translate uppercase to lowercase tr -d ‘ ‘ # Delete all spaces from file

To convert tabs to spaces, use expand and to convert spaces to tabs, use unexpand. expand file unexpand file

Lines manipulation
To paste multiple lines of files, use paste. paste [options] [files...]

Common options: -d #: delimiter: Use # for the delimiter. -s: serial: paste one file at the time.

Examples: paste f1 f2 # Display line of f1 followed by f2. paste -d: file1 file2 # Use ':' for the delimiter.

To join multiple lines of files, use join. join file1 file2

To remove duplicated line, use uniq. uniq [options] [files...]

Common options: -d: only print duplicated lines. -u: only print unique lines.

Examples: uniq -cd file # Display the number of duplicated line.

Splitting files

To split big files, use split. split [options] file

Common options: -l #: split every # lines. -b #: split file in bytes or b for 512 bytes, k for 1Kbytes, m for 1 Mbytes.

Examples: split -l 25 file # Split file into 25-line files. split -b 512 file # Split file into 512-byte files. split -b 2b file # Split file into 2*512-byte files.

Formatting for printing
To format a file, use fmt.

fmt [options] [files...]

Common options: -w #: maximum line width.

Examples:

$ fmt -w 35 file # Display 35-character lines width.

To format a file for a printer, use pr.

pr [options] [files...]

Common options: -d: double space.

Examples:

$ pr -d file # Format file with double-space.

Sort lines of text files
To sort the lines of the names files, use sort.

sort [options] file

The results are displayed to the standard output.

Common options: -r : Reverse -f : Ignore case -n : Numeric -o file: Redirect output to file -u : No duplicate records -t; : Use ';' as delimiter, rather than tab or space.

Examples: sort file -r sort file -ro result

Binary file dump
To dump a binary file, use od. od [options] file

The results are displayed to the standard output and start with an offset address in octal.

Common options: -c: each byte as character -x: 2-byte in hex -d: 2-byte in decimal -X: 4-byte in hex. -D: 4-byte in decimal.

Examples:

$ od -cx /bin/ls 0000000 177  E   L   F 001 001 001  \0  \0  \0  \0  \0  \0  \0  \0  \0 457f 464c 0101 0001 0000 0000 0000 0000 0000020 002 \0 003  \0 001  \0  \0  \0     224 004  \b   4  \0  \0  \0 0002 0003 0001 0000 9420 0804 0034 0000 0000040  °   ²  \0  \0  \0  \0  \0  \0   4  \0      \0 006  \0   (  \0        b2b0 0000 0000 0000 0034 0020 0006 0028 0000060 032  \0 031  \0 006  \0  \0  \0   4  \0  \0  \0   4 200 004  \b        001a 0019 0006 0000 0034 0000 8034 0804

Exercises

 * 1) Use wildcard characters and list all filenames that contain 'x' followed by 'in' in the /etc directory.
 * 2) Use wildcard characters and list all filenames that start with any character between 'a' and 'e' that have at least two more characters and do not end with a number.
 * 3) Use wildcard characters and list all filenames of exactly 4 characters and all filenames starting with an uppercase letter. Do not descend into any directory found.
 * 4) Use wildcard characters and list all files that contains 'sh' in /bin.
 * 5) Display you environment variable HOME preceded by the string "$HOME value is:"
 * 6) Display the contents of $SHELL with two asterisk characters before and after it.
 * 7) How would you display the following string of characters as is with echo using double quote and \.
 * 8) Compose echo commands to display the following two strings:
 * 9) * That's what he said!
 * 10) * 'Never Again!' he replied.
 * 11) Display the number of words in all files that begin with the letter h in the /etc directory.
 * 12) How would you send a 2M file with two 1.44M floppy. How would you put back together the pieces of the split file?
 * 13) What is the command to translate the : delimiter in /etc/password by #?
 * 1) What is the command to translate the : delimiter in /etc/password by #?

 * Exercises results

Overview
Description: ''Candidates should be able to use the basic UNIX commands to copy, move, and remove files and directories. Tasks include advanced file management operations such as copying multiple files recursively, removing directories recursively, and moving files that meet a wildcard pattern. This includes using simple and advanced wildcard specifications to refer to files, as well as using find to locate and act on files based on type, size, or time.''

Key files terms and<tt> utilities</tt> include: <tt>cp find mkdir mv ls rm rmdir touch</tt> file globbing

cp: Copy files and directories. ls: List directory contents.

Create and Remove directories
To create a directory, use mkdir.

mkdir [options] dir

Common options: -m mode: set permission mode. Default use umask. -p parent: create parent directory as needed.

Examples: mkdir -m 0700 bin mkdir -p bin/system/x86

To delete an empty directory, use rmdir.

rmdir [options] dir

Common options: -p parent: remove empty subdirectories.

Examples: rmdir tmp rmdir -p bin/system/x86

Copy files and directories
To copy one file to another, or to a directory, use cp.

cp [options] source target

Source and target can be a file or a directory.

Common options: -i interactive: prompt to overwrite -r recursive: copy the subdirectories and contents. Use -R for special files. -f force: force the overwriting

The default is to silently clobber the target file. Does not alter the source.

Examples: cp *.[a-z] /tmp cp readme readme.orig cp ls /bin cp -ri bin/* /bin

Move & Rename files
To rename a file or directory or to move a file or directory to another location, use mv. mv [options] source target Source and target can be a file or a directory.

Common options: -i interactive: prompt to overwrite -f force: force the overwriting -v verbose The default is to silently clobber the target file.

Examples: mv *.[a-z] /tmp mv readme readme.orig mv ls /bin mv -fi bin/* /bin

Listing filenames and information
The command to list files in the current directory is ls. ls [options] [filenames] Common options are: -l for a long format -F Append a file type character -a All files, including hidden -R Recursive listing of subtree -d Do not descend into directory

The ls is equivalent to the dir command on DOS.

Examples of ls output: $ ls -l /bin/ls -rwxr-xr-x   1   root  root  46784 mar 23  2002 /bin/ls $ ls -ld /bin drwxr-xr-x   2 root   root   2144 nov  5 11:55 /bin $ ls -a. .bash_history .bash_profile .bashrc ... $ ls -dF /etc .bashrc /bin/ls .bashrc /bin/ls*  /etc/

File types
The long format means: $ ls -l /etc/hosts   #List a long format of the file hosts -rw-r—r-- 1 root root 677 Jul 5 22:18 /etc/hosts File content and location Linux/Unix does not distinguish file by filename extension, like Windows. To determine the file content use file. $ file /etc .bashrc /bin/ls /dev/cdrom /etc:      directory .bashrc:   ASCII English text /bin/ls:   ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped /dev/cdrom: symbolic link to /dev/hdc

To determine if a command is a built-in shell command or a program, use type, and use which to find its location. $ type cp cd ls which type cp is /bin/cp cd is a shell builtin ls is aliased to `ls $LS_OPTIONS' which is aliased to `type -p' type is a shell builtin $ which cut /usr/bin/cut

Creating and using filenames
Filenames can be created with: cat chapter1 chapter2 > book vi mynewfile cp file newfile netscape touch memo
 * I/O redirection
 * An editor, such as vi.
 * Many of the Unix utilities
 * An application
 * The touch command, which creates empty files (or updates the "date modified" of existing files)

The valid filename may have: touch more drink touch "more drink" touch memo*
 * Maximum 255 characters per filename
 * Case sensitive 'A' and 'a' are different
 * Any character except forward '/'
 * Recommended alphanumeric characters as well as plus, minus, and underscore characters.
 * Characters to avoid
 * Hypen character.
 * touch my-file -lt
 * White space.
 * Most other special characters !@#$%^&*:;"'}{|\<,>.?~`

Remove files or directories
To remove files or subtree directories, use rm. rm [options] files Files can be a file or a directory.

Common options: -i interactive: prompt to for each removal -f force: force the overwriting -r recursive: remove subtree directories and contents There is no unremove or undelete command.

Examples: rm *.[a-z] rm readme readme.orig rm ls /bin rm -rfi /bin cd; rm -rf * .* # !! this removes all files of in the home directory of the current user, as well as those in the subdirectories !!

Locating files in a subtree directory
To search for a file in a subtree directory, use find. find [subtrees] [conditions] [actions] The command can take multiple conditions and will search recursively in the subtree.

Some possible conditions are: -name [FNG] # Search fo the FNG name -type c # Type of file [bcdfl] -size [+-]# # Has a +- size in blocks (c:bytes,k:kilo) -user [name] # Own by user -atime [+-]# # Accessed days ago +n means not been accessed for the last n days -n means been accessed the last ndays. -mtime [+-]# # Modified days ago -perm nnn # Has permision flags nnn Some possible actions are: -print # Print the pathname -exec cmd {} \; # Execute cmd on the file -ok cmd {} \; # Same as -exec but ask first

Examples find. -name '*.[ch]' -print find /var /tmp. -size +20 -print find ~ -type c -name '*sys*' -print find / -type f -size +2c -exec rm -i {} \; find / -atime -3 -print find ~jo ~toto -user chloe -exec mv {} /tmp \;

To locate a binary, source file, or man pages, use whereis. Whereis [options] Common options: -b: Search only for binaries. -m: Search only for manual sections. -s: Search only for sources. Examples: $ whereis host host: /usr/bin/host /etc/host.conf /usr/share/man/man1/host.1.gz $ whereis -m host host: /usr/share/man/man1/host.1.gz

To locate a file located somewhere defined by the PATH variable, use which. $ which -a ls /bin/ls The -a will look for all possible matches in PATH, not just for the first one.

Exercises

 * 1) Compose an interactive command to remove all .tmp file in your home directory. Respond y to every prompt.
 * 2) List all the files in users home directories ending with .pdf that are bigger than 50 blocks and have not been accessed for a month.
 * 3) Create a file file.h that will contain all the filenames ending with .h found in the /usr directory.
 * 4) Do a touch on all the c files found in /usr/src/packages directory.
 * 5) What are the default permissions when you create a new file and a new directory?
 * 6) How would you create a new file or directory that contains a space in the filename? (Example: 'new dir')
 * 7) What is the command to remove all the files of type char and block in your home directory?
 * 8) How to find the location of the programm find ?
 * 9) Delete all files in /tmp witch are not owned by root and have not been accessed for a week.

 * Exercises results.

Overview
Description: ''Candidates should be able to redirect streams and connect them in order to efficiently process textual data. Tasks include redirecting standard input, standard output, and standard error, piping the output of one command to the input of another command, using the output of one command as arguments to another command and sending output to both stdout and a file.''

Key files terms and<tt> utilities</tt> include: <tt>tee xargs < << > >> ` `</tt>

Standard input and standard output
For each command executed in a terminal, there are: a standard input value 0. (default keyboard) a standard output value 1.(default terminal) and a standard output for the errors value 2. (default terminal).

Each channel can also be identified by an address: &0 for input, &1 for output, And &2 for errors.

Each channel [n] can be redirected. [n]< file: Default value of n is 0 and it reads standard input from file. [n]> file: Default value is 1 and it sends standard output to file, overwriting the file if it exists. (clobber) [n]>>file: Default value is 1 and it appends standard output to file. <<word: Read standard input until word is reached. `command`: Substitute the command name by the result.

Examples:

$ pwd > file # out=file in=none error=terminal.

cat chap* >book # out=book in=none error=terminal.

mv /etc/*. 2>error # out=terminal in=none error=error.

echo end of file >> book # out=book in=none error=terminal.

set -o noclobber # Shell does not clobber existing files.

ls > list 2>&1 # ls and errors are redirected to list.

ls 2>&1 > list # Errors are redirected to standard output and ls output is redirected to list.

cat `ls /etc/*.conf` > conffile 2>>/tmp/errors

Concatenate all the configuration files from /etc dir in conffile and append errors in file /tmp/errors.

Redirecting with pipes

Pipes are an efficient way to apply multiple commandes concurrently.

command1 | command2

The standard output of command1 will be piped to the standard input of command2. The standard error is not piped.

Examples: ls -l /dev | more ls -l /etc/*.conf | grep user | grep 500 ls -l /bin | mail `users`

To redirect the standard output to a file and to the terminal at the same time, use tee. ls -l /dev | tee file ls -l /etc | tee -a file # Append to the file

Building arguments

The xargs utility constructs an argument list for a command using standard input.

xargs [options] [command]

The xargs command creates an argument list for command from standard input. It is typically used with a pipe.

Common options: -p: prompt the user before executing each command.

Examples: ls f* | xargs cat # Print to standard output the content of all files starting with f. find ~ -name 'proj1*' print | xargs cat

Search in the Home directory for files starting with proj1 and send it to the standard input of cat.

Use the /dev/null device file to discard output or error messages.

Try the following: grep try /etc/* grep try /etc/* 2> /dev/null grep try /etc/* > /dev/null 2> /dev/null

Exercises
ls *.c | xargs rm ls [aA]* | xargs cat cat `ls *.v` 2>/dev/null more `ls *.c`
 * 1) Create a file list.bin that will contain all the filenames from /bin directory.
 * 2) Write a command that will append the list of files from /usr/local/bin to the file named list.bin and discard any error output.
 * 3) Split list.bin file into files that are 50 lines long and remove list.bin.
 * 4) From the splitted files create back list.bin. but with inversed order.
 * 5) Simplify the following commands:
 * 1) Use find to do the following command:
 * 1) Write a command that will create a file list.sbin with the contents of /sbin and at the same time display it to standard output.
 * 2) Create a file that within the filename you include the creation time.
 * 3) Create a file that will contain all the filename in reverse order with extension .conf from the /etc directory.

 * Exercises results.

Overview
Description: ''Candidates should be able to manage processes. This includes knowing how to run jobs in the foreground and background, bring a job from the background to the foreground and vice versa, start a process that will run without being connected to a terminal and signal a program to continue running after logout. Tasks also include monitoring active processes, selecting and sorting processes for display, sending signals to processes, killing processes and identifying and killing X applications that did not terminate after the X session closed.''

Key files terms and<tt> utilities</tt> include: <tt>& bg fg jobs kill nohup ps top</tt>

Create processes
A running application is a process. Every processes have: A process ID. A parent process ID. A current directory PWD. A file descriptor table. A program which it is executing. Environment variables, inherited from its parent process. Stdin, stdou, and stderr Other

Bash is a program that when it is executed becomes a process. Each time you execute a command in a shell a new process is created. Except for the buil-in shell command. They run in the shell context. Use type to check if a command is a built-in shell command.

Example type cp ls which type Monitor processes Once the system is up and running from a terminal it is possible to see which processes are running with the ps program. To display a long format of all the processes in the system, do:

ps -Al F S  UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD 004 S    0     1     0  0  80   0 -   112 do_sel ? 00:00:04 init 004 S    0   381     1  0  80   0 -   332 do_sel ? 00:00:00 dhcpcd 006 S    0  1000     1  0  80   0 -   339 do_sel ? 00:00:00 inetd 044 R    0  1524  1222  0  79   0 -   761 -      pts/3    00:00:00 ps

The ps program will display all the processes running and their PID numbers and other information. To see a long format of the processes in your login session, do a:

ps -l F S  UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD 000 S  500  1154  1139  0  80   0 -   724 wait4  pts/1    00:00:00 bash 002 S  500  1285  1283  0  77   0 - 24432 wait_f pts/1    00:00:00 soffice.bin 040 R  500  1442  1435  0  79   0 -   768 -      pts/4    00:00:00 ps F: Process Flags 002: being created, 040: forked but didn't exec, 400: killed by a signal. S: Process States: R: runnable, S: sleeping, Z: zompbie UID: User ID, PID: Process ID, PPID: Parent Process ID, C: Scheduler, PRI: priority NI: Nice value, SZ: size of routine, WCHAN: name of routine

Monitor processes
To monitor the processes in real-time, use top. top 9:20am up  2:48,  4 users,  load average: 0.15, 0.13, 0.09 78 processes: 75 sleeping, 3 running, 0 zombie, 0 stopped CPU states: 15.3% user, 0.3% system,  0.0% nice, 84.2% idle Mem:  254896K av,  251204K used,    3692K free,       0K shrd,   27384K buff Swap: 514072K av,       0K used,  514072K free                  120488K cached PID USER    PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND 1517 rarrigon  0   0 40816  39M 17372 R    15.0 16.0   2:59 mozilla-bin 1727 rarrigon 19   0   988  988   768 R     0.3  0.3   0:00 top 1 root     20   0   220  220   188 S     0.0  0.0   0:04 init 2 root     20   0     0    0     0 SW    0.0  0.0   0:00 keventd RSS: The total amount of physical memory used by the task. SHARE: The amount of shared memory used by the task. %CPU: The task's share of the  CPU  time. %MEM: The task's share of the physical memory. Once top is running it is also possible to execute interactive commands: Type N to sort tasks by pid. Type A to sort tasks by age (newest first). Type P to sort tasks by CPU usage. Type M to sort tasks by memory usage. Type k to kill a process (prompted for pid).

Kill processes
The ps program will display all the processes running and their PID numbers. Once the PID is known, it is possible to send signals to the process. SIGSTOP to stop a process. SIGCONT to continue a stopped process. SIGKILL to kill a process.

The program to send a signal to a process is called kill.

kill -SIGKILL [pid] kill -63 [pid] kill -l

By default a process is started in foreground and it is the only one to receive keyboard input. Use CTRL+Z to suspend it.

To start a process in background use the &. bash & xeyes &

Job control

In a bash process it is possible to start multiple jobs. The command to manipulate jobs are: jobs  # List all the active jobs bg %job # Resume job in background fg %job # Resume job in foreground kill %job # Kill background job

When bash is terminated all processes that have been started from the session will receive the SIGHUP signal. This will by default terminate the process.

To prevent the termination of a process, the program can be started with the nohup command.

nohup mydaemon

Exercises

 * Exercises results.

Overview
Description: ''Candidates should should be able to manage process execution priorities. Tasks include running a program with higher or lower priority, determining the priority of a process and changing the priority of a running process.''

Key files terms and<tt> utilities</tt> include: <tt>nice ps renice top</tt>

Priorities
To start a command with an adjusted priority, use nice.

nice -n +2 [command]

nice -n -19 [command]

The program nice changes the base time quantum of the scheduler.

i.e. it informs the scheduler how important a process is, which is used as a guide to how much CPU time to give it.

For example if you wanted to listen to music whilst ripping another CD, you could use nice -n +5 oggenc, you shouldn’t get any “hops” in the music playback, as the scheduler “knows” the oggenc process is less important.

The value can go from -19 (highest priority) to +20 (lowest priority).

The default value is 0. Only root can set a value below zero.

To modify the priority of a running program, use renice.

renice +1 -u root
 * 1) Change the priority for all root processes.

renice +2 -p 193
 * 1) Change the priority for PID 193

Exercises

 * Exercises results

 * 1) Which user and root processes are using most of the memory?
 * 2) Open two terminals. In one terminal type the following:

while [ 1 ] do echo -n The date is:; date; done

From the other terminal see that you can stop and continue the print out.

3) Same start as 2) but, make the print out to stop for 3[s] and to continue for 1[s] repeatedly. 4) Make a shell script to renice all process called apache to a 19 value. 5) Do a print from ps formated as: “username”, “command”, “nice value” 6) Kill all the process called “bash” and owned by user polto..

Overview
Description: ''Candidates should be able to manipulate files and text data using regular expressions. This objective includes creating simple regular expressions containing several notational elements. It also includes using regular expression tools to perform searches through a filesystem or file content.''

Key files terms and<tt> utilities</tt> include: <tt>grep regexp sed</tt>

Pattern matching
There are two kinds of pattern matching:
 * Wildcards (File Name Generation)
 * Regexp (Regular Expression)

Wildcard characters are mainly applied when they are used in the current directory or subdirectories. When wildcard characters *, ?, [ - ], ~, and ! are used in regexp they no longer generate filenames.

Some of the utilities that use regexp are:
 * grep, egrep
 * vi
 * more
 * sed
 * Perl

Limited regexp search pattern Used by all utilities using regexp.

 * Any 1 char . Ab.a  Abla or Abca
 * 1 char set [   ] Ab[sd]a  Absa or Abda only
 * 1 char range [ - ] Ab[a-z]a Abaa or Abba or ...
 * Not in set [^ ] Ab[^0-9]a  Abaa or Abba or ...
 * 0 or more * Ab*a  Absala or Aba or ...
 * Begin line ^ ^Aba  Line starts>Aba
 * End line $ Aba$  Aba<line ends
 * Literal \ Aba\$  Aba$

Example: Ab[0-3]s ^Ab\^bA [01]bin$ ^..\\ [^zZ]oro

Combinations of limited regexp Combinations used by all utilities using regexp.

 * Any string .* Ab.*a  Abrahma or Abaa or ...
 * String from [   ]* th[aersti]* There or This or ...
 * Multi range [ - - ] Ab[0-2][a-c]a Ab0aa or Ab1aa or ...
 * Match \ \\ \\[a-zA-Z]* \Bethoven

Examples: Ab[0-3][a-z]s ...$ ^[01]\^2 [0-9][a-z] \$ [a-zA-Z]* ^[^c-zC-Z]* ^[a-zA-Z0-9]$

Modifier patterns Replace strings matched by regexp patterns

 * Match m \{m\}  b[0-9]\{3\} b911
 * One or more \{m,\} b[0-9]\{2,\} b52
 * Up to n \{m,n\}  b[0-9]\{2,4\} b1234
 * Beginning of word \< \<wh  where
 * End of word \> [0-9]\>  bin01

grep
To find text in a file, use grep.

grep [options] [string] [files]

Best to quote the string to prevent interpretation.

Common options: -i: Ignore case -l: List filename only if at least one matches -c: Display only count of matched lines -n: Also display line number -v: Must not match.

Examples: grep host /etc/*.conf grep -l '\<mai' /usr/include/*.h grep -n toto /etc/group grep -vc root /etc/passwd grep '^user' /etc/passwd grep '[rR].*' /etc/passwd grep '\<[rR].*' /etc/passwd

sed
To apply a command on a stream, use sed.

sed [address1][,address2][!]command[options] [files...]

The program sed will apply a command from address1 to address2 in a file. The address1 and address2 format are regular expressions. The sed program is a noninteractive editing tool.

Examples: sed '1,3s/aa/bb/g' file # Replace in file from line 1 to 3 aa by bb. sed '/here/,$d' file # Delete line from here to the end. sed '/here/d' file # Delete lines with word here. sed '1,/xxx/p' file # Print lines from 1 to xxx. sed '/ll/,/ff/!s/maison/house/g' file # In file replace words maison by house excluding lines from ll to ff.

Exercises

 * Exercises results

 * 1) Process your bookmarks.html file to produces a list containing just the web site titles in a file called mywebsites.txt
 * 2) Copy all the files from /etc in your home direcory etc/. Display the contents of all the *.conf files by replacing the word host by machine.
 * 3) Display the contents of all the *.conf files that don't contain the root word. What is the command using grep and sed?
 * 4) Print out all the group names where root belongs to.
 * 5) List all the group names that are 4 or 5 characters long.
 * 6) List all the files that contain character lines without spaces (blank).
 * 7) List in etc/ directory all the files that contain numerical characters.
 * 8) Print with ls only the directory names in /.
 * 9) Do “ps -aux” and replace user r_polto by root and print it in to a file called new_process.txt
 * 10) List all process called apache and owned by a usernames starting by “p” or “P”..

Overview
Description: ''Candidates should be able to edit text files using vi. This objective includes vi navigation, basic vi nodes, inserting, editing, deleting, copying, and finding text.''

Key files terms and<tt> utilities</tt> include: <tt>vi</tt> <i>/, ? h,j,k,l G, H, L i, c, d, dd, p, o, a ZZ, :w!, :q!, :e! :! </i>

vi
When using X-Windows, you can use mouse-oriented editors such as xedit. In a cross-development environment, users use their favorite editor. On a non-windowing system, you only need a keyboard editor such as vi. The vi editor on Linux is the same as on any Unix systems. vi has two modes: Transition from one mode to another Command mode to Input mode: i, I, a, A, o, O keys Input mode to Command mode: ESC key The default starting mode is the Command mode The file configuration .exrc can be created in your HOME directory to set up some vi behavior. set ignorecase # No case-sensitive set tabs=3 # 3 space for tab character
 * Command mode: Anything you type will be interpreted as a command
 * Input mode: Anything you type will be inserted into the file

Perform basic file editing using vi

Enter Input mode
 * i before cursor
 * I at start of line
 * a after cursor
 * A at end of line
 * o open line below
 * O open line above

Delete
 * dw delete word
 * dd delete line
 * D delete to end of line
 * x delete char at cursor

Move cursor
 * l one space right
 * h one space left
 * j one line down
 * k one line up
 * $ end of line
 * ^ start of line
 * w next word
 * e end of word

Exercices

 * 1) Use <tt>vi</tt> from any directory to begin editing an empty buffer.
 * 2) Enter a few lines of text into this buffer.
 * 3) Save the contents of the buffer to the directory.
 * 4) Open the file again with <tt>vi</tt>.
 * 5) Create a new line beneath what you typed earlier. (Don't use <tt>i</tt> from command mode!)
 * 6) Exit <tt>vi</tt> without saving these changes.

 * Exercises results


text:
LPI Linux Certification/LPIC1 Exam 101/Linux Filesystems

Section Overview

 * 1.104.1 Create partitions and filesystems
 * 1.104.2 Maintain the integrity of filesystems
 * 1.104.3 Control mounting and unmounting filesystems
 * 1.104.4 Managing disk quota
 * 1.104.5 Use file permissions to control access to files
 * 1.104.6 Manage file ownership
 * 1.104.7 Create and change hard and symbolic links
 * 1.104.8 Find system files and place files in the correct location

 * Linux filesystems
 * Create partitions and filesystems
 * Maintain the integrity of filesystems
 * Control mounting and unmounting filesystems
 * Managing disk quota
 * Use file permissions to control access to files
 * Manage file ownership
 * Create and change hard and symbolic links

Overview
Description: ''Candidates should be able to configure disk partitions and then create filesystems on media such as hard disks. This objective includes using various mkfs commands to set up partitions to various filesystems, including ext2, ext3, reiserfs, vfat, and xfs.''

Key files terms and utilities include: fdisk mkfs

Partitions
Media can be divided into partitions. Partitions are usually created at installation time but can also be created with the fdisk program or other utilities. This will divide the media in partitions and different filesystems can be built and different operating systems can be installed.

IDE is recognized as follows:

 * Primary Master:
 * /dev/hda : Full disk
 * /dev/hda1: First partition
 * /dev/hda2: Second partition

 * Primary Slave: /dev/hdb
 * Secondary Master: /dev/hdc
 * Secondary Slave: /dev/hdd

SCSI is recognized as follows:

 * ID1:
 * /dev/sda: Full disk
 * /dev/sda1: First partition

 * ID2: /dev/sdb

USB and FireWire disks are recognized as SCSI disks.

Once it is partitioned it is possible to build a filesystem on every partition.

Filesystems
Filesystems exist to allow you to store, retrieve and manipulate data on a media. Filesystems maintain an internal data structure (meta-data) that keeps all you data organized and accessible. The structure of this meta-data gives the characteristic of the filesystem. A filesystem is accessed by a driver through the organized meta-data structure. When Linux boots it reads in /etc/fstab all the filesystems that needs to be mounted and checks if they are in an usable state.

When a power failure occurs Linux won't be able to unmout the filesystem properly and some data in the cache won't be synchronized on the media. The meta-data may be corrupted.

Once you reboot the system, it will detect this and do a fsck to the full meta-data structure for a consistency check. This can take a very long time. Few minutes to few hours in proportion of the media size. Journaling a filesystem is adding a new data structure called a journal. This journal is on-disk and before each modification to the meta-data is made by the driver it is first written into the journal. Before each meta-data modification the journal maintains a log of the next operation.

Now, when a power failure occurs there is only the need to check the journal. A journaling filesystem recovery is very fast. It just needs to go through the logs and fix the latest operation. Journaling filesystem recovery can take only few seconds.

On a cluster systems, journaling allows to quickly recover a shared partition of a node that went down.

Linux filesystems
...
 * ext2: Old very stable Linux filesystem. Efficient for files larger than ~2-3K.
 * ext3: Journaling extension for ext2. Possible to move a filesystem back and forth between ext2 and ext3.
 * Reiserfs: Journaling filesystem. 8-15 time faster than ext2 when manipulating small files.
 * XFS: A powerful journaling filesystem with possible quota and ACL
 * Msdos: MS-Windows FAT filesystem type. (mainly used for floppy)
 * Vfat: MS-Windows FAT filesystem type. (mainly used for large hdd partitions)
 * NTFS (ReadOnly but loop files): MS-Windows journaling filesystem
 * SMBFS: A filesystem to mount windows or samba sharing from Linux
 * NFS: Network File System

Filesystem tree
A Linux file system has one top directory called root (/) where all sub directories of the entire system is stored. The sub directories can be another partition, a remote directory, or a remote partition accessible through the network with NFS protocol.

Create filesystems
To create a file system on a partition, use mkfs.

mkfs [options] -t [fstype] device [blocksize]

Common options:
 * -t: fstype: File system type.
 * -c : Check the device for bad blocks before building the filesystem.

The full partition will be erased and organized to the type of filesystem requested. There is no undo command. The fstype possible are: msdos, ext2, ext3, reiserfs,minix,xfs

The blocksize allows to customize the block size for your filesystem.

Examples: mkfs -t msdos /dev/fd0 mkfs -t reiserfs /dev/hdd1 4096

Create extended filesystems
To create an extended (ext2, ext3) filesystem on an partition, use mke2fs.

mke2fs [options] device [blocksize]

Common options:
 * -b: Specify the block sizefstype: File system type.
 * -c : Check the device for bad blocks before building the filesystem.
 * -j: Create the filesystem with an ext3 journal.
 * -L: Set the volume label for the filesystem.

With mke2fs it is possible to store the super-block the journal information on another device. Examples:

mkefs -b 2048 /dev/fd0 -L floppy mkfs -V mke2fs 1.26 (3-Feb-2002) Using EXT2FS Library version 1.263

Monitoring disk usage
To print the disk usage, use du.

du [options] [files...]

Common options:
 * -a: All files not just directories
 * -b: Print size in bytes
 * -c: Total
 * -h: Human readable format. (1K, 20M,...)

Examples:

$ du -ch Documents 112k   Documents/Cours/LPI101 4.0k   Documents/Cours/LPI102 4.0k   Documents/Cours/LPI201 4.0k   Documents/Cours/LPI202 124k   total

du -sk ~ # Sums up your total disk usage in kilobytes

du -ak ~ | sort -n more # Display every file and its disk space in numerical order.

Filesystem disk space
A filesystem is composed of a meta-data structure plus a list of blocks. To print the filesystem disk space usage, use df.

df [options] [files...]

Common options:
 * -a: All included filesystems with 0 blocks.
 * -t: Limit listing to a filesystem type.
 * -h: Human readable format. (1K, 20M,...)

Examples:

$ df -t reiserfs -h F          1k-blocks      Used Available Use% Mounted on /dev/hda3             28771528   3121536  25649992  11% /

$ df -t ext2 -h Filesystem           Size  Used Avail Use% Mounted on /dev/hda1              15M  3.8M   10M  27% /boot

Exercises

 * Exercises results.

Overview
Description: ''Candidates should be able to verify the integrity of filesystems, monitor free space and inodes, and repair simple filesystem problems. This objective includes the commands required to maintain a standard filesystem, as well as the extra data associated with a journaling filesystem.''

Key files terms and utilities include: du df fsck e2fsck mke2fs debugfs dumpe2fs tune2fs

Checking filesystems
To check filesystems consistency, use fsck.

fsck [options] -t [fstype] device [fsck-options]

Common options:
 * -A: Go through the /etc/fstab file and try to check all file systems. Typically  used  at boot time from a script.
 * -t fslist: Specify the type of file system to be checked. With -A,  only  filesystems  that match fslist are checked
 * -C: Display completion/progression bar.

Common fsck-options:
 * -a: Automatically repair.
 * -r: Interactively repair.

Examples:

fsck -t msdos /dev/fd0 -a fsck -t reiserfs /dev/hda2 -r

Checking extended filesystems
To check extended filesystems consistency, use e2fsck.

e2fsck [options] device

Common options:
 * -b: Use an alternate super block filename.
 * -c: This option makes badblocks program to run and marks all the bad blocks.
 * -f: Force checking even if the filesystem seems clean.
 * -a or -p: Automatically repair.
 * -y: non-interactive mode

Examples:

e2fsck -ay /dev/fd0 e2fsck -f /dev/hda2

Debugging extended filesystems
The debugfs program is an interactive file system debugger. It can be used to examine and change the state of an ext2 file system.

debugfs device

Common commands:
 * Help: Give an help on all the command available.
 * Stats: Give a statistics of the media.
 * Stat file: Give a statistic of the file on the media.
 * logdump: Dump the journal's media into a file

Example: stat haut.gif Inode: 14  Type: regular    Mode:  0644   Flags: 0x0   Generation: 67558 User:    0   Group:     0   Size: 3786 File ACL: 0   Directory ACL: 0 Links: 1  Blockcount: 8 Fragment: Address: 0    Number: 0    Size: 0 ctime: 0x3ddf3840 -- Sat Nov 23 09:11:44 2002 atime: 0x3ddf3840 -- Sat Nov 23 09:11:44 2002 mtime: 0x3ddf3840 -- Sat Nov 23 09:11:44 2002 BLOCKS: (0-3):55-58 TOTAL: 4

Dumping extended filesystems info
To print the super block and blocks group information of an extended filesystem, use dumpe2fs.

dumpe2fs [options] device

Common options:
 * -b: print the bad blocks of the filesystem.
 * -h: Display only the superblock information.

Example: dumpe2fs -h /dev/fd0 dumpe2fs 1.26 (3-Feb-2002) Filesystem volume name:  floppy Last mounted on: Filesystem state:        clean Errors behavior:         Continue Filesystem OS type:      Linux Inode count:             184 Block count:             1440 Reserved block count:    72 Free blocks:             1258 Free inodes:             168 First block:             1 Block size:              1024 First inode:             11 Inode size:              128 ...

Tuning extended filesystems
To tune an extended filesystem, use tune2fs.

tune2fs [options] device

Common options:
 * -i#: Interval between filesystem checks [d|m|w].
 * -l: List the contents of the filesystem superblock.
 * -L: Set the  volume  label  of  the  filesystem.

Examples: tune2fs -L floppy /dev/fd0 tune2fs -l /dev/fd0 (Same output as dumpe2fs -h /dev/fd0)

tune2fs 1.26 (3-Feb-2002) Filesystem volume name:  floppy Block count:             1440 Reserved block count:    72 Free blocks:             1258 Free inodes:             168 First block:             1 Block size:              1024 First inode:             11 Inode size:              128 ...

Exercises

 * Exercises results

.
 * 1) Build an ext2 file system, with a block size of 2048 bytes, on a floppy.
 * 2) Change the label of the floppy to BACKUP.
 * 3) Try to add a journal on the floppy media.
 * 4) Use debugfs to validate your floppy file system information, and check when it was last accessed.
 * 5) Use watch to monitor the size when you copy a big file.
 * 6) Create a shell script to list all files on the floppy bigger than 100 Kb.
 * 7) Display file system usage for all MSDOS file systems.
 * 8) Which directory MUST exist in / to qualify this OS as Linux?
 * 9) What is the file system usage of /proc?

Attach and detach filesystems

 * Control mounting and unmounting filesystems

Overview
Description: ''Candidates should be able to configure the mounting of a filesystem. This objective includes the ability to manually mount and unmount filesystems, configure filesystem mounting on bootup, and configure user mountable removable filesystems such as tape drives, floppies, and CDs.''

Key files terms and utilities include: /etc/fstab mount umount

Attach a filesystem
The mount command serves to attach the file system found on some device to the big file tree.

mount [options] mount [options] [-t vfstype] [-o options] device dir

If the device or directory is listed in /etc/fstab you can use the following:

mount [options] [-o options [,...]] device | dir

Normally only root has the privilege to mount devices unless it is specified in the /etc/fstab file. Examples: mount
 * 1) Print all the mounted filesystems (/etc/mtab).

mount -a
 * 1) Mount devices or dirs listed in /etc/fstab.

mount -n -o ro /dev/hdc /mnt
 * 1) Mount /dev/hdc partition in read only mode without updating /etc/mtab.

mount /media/cdrom mount /dev/cdrom
 * 1) Allow a user to mount the CDROM if the following line is in /etc/fstab:
 * 2) /dev/cdrom /media/cdrom iso9660 ro,user,noauto,unhide

mount -o sync /dev/sdb1 /mnt/usb
 * 1) Sync in realtime

Detach a filesystem
To detach a filesystem from the file tree, use umount.

umount [options] umount [options] [-o options [,...]] device | dir

A busy filesystem cannot be unmounted.
 * Open files
 * Working directory of a process.

Examples: umount -a # Unmount devices or dirs listed in /etc/fstab. umount /mnt # Unmount the filesystem attached to /mnt. umount /media/cdrom # Allow a user to unmount the CDROM if the following line is in /etc/fstab: /dev/cdrom /media/cdrom  iso9660  ro,user,noauto,unhide

File system information
The file /etc/fstab contains all the file systems and related information that will be used when doing a mount -a. (Boot time)

The file /etc/mtab is maintained by the kernel and keeps track on what is or isn't mounted. The /etc/fstab format is:

/dev/hda3  /              reiserfs defaults            1 2 /dev/hda1  /boot          ext2     defaults            1 2 /dev/cdrom /media/cdrom   auto     ro,noauto,user,exec 0 0 usbdevfs   /proc/bus/usb  usbdevfs noauto              0 0 /dev/hda2  swap           swap     pri=42              0 0
 * 1) Device    Mount point    Fs type  Options             1 2

Common options:
 * ro:     read only
 * noauto: Don't mount automatically
 * exec:   Can execute binary on the filesystem
 * suid:   Allow to setuser bit
 * user:   Allow a user to mount/unmount it
 * unhide: hidden file visible
 * async:  All operations will be done asynchronously
 * default: rw, suid, dev, exec, auto, nouser, and async

Exercises

 * Exercises results

 * 1) Create a line in /etc/fstab that allows any user to access the floppy disk. Check that you can mount the floppy and can create a file with touch.
 * 2) Do the following manipulation:
 * 3) * Create an ext2 file system on the floppy.
 * 4) * Mount the floppy.
 * 5) *Copy all the files /etc/*.conf into the floppy.
 * 6) * Unmount it. What's happening?
 * 7) * Mount it back and check that all the files are there.
 * 8) * Issue the following command:
 * 9) * Tar cvf /dev/fd0 /etc/*.conf
 * 10) * Try to mount it back. What's happening?
 * 11) * Use tar to view the contents of the floppy..

Overview
Description: ''Candidates should be able to manage disk quotas for users. This objective includes setting up a disk quota for a filesystem, editing, checking, and generating user quota reports.''

Key files terms and utilities include: quota edquota repquota quotaon

 * Managing quotas for filesystems
 * Printing quota reports
 * Managing disk quota

Quotas
On a system, root can manage the usage of disk space per user and per filsystems. The two limits that can be setup are: The soft limit (soft =) specifies the maximum amount of disk usage a quota user is allowed to have. The hard limit (hard =) specifies the absolute limit on the disk usage a quota user can't go beyond it. There is also the possibility to setup a grace period that will enforce the soft limit only after an amount of time specified.

Setting up quotas for users
1) The keyword usrquota or/and grpquota must be added in file /etc/fstab for the partition interested.

/dev/fd0 /home/yann/mnt auto    rw,noauto,user,usrquota 0 0 /dev/hda5 /home    ext2    defaults,usrquota,grpquota 1 2

2) Add in each root filesystems the file user.quota or/and group.quota.

touch /mnt/aquota.user touch /home/aquota.user touch /home/aquota.group chmod 600 /mnt/aquota.user chmod 600 /home/aquota.user chmod 600 /home/aquota.group

Only root can do the quota administration and once the empty files have been created some disk quota can be set such as:
 * Soft limitation on number of files and inodes.
 * Hard limitation on number of files and inodes if the grace time is set.

Setting up quotas for users
3) Check the setting

quotacheck -v mnt quotacheck: Scanning /dev/fd0 [/home/yann/mnt] done quotacheck: Checked 6 directories and 1 files

4) Enable quota on the disk

quotaon -av /dev/fd0 [/home/yann/mnt]: user quotas turned on

5) Customize the disk quota limits:

$ edquota -u yann Disk quotas for user yann (uid 500): Filesystem   locks       soft       hard     inodes     soft     hard /dev/fd0      15          0          0          4        0        0

$ edquota -g yann

$ edquota -t Grace period before enforcing soft limits for users: Time units may be: days, hours, minutes, or seconds Filesystem            Block grace period     Inode grace period /dev/fd0                     7days                  7days

List quotas
To list quotas for a user or group, use quota.

quota [options] [user|group]

Common options:
 * -u:Default, print user quotas.
 * -g:Print group quotas for the group of which the user is a member.
 * -q: Print a more terse message, containing only information on filesystems where usage is over quota.

Example: quota -u yann

Display a quota report
To display a quota report, use repquota.

repquota [options] [user|group]

Common options:
 * -a: Report on all filesystems indicated in /etc/mtab to be read-write with quotas.
 * -g: Report for group.

Example:

$ repquota /dev/fd0 *** Report for user quotas on device /dev/fd0 Block grace time: 7days; Inode grace time: 7days Block limits                  File limits User           used    soft    hard  grace    used  soft  hard  grace -- root  --       8       0       0              2     0     0 yann  --      15       0       0              4     0     0

Exercises

 * Exercises results

 * 1) Setup a soft limitation for any users that have their home directory in /home to 500M.
 * 2) Change the grace time to 0.
 * 3) Log as the user and check if the limitation works..

Overview
Unix File Security File and Directory Permissions Default Permissions Changing File Permissions Changing File Owner and Group More Privileges Unix file security The biggest security problem may be you. You own any directory or files you created. You are responsible for accessibility of your files. You decide who can access which files and directories.

In your home directory you will be able to grant different levels of permission to yourself, users in your group and the all other users.

File and Directory Permissions
The permission of a file or of a directory can be viewed with ls -l.

File permissions
Examples of file permissions:

ls -l readme -rwxrw 1 toto users 14 Jul 5 10:00 readme

This means read,write, and execution permissions for user toto, read and write permissions for members of group users. No permissions for others. (0760)

ls -l /etc/hosts -rw-r--r-- 1 root root 14 Jul 5 10:00 /etc/hosts

This means read and write permissions for user root, read permissions for members of group root and all others. (0644)

Examples of directory permissions:

ls -ld /bin drwxr-xr-x 2 root root 4096 Jul 5 10:00 /bin

This means read,write, and execution permissions for user root, read and execution permissions for members of group root and others. (0755)

ls -l /home/toto drwxr-xr-x 10 toto users 4096 Jul 5 1:00 /home/toto

This means read, write, and execution permissions for user toto, read and execution permissions for members of group users and others. (0755)

Default permissions
The default permissions when creating a file are 0666 and when creating a directory are 0777. Most of the systems overwrite this at boot time with the program umask. Generally the mask value is 022. It means the write for group and other will be blocked. To check or change the mask value, do:

umask umask 066

Examples for file: default: rw- rw- rw- (0666) umask: 0 2 2 (0022) Block result: rw- r-- r-- (0644)

Examples for directory: default: rwx rwx rwx (0777) umask: 0 2 2 (0022) Block result: rwx r-x r-x (0755)

Changing file permissions
To change permissions on a file or directory, use chmod. To overwrite the existing permissions, do:

chmod 0755 /tmp #rwx for user, rx for group and others

To change add or cancel some permissions without overwriting all the existing permissions, do:

chmod u+w readme # Add write permission for user chmod +r readme # Add read permission for everybody chmod -r readme # Remove read permission for everybody chmod u+x,g=r readme # Add execution for user and set read for group chmod u=rwx,go=rx readme # Set read write and execution for user, read and execution for group and others

To change in recursive mode, use the -R option.

chmod -R +x /sbin/*

Exercises

 * Exercises results.

Overview
Description: ''Candidates should be able to control user and group ownership of files. This objective includes the ability to change the user and group owner of a file as well as the default group owner for new files.''

Key files terms and<tt> utilities</tt> include: <tt>chmod chown chgrp</tt>

Changing file owner and group
To change the owner of a file or directory, use chown.

chown yann mon_fichier.txt

To change the group of a file or directory, use chgrp.

chgrp dialout caller

The programs gpasswd and yast2 allow you to administrate groups.

gpasswd [-A user,...] [-M user,...] group
 * -A: Add users with group administrator privileges.
 * -M: Add members in group.

Group administrators can add or delete members of the group

gpasswd -d toto users gpasswd -a toto users

Group administrators can set or remove the password for the group.

gpasswd users gpasswd -r users

More privileges
It is possible to give more privileges to a user when it executes a particular script or program by setting the uid or gid bit of the file.

If the bit is set, the process will inherit the permissions of the owner of the file not the permissions of the user. To set the effective uid or gid, use chmod.

chmod 2640 [file] # (2) gid is inheritable for group. chmod 4640 [file] # (4) uid is inheritable for user.

Example of such program is /bin/passwd.

The sticky bit can also be set and can make the program text segment resident in RAM. chmod 1640 [file] (1) The file program stays in RAM.

Exercises

 * Exercises results

1) Write the command line by using letters with chmod to set the following permissions:

rwxrwxr-x : rwxr--r-- : r--r- : rwxr-xr-x : rwxr-xr-x : r-x--x--x : -w-rx : -xrwx :

2) Write the command line by using octal numbers with chmod to set the following permissions:

rwxrwxrwx : --x--x--x : r---w---x : -w--- : rw-r- : rwx--x--x :

3) With the following umask values what would be the files and directories creation permissions?

umask = 0027 File permissions: Directory permissions:

umask = 0011 File permissions: Directory permissions:

umask = 0541 File permissions: Directory permissions:

umask = 0777 File permissions: Directory permissions:

4) Create two user accounts

Logging in id: tst1, group users, with bash shell, home directory /home/tst1 Logging in id: tst2, group public, with bash shell, home directory /home/tst2 For the two accounts set a password.

Logging in as tst1 and copy /bin/ls into tst1 home directory as myls. Change the owner of myls to tst1 and the permissions to 0710. What does this permission value mean?

Logging in as tst2 and try to use /home/tst1/myls to list your current directory. Does it work ?

Create in /etc/group and /etc/gshadow a new group labo with tst1 and tst2. Change the owner group of myls to labo.

Try again from tst2 account to execute /home/tst1/myls to list your current directory. Does it work?.

Overview
Description: ''Candidates should be able to create and manage hard and symbolic links to a file. This objective includes the ability to create and identify links, copy files through links, and use linked files to support system administration tasks.''

Key files terms and<tt> utilities</tt> include: <tt>ln</tt>

Links
Use link when: You want to create a pathname to a file. Set a shorter or fixed pathname to a file.

To link one file to another, use ln:

ln [options] filename linkname ln [options] filename linkdirectory

Common options:
 * -f force: clobber existing link
 * -s symbolic link

The default links are hard links (ln without an option). On Windows they're called shortcuts. A hard link can only be created to an existing file on the same physical device, after creation no visible association can be displayed between a link name and a file name. A symbolic link can be created on a file that doesn’t exist yet, the association between the link name and the file name can be viewed with the ls command.

Linking to a file
The symbolic and hard link can be displayed with ls -l. Symbolic link are indicated with an arrow: link_name->real_filename.

$ ls -l /dev/midi lrwxrwxrwx  1   root   root        6    Jul 4 21:50   /dev/midi -> midi00

Hard links are indicated with the number of links counter (3-1=2 in this case).

$ ls -l readme -rwxrwxrwx  3   yann   users       677  Jul 4 21:50   readme

When removing a link name, use rm. Only the link will be removed not the linked file.

Exercises

 * Exercises results

 * 1) Create a directory etc and bin in your home directory.
 * 2) Copy all the files in recursive mode from /etc to your etc directory  and do the same for /bin to bin.
 * 3) In your local etc directory rename all files *.conf by *.conf.bak
 * 4) Create in your home directory a symbolic link call dir that points to your local bin/ls. Check if dir do execute ls.
 * 5) Remove the dir link. Is bin/ls still there?.

Exercices

 * Exercises results

Périphériques & Systèmes de fichiers Linux (LPIC101)


text:
LPI Linux Certification/LPIC1 Exam 101/The X Window System

Section Overview

 * 1.110.1 Install & Configure XFree86
 * 1.110.2 Setup a display manager|Setup a display manager
 * 1.110.4 Install & Customize a Window Manager Environment

Overview
X is a windowing system that provides the basic graphic functions of Linux. It's designed to provide a GUI to any other systems operating across a network, regardless of OS.

X operates on a client/server model.

X is not part of the operating system. It is an application.

The standard Linux X server is Xfree86.

The XFree86 log file is located at /var/log/XFree86.0.log.

Configuration
type "XFree86 -configure", it will scan your hardware and auto. generate a configuration file matching to your hardware. However, FOR PS/2 MOUSE, I usually need to modify this config file manually from ""Device" "/dev/mouse"" to ""Device" "/dev/psaux""

Starting and stopping X
To start X you can use: startx - terminal command used at level 3; edit /etc/inittab to run default at level 5; xinit - when there is no .xinitrc file; init 5 - to change manually runlevel to 5 (and run display manager); xdm - (X Display Manager) - graphical login manager, which run automatically at boot process when starting Linux at level 5 (there are also external graphical login managers ex. kdm, gdm).

To stop X you can use: ++; init 3 - at lower level than 5 Linux will stop X Window; kill the XFree process.

Configuring X To configure X on a system use XF86Setup. The program will generate a configuration file that will be used by the XFree86 server. To tune the screen under X use Xfine2.

Under X, the user can configure every conceivable aspect of graphic display. Screen font size, styles Pointer behaviour Screen colors Window manager

The tunning can be done on a system-wide or per-user. .xinitrc contains the default window manager and style information to be used by the startx command. This file is usually located under /home/username when defined on a per-user basis. .Xdefaults used to setup pointer behaviour, colors, fonts, etc...

Exercises

 * Exercises results.

Overview
X needs window managers to manipulate all the graphic applications. Move, size. Open and close. Maximize, minimize, iconize. Title bars The look and feel is implemented in the window manager. shouldn't this be in Widget sets not WMs? Provide virtual desktops. Linux distributions contain many window managers: Fvwm2 Motif-like look, highly customizable WindowMaker Next Step look, fast and lean Wm2 Ultra lean Olwm Open look (Sun) Fluxbox BlackBox
 The desktops bring on top of X Window managers more facilities:

KDE: based on Qt, current at the top of market

GNOME: The "GNU" Desktop, based on Gtk+-v2

Exercises

 * Exercises results.

Exercises

 * Exercises results

Overview
X works in a client-server relationship where the application is the client and the server is the application that knows how to provide the services. On a single system, both applications reside on the same system. On a networked system the user can run an X application which is installed on a remote system and do the display on a local system. The advantage of having a X application server is: No local applications installation is needed. No need to have performant local system. No local access to data.

Networked X
Exporting a simple application : In order to do so do: startx on the serverhost. xhost + Enable lack of identification on the server host. telnet serverhost from the clienthost and set the DISPLAY variable to the clienthost. Export DISPLAY=clienthost:0.0

Exporting the window manager : In order to do so do: Activate xdmcp with gdmsetup on the server Use Xnest to connect the client on the server in broadcast

Exercises

 * Exercises results

1)Logging In your system with the failsafe display manager. Execute kde or gdm. Exit kde and logout from failsafe.

2)After logging into your system try to type the following key combinations. CTRL-ALT-F1, CTRL-ALT-F2, CTRL-ALT-F7 What is happening?

3)When you use startx, what is the file where you define the default window manager?

X Window (LPIC101)


text:
LPI Linux Certification/LPIC1 Exam 101/Detailed Objectives

The following material is directly from the Linux Professional Institute at Objectives 101 reprinted with their permission. Note that their inclusion in this book in no way signifies endorsement on the part of LPI.

This is a required exam for LPI certification Level 1. It covers basic system administration skills that are common across all distributions of Linux.

Each objective is assigned a weighting value. The weights range roughly from 1 to 10, and indicate the relative importance of each objective. Objectives with higher weights will be covered in the exam with more questions.

1.101.1 Configure Fundamental BIOS Settings

 * Weight: 1

Description: ''Candidates should be able to configure fundamental system hardware by making the correct settings in the system BIOS. This objective includes a proper understanding of BIOS configuration issues such as the use of LBA on IDE hard disks larger than 1024 cylinders, enabling or disabling integrated peripherals, as well as configuring systems with (or without) external peripherals such as keyboards. It also includes the correct setting for IRQ, DMA and I/O addresses for all BIOS administrated ports and settings for error handling.''

Key files terms and utilities include: /proc/ioports /proc/interrupts /proc/dma /proc/pci

1.101.3 Configure Modem and Sound cards

 * Weight: 1

Description: Ensure devices meet compatibility requirements (particularly that the modem is NOT a win-modem), verify that both the modem and sound card are using unique and correct IRQ's, I/O, and DMA addresses, if the sound card is PnP install and run sndconfig and isapnp, configure modem for outbound dial-up, configure modem for outbound PPP | SLIP | CSLIP connection, set serial port for 115.2 Kbps.

1.101.4 Setup SCSI Devices

 * Weight: 1

Description: ''Candidates should be able to configure SCSI devices using the SCSI BIOS as well as the necessary Linux tools. They also should be able to differentiate between the various types of SCSI. This objective includes manipulating the SCSI BIOS to detect used and available SCSI IDs and setting the correct ID number for different devices especially the boot device. It also includes managing the settings in the computer's BIOS to determine the desired boot sequence if both SCSI and IDE drives are used.''

Key files terms and utilities include: SCSI ID /proc/scsi/ scsi_info

1.101.5 Setup different PC expansion cards

 * Weight: 3

Description: ''Candidates should be able to configure various cards for the various expansion slots. They should know the differences between ISA and PCI cards with respect to configuration issues. This objective includes the correct settings of IRQs, DMAs and I/O Ports of the cards, especially to avoid conflicts between devices. It also includes using isapnp if the card is an ISA PnP device.''

Key files terms and utilities include: /proc/dma /proc/interrupts /proc/ioports /proc/pci pnpdump(8) isapnp(8) lspci(8)

1.101.6 Configure Communication Devices

 * Weight: 1

Description: ''Candidates should be able to install and configure different internal and external communication devices like modems, ISDN adapters, and DSL switches. This objective includes verification of compatibility requirements (especially important if that modem is a winmodem), necessary hardware settings for internal devices (IRQs, DMAs, I/O ports), and loading and configuring suitable device drivers. It also includes communication device and interface configuration requirements, such as the right serial port for 115.2 Kbps, and the correct modem settings for outbound PPP connection(s).''

Key files terms and utilities include: /proc/dma /proc/interrupts /proc/ioports setserial(8)

1.101.7 Configure USB devices

 * Weight: 1

Description: ''Candidates should be able to activate USB support, use and configure different USB devices. This objective includes the correct selection of the USB chipset and the corresponding module. It also includes the knowledge of the basic architecture of the layer model of USB as well as the different modules used in the different layers..''

Key files terms and<tt> utilities</tt> include: <tt>lspci(8)</tt> usb-uhci.o usb-ohci.o /etc/usbmgr/ usbmodules /etc/hotplug

1.102.1 Design hard disk layout

 * Weight: 5

Description: ''Candidates should be able to design a disk partitioning scheme for a Linux system. This objective includes allocating filesystems or swap space to separate partitions or disks, and tailoring the design to the intended use of the system. It also includes placing /boot on a partition that conforms with the BIOS' requirements for booting.''

Key files terms and<tt> utilities</tt> include: / (root) filesystem /var filesystem /home filesystem swap space mount points partitions cylinder 1024

1.102.2 Install a boot manager

 * Weight: 1

Description: ''Candidate should be able to select, install, and configure a boot manager. This objective includes providing alternative boot locations and backup boot options (for example, using a boot floppy).''

Key files terms and<tt> utilities</tt> include: /etc/lilo.conf /boot/grub/grub.conf <tt>lilo grub-install</tt> MBR superblock first stage boot loader

1.102.3 Make and install programs from source

 * Weight: 5

Description: ''Candidates should be able to build and install an executable program from source. This objective includes being able to unpack a file of sources. Candidates should be able to make simple customizations to the Makefile, for example changing paths or adding extra include directories.''

Key files terms and<tt> utilities</tt> include: <tt>gunzip gzip bzip2 tar configure make</tt>

1.102.4 Manage shared libraries

 * Weight: 3

Description: ''Candidates should be able to determine the shared libraries that executable programs depend on and install them when necessary. Candidates should be able to state where system libraries are kept.''

Key files terms and<tt> utilities</tt> include: <tt>ldd ldconfig</tt> /etc/ld.so.conf LD_LIBRARY_PATH

1.102.5 Use Debian package management

 * Weight: 8

Description: ''Candidates should be able to perform package management skills using the Debian package manager. This objective includes being able to use command-line and interactive tools to install, upgrade, or uninstall packages, as well as find packages containing specific files or software (such packages might or might not be installed). This objective also includes being able to obtain package information like version, content, dependencies, package integrity and installation status (whether or not the package is installed).''

Key files terms and<tt> utilities</tt> include: unpack configure /etc/dpkg/dpkg.cfg /var/lib/dpkg/* /etc/apt/apt.conf /etc/apt/sources.list <tt>dpkg dselect dpkg-reconfigure apt-get alien</tt>

1.102.6 Use Red Hat Package Manager (RPM)

 * Weight: 8

Description: ''Candidates should be able to perform package management under Linux distributions that use RPMs for package distribution. This objective includes being able to install, re-install, upgrade, and remove packages, as well as obtain status and version information on packages. This objective also includes obtaining package information such as version, status, dependencies, integrity, and signatures. Candidates should be able to determine what files a package provides, as well as find which package a specific file comes from.''

Key files terms and<tt> utilities</tt> include: /etc/rpmrc /usr/lib/rpm/* <tt>rpm grep</tt>

1.103.1 Work on the command line

 * Weight: 5

Description: ''Candidates should be able to Interact with shells and commands using the command line. This includes typing valid commands and command sequences, defining, referencing and exporting environment variables, using command history and editing facilities, invoking commands in the path and outside the path, using command substitution, applying commands recursively through a directory tree and using man to find out about commands.''

Key files terms and<tt> utilities</tt> include: . <tt>bash echo env exec export man pwd set unset</tt> ~/.bash_history ~/.profile

1.103.2 Process text streams using filters

 * Weight: 6

Description: ''Candidates should should be able to apply filters to text streams. Tasks include sending text files and output streams through text utility filters to modify the output, and using standard UNIX commands found in the GNU textutils package.''

Key files terms and<tt> utilities</tt> include: <tt>cat cut expand fmt head join nl od paste pr sed sort split tac tail tr unexpand uniq wc</tt>

1.103.3 Perform basic file management

 * Weight: 3

Description: ''Candidates should be able to use the basic UNIX commands to copy, move, and remove files and directories. Tasks include advanced file management operations such as copying multiple files recursively, removing directories recursively, and moving files that meet a wildcard pattern. This includes using simple and advanced wildcard specifications to refer to files, as well as using find to locate and act on files based on type, size, or time.''

Key files terms and<tt> utilities</tt> include: <tt>cp find mkdir mv ls rm rmdir touch</tt> file globbing

1.103.4 Use streams, pipes, and redirects

 * Weight: 5

Description: ''Candidates should be able to redirect streams and connect them in order to efficiently process textual data. Tasks include redirecting standard input, standard output, and standard error, piping the output of one command to the input of another command, using the output of one command as arguments to another command and sending output to both stdout and a file.''

Key files terms and<tt> utilities</tt> include: <tt>tee xargs < << > >> ` `</tt>

1.103.5 Create, monitor, and kill processes

 * Weight: 5

Description: ''Candidates should be able to manage processes. This includes knowing how to run jobs in the foreground and background, bring a job from the background to the foreground and vice versa, start a process that will run without being connected to a terminal and signal a program to continue running after logout. Tasks also include monitoring active processes, selecting and sorting processes for display, sending signals to processes, killing processes and identifying and killing X applications that did not terminate after the X session closed.''

Key files terms and<tt> utilities</tt> include: <tt>& bg fg jobs kill nohup ps top</tt>

1.103.6 Modify process execution priorities

 * Weight: 3

Description: ''Candidates should should be able to manage process execution priorities. Tasks include running a program with higher or lower priority, determining the priority of a process and changing the priority of a running process.''

Key files terms and<tt> utilities</tt> include: <tt>nice ps renice top</tt>

1.103.7 Search text files using regular expressions

 * Weight: 3

Description: ''Candidates should be able to manipulate files and text data using regular expressions. This objective includes creating simple regular expressions containing several notational elements. It also includes using regular expression tools to perform searches through a filesystem or file content.''

Key files terms and<tt> utilities</tt> include: <tt>grep regexp sed</tt>

1.103.8 Perform basic file editing operations using vi

 * Weight: 1

Description: ''Candidates should be able to edit text files using vi. This objective includes vi navigation, basic vi nodes, inserting, editing, deleting, copying, and finding text.''

Key files terms and<tt> utilities</tt> include: <tt>vi</tt> /, ? h,j,k,l G, H, L i, c, d, dd, p, o, a ZZ, :w!, :q!, :e! :!

1.104.1 Create partitions and filesystems

 * Weight: 3

Description: ''Candidates should be able to configure disk partitions and then create filesystems on media such as hard disks. This objective includes using various mkfs commands to set up partitions to various filesystems, including ext2, ext3, reiserfs, vfat, and xfs.''

Key files terms and<tt> utilities</tt> include: <tt>fdisk mkfs</tt>

1.104.2 Maintain the integrity of filesystems

 * Weight: 3

Description: ''Candidates should be able to verify the integrity of filesystems, monitor free space and inodes, and repair simple filesystem problems. This objective includes the commands required to maintain a standard filesystem, as well as the extra data associated with a journaling filesystem.''

Key files terms and<tt> utilities</tt> include: <tt>du df fsck e2fsck mke2fs debugfs dumpe2fs tune2fs</tt>

1.104.3 Control mounting and unmounting filesystems

 * Weight: 3

Description: ''Candidates should be able to configure the mounting of a filesystem. This objective includes the ability to manually mount and unmount filesystems, configure filesystem mounting on bootup, and configure user mountable removeable filesystems such as tape drives, floppies, and CDs.''

Key files terms and<tt> utilities</tt> include: /etc/fstab <tt>mount umount</tt>

1.104.4 Managing disk quota

 * Weight: 3

Description: ''Candidates should be able to manage disk quotas for users. This objective includes setting up a disk quota for a filesystem, editing, checking, and generating user quota reports.''

Key files terms and<tt> utilities</tt> include: <tt>quota edquota repquota quotaon</tt>

1.104.5 Use file permissions to control access to files

 * Weight: 5

Description: ''Candidates should be able to control file access through permissions. This objective includes access permissions on regular and special files as well as directories. Also included are access modes such as suid, sgid, and the sticky bit, the use of the group field to grant file access to workgroups, the immutable flag, and the default file creation mode.''

Key files terms and<tt> utilities</tt> include: <tt>chmod umask chattr</tt>

1.104.6 Manage file ownership

 * Weight: 1

Description: ''Candidates should be able to control user and group ownership of files. This objective includes the ability to change the user and group owner of a file as well as the default group owner for new files.''

Key files terms and<tt> utilities</tt> include: <tt>chmod chown chgrp</tt>

1.104.7 Create and change hard and symbolic links

 * Weight: 1

Description: ''Candidates should be able to create and manage hard and symbolic links to a file. This objective includes the ability to create and identify links, copy files through links, and use linked files to support system administration tasks.''

Key files terms and<tt> utilities</tt> include: <tt>ln</tt>

1.104.8 Find system files and place files in the correct location

 * Weight: 5

Description: ''Candidates should be thoroughly familiar with the Filesystem Hierarchy Standard, including typical file locations and directory classifications. This objective includes the ability to find files and commands on a Linux system.''

Key files terms and<tt> utilities</tt> include: <tt>find locate slocate updatedb whereis which</tt> /etc/updatedb.conf

1.110.1 Install & Configure XFree86

 * Weight: 5

Description: ''Candidate should be able to configure and install X and an X font server. This objective includes verifying that the video card and monitor are supported by an X server, as well as customizing and tuning X for the videocard and monitor. It also includes installing an X font server, installing fonts, and configuring X to use the font server (may require a manual edit of /etc/X11/XF86Config in the "Files" section).''

Key files terms and<tt> utilities</tt> include: <tt>XF86Setup xf86config xvidtune</tt> /etc/X11/XF86Config .Xresources

1.110.2 Setup a display manager

 * Weight: 3

Description: ''Candidate should be able setup and customize a Display manager. This objective includes turning the display manager on or off and changing the display manager greeting. This objective includes changing default bitplanes for the display manager. It also includes configuring display managers for use by X-stations. This objective covers the display managers XDM (X Display Manger), GDM (Gnome Display Manager) and KDM (KDE Display Manager).''

Key files terms and<tt> utilities</tt> include: /etc/inittab /etc/X11/xdm/* /etc/X11/kdm/* /etc/X11/gdm/*

1.110.4 Install & Customize a Window Manager Environment

 * Weight: 5

Description: ''Candidate should be able to customize a system-wide desktop environment and/or window manager, to demonstrate an understanding of customization procedures for window manager menus and/or desktop panel menus. This objective includes selecting and configuring the desired x-terminal (xterm, rxvt, aterm etc.), verifying and resolving library dependency issues for X applications, exporting X-display to a client workstation.''

Key files terms and<tt> utilities</tt> include: .xinitrc .Xdefaults <tt>xhost</tt> DISPLAY environment variable

Objectifs détaillés (LPIC101)


text:
Chinese (Mandarin)/Greetings

Chinese, like all languages, has its own set of unique greetings which may be seemingly strange to learners of the language (this is particularly true if the two cultures are vastly different). Below, you will find commonly-used Mandarin greetings and farewells, along with corresponding pinyin pronunciations.

Hello

 * 你好. nǐ hǎo ; The standard "hello" greeting. Literally means "you good."
 * 您好. nín hǎo ; The same "hello" greeting as above, except that 您 (nín), like in many European languages, is the polite form of "you", used when addressing elders, or teachers etc.
 * 你好吗？　你好嗎？ nǐ hǎo ma? ; More often used following a greeting than not, however, this can be used as a "How are you?.
 * 您好吗？　您好嗎？ nín hǎo ma? ; The same as the "n ǐ hǎo ma? " above, again, except that this is used as a more polite form.
 * 你怎么样？你怎麼樣？ nǐ zěnmeyàng? ; "What's up?", "How are you doing?"
 * 幸会　幸會 xìnghuì! "Nice to meet you!" Used for the first meeting.
 * 久仰 jiǔyǎng ; An extremely polite greeting that is not commonly used between friends, but rather between professionals meeting for the first time.
 * 久闻大名　久聞大名 jiǔwéndàmíng ; This greeting should be reserved for use towards those whom you have extreme respect for, and is used for the first meeting. Literal translation: "Your name is famous" / "I have heard much about you".
 * 久仰大名 jiǔyǎngdàmíng ; The same as above one.

Good morning

 * 早 zǎo ; Also good morning.
 * 早安 zǎo'ān ; Seldom used in the Mainland.
 * 早上好 zǎoshàng hǎo.

Good afternoon

 * 午安 wǔ'ān ; note: seldom used in the Mainland. Mostly used in the Republic of China and the rest of the Chinese speaking world.
 * 下午好 xìawǔ hǎo! Seldom used in the Republic of China and in the Chinese speaking world.

Good evening / Good night

 * 晚安 wǎn'an ; Literally "Peace at night", Good night.
 * 晚上好 wǎnshang hǎo ; Good evening!

Good-bye

 * 再见　再見 zàijian ; Literally "See you again".
 * 明天见　明天見 míngtian jiàn ; Literally "See you tomorrow".
 * 拜拜 bāibāi/báibái ; From English "Bye-Bye". Widely used in Hong Kong, Taiwan and most urbanised parts of mainland China. 掰掰 (báibái) is the variant character form that is gaining popularity in ROC.
 * 回头见　回頭見 huítóujiàn : roughly equivalent to "see you soon", used in northern China.
 * 再会          再會 zàihuì : Literally "[we'll] hello again". Usually used in Shanghai or other parts of China, and sometimes used at the end of TV programs.

Chinese New Year Greetings

 * Xīnnián kuàilè 新年快乐　新年快樂 Happy New Year
 * gōngxǐ fācái 恭喜发财　恭喜發財 gongxi facai

title: Chinese (Mandarin)/Greetings


text:
Spanish/Vocabulary/Love

= El amor =

Verbos

 *  amar:  to love (someone). Te amo: I love you (deeply).
 *  querer:  to care for; to love. Te quiero: I love you (I care for you deeply).
 *  quererse:  to love each other.
 *  gustar:  to like; to be physically attracted to. Me gusta María: I like María; I'm physically attracted to María.
 *  encantar: to love (something); to enchant. Conjugate like gustar when using it for 'love' Me encanta la tele I love television.
 *  gustarse:  to be physically attracted to each other
 *  tener cariño por alguien:  to have sentimental feelings toward someone
 *  salir con:  to go out with; to date someone
 *  estimar:  to esteem
 *  apreciar:  to appreciate
 *  abrazar:  to hug. abrazos para ti: hugs for you
 *  besar:  to kiss. muchos besos para ti: many kisses for you
 *  salir en cita con alguien:  to go on a date with someone
 *  terminar:  to break up with. Pepe y yo terminamos: Pepe and I broke up (our relationship broke up or ended).
 *  pelear:  to argue.
 *  enamorarse:  to fall in love
 *  casarse:  to get married

Sustantivos

 *  el novio:  boyfriend; fiancé; groom
 *  la novia:  girlfriend; fiancée; bride
 *  los novios:  dating couple; engaged couple; bride and groom
 *  los prometidos:  engaged couple
 *  el matrimonio:  marriage; wedding. Also: a married couple.
 *  el esposo, el marido:  husband
 *  mi esposa, mi mujer, mi señora:  my wife
 *  mi jefa  my wife (or my mom) lit.  my boss (f)
 *  el sacerdote:  the priest
 *  la iglesia:  the church
 *  la boda, el matrimonio:  the wedding
 *  la boda civil, el matrimonio civil:  the civil service
 *  la boda religiosa, el matrimonio religioso:  the religious service
 *  la luna de miel:  honeymoon
 *  la pareja:  the couple
 *  mi pareja:  my partner; my significant other. It has feminine grammatical gender, so someone can say Antonio fue mi última pareja (Antonio was my last partner) even though Antonio is a male.
 * los convivientes: the cohabiting couple.
 * los amantes, los enamoradores: lovers.
 * amor: love
 * El día de los enamorados, el día de San Valentín: Valentines day

title: Spanish/Vocabulary/Love


text:
Chinese (Mandarin)/Lesson 2

=Lesson 2: 今天你忙不忙？=

Lesson 2 contains a dialogue of two students discussing their classes for the day.

Dialogues
Dialogue 1

Dialogue 2

Vocabulary
Note: Visit this lesson's Stroke Order subpage to see images and animations detailing how to write the following characters. Audio files of the words are linked from the pīnyīn when available. Problems listening? See media help.

The adverb Hěn [很]
1. 我很忙.
 * Wǒ hěn máng
 * I am (very) busy.

Le [了] as emphasizer
1. 太多了.
 * Tài duō le.
 * (That's) too many.

2. 太少了.
 * Tài shăo le.
 * (That's) too few.

Affirmative-negative questions
Example: Q: 他是不是东尼？
 * Tā shì bu shì Dōngní?
 * Is he Tony?
 * literally, "he is/is not Tony?"

A: 是的. （是，他是/嗯，他是. ）or 不是. （不，他不是. ）
 * Shì de. (Shì tā shì) or Bú shì (Bù tā bú shì).
 * Yes (he is). or No (he isn't).

Example: Q:艾美今天忙不忙？/艾美今天忙不？
 * Àiměi jīntiān máng bù （máng）?
 * Is Amy busy today?
 * literally, "Today, Amy busy/not busy"

A: 她很忙. or 她不忙.
 * Tā hěn máng. or Tā bù máng.
 * Yes, she's (very) busy. or No, she's not busy.

Sentences using yǒu [有]
Example: 我有三门课.
 * Wǒ yǒu sān mén kè.
 * I have three classes.

Example: 今天，他们没有课.
 * Jīntiān tāmen méi yǒu kè.
 * Today, they don't have any classes.

Example: 今天，他们一门课都没有.
 * Jīntiān tāmen yì mén kè dōu méi yǒu.
 * Today, they don't have a single class.

de:Chinesisch: 第二課 Chino/Lección 2 Cinese/Lezione 2 Chiński/Podstawy/Lekcja 2

title: Chinese (Mandarin)/Lesson 2