Beginner must See, Linux Learning Basics

Source: Internet
Author: User
Tags file copy posix

Linux Learning Basics

1. What is Linux?


Accurately speaking, refers to the Linux kernel (core program of the system), its core copyright belongs to Linus Torvalds, under the GPL (GNU general public License) under the Copyright agreement, anyone can freely copy (copy), modify ( Change), bundle distribution (distribute), sales, but cannot add any restrictions at the time of distribution, and all the original code must be public, so anyone can get all execution files and the original code for free.


For Linux users and system administrators, Linux refers to a complete operating system that contains Linux kernel, utilities (system utilities), and application (application software). Linux applications are developed by the Free Software Foundation (FSF), and many enthusiastic programmers around the world have developed or ported many applications for Linux, including X-windows, Emacs, TCP/IP networks (including SLIP/PPP/ISDN), etc. Now that Linux (including the kernel and a large number of applications) has reached 200M, the size of the full installation will be larger (about 500M or so).


Essentially, Linux is a Unix-like "clone" or UNIX-style operating system that is compatible with most UNIX standards (such as IEEE Posix,system V,BSD) at the original code level, and it complies with the POSIX specification, for example, for system V, It can be run after the program source code has been recompiled under Linux, and for BSD Unix, its executable can be run directly in the Linux environment.


Linux logo is a lovely penguin, as for why the use of penguins, Linus is said: The other is used by others, penguins, is not very cute?! Released by the Linux authors is only a kernel, some companies or organizations to the kernel, the original code and related applications to organize the distribution together, resulting in a different version of the Linux distribution (distributor), the more famous distribution version has Redhat, SlackWare , S.U.S.E, Debian and so on. Technical Advice Liao 13687358291 3054605532 more share


2, the development history of Linux?


The history of Linux dates back to the 1990, when Linus Torvalds, a student at the University of Helsinki in Finland, originally wrote a program in assembly language to handle multi-tasking in 80386 protected Mode, later from Minix (for operating system teaching, very small Unix) Get inspiration, vowed to write a better than Minix Minix, so began to write some hardware device driver, a small file system ..., So 0.0.1 version of Linux came out, but it must be compiled on the Minix machine to play, at this time the Linus has been completely "obsessed", decided to kick open Minix "revolution", so on October 5, 1991 released the Linux 0.0.2 version, This version is already ready to run bash (a user's software that communicates with the OS kernel) and GCC (the GNU C compiler).


Linus from the outset, decided to free-spread Linux, including the source code, he put the source code on the Internet, immediately aroused the attention of enthusiasts, they also joined the Linux kernel development work through the interconnection network, a large number of high-level programmers to join, so that the rapid development of Linux, to the end of 1993 , Linux 1.0 was finally born. Linux 1.0 is already a full-featured operating system, its core is written in a compact and efficient, can fully play the performance of the hardware, in 4 m memory of the 80386 machine also performed very well.


Many people have a misunderstanding of Linux, that is, the total Linux and low-end hardware platform linked together, In fact, starting from the 2.1.XX series kernel, Linux began to move up the path, about 1.3 version, began to migrate to other hardware platforms, including the so-called fastest CPU---Digital Alpha (the current frequency is the highest), At present, Linux can fully realize the performance of the hardware, can include all low-end to high-level applications.


Linux joins the GNU and adheres to the public Copyright license (GPL), because it does not exclude the further development of free software, and does not exclude the development of commercial software on Linux, so Linux has started a leap, there are a lot of Linux distributions, such as Slackware, Redhat , Suse, Turbolinux, OpenLinux, and more than 10 kinds, but also growing, some companies on Linux to develop commercial software or other UNIX platform software porting to Linux, many of the IT industry today, such as IBM, Intel, Oracle, Infomix, Sysbase, Corel, Netscape, CA, Novell, etc. all announced support linux! Merchants to join to make up for the lack of pure free software and development barriers, the rapid popularization of Linux.



1, how to quickly master Linux?


The method is more hands-on, brain, learning to be often compared with Windows. It is recommended that you install Redhat Linux First, then practice how to configure it, how to use Linux commands, how to operate under X-windows, how to install applications under Linux, how to surf the Internet under Linux, edit documents, play multimedia files, play games, and so on.


The only way to get started quickly is to do more hands-on and see if you can do the work above.


2. What are the similarities and differences between Linux and Windows?


Windows is a graphical interface, Linux is similar to the previous DOS, is the text interface, if you run the graphical interface program X-windows, Linux can also display the graphical interface, there are start menus, desktops, icons and so on.


WINDOWS has an MS-DOS approach in which the computer is manipulated by entering DOS commands, and Linux is similar to WINDOWS and has command methods, which, if not executed x-windows after Linux boot, is in command mode and must be issued with commands to operate the computer. In addition, Linux also has a lot of application software, installed and run the software, you can be on Linux to edit documents, pictures, play games, surf the Internet, play multimedia files and so on.


However, the partition format and directory structure of Linux are very different from Windows and the application software is installed differently.


3. Precautions when installing Linux


Before installing, determine which partition Linux is installed on, and Linux has two partitions of system partition and swap partition (similar to Windows virtual partition, i.e. swap file). Because Linux supports a different partition format than the Windows partition format, if Linux is installed, Windows can continue to be used, Linux should be installed in the last extended partition of the hard disk partition, and then the swap partition of Linux must be guaranteed to be 60MB, The system partition must be guaranteed at least 240MB, and in addition to the installation of PC hardware information, especially the display information, which will directly determine your installation of Linux, the use of graphical interface program effect; When you enter commands in installation, use, pay attention to case.


4, master the directory structure of Linux


The directory structure of Linux is different from Windows, and the directory of Linux is not visible under Windows, and in turn, Linux does not see directories under Windows. The meanings of the directories under Linux are as follows:


Directory name meaning

/vmlinuz the system kernel is stored in this directory

/bin common commands for Linux in this directory, in some versions the same directory as the root directory.

/boot This directory is stored in the system to use the program when booting, when using Lilo to boot Linux, will use some of the information here

/dev The directory contains all the external devices used in the Linux system, and it is actually a port that accesses these external devices, and you can access these external devices without distinction from accessing a file or a directory. For example, by typing "cd/dev/cdrom" in the system, you can see the files in the optical drive, and type "Cd/dev/mouse" to see the relevant files of the mouse.

/cdrom This directory is empty when the system is just installed, you can hang the optical drive file system in this directory, for example "Mount/dev/cdrom/cdrom"

/etc

This directory contains the various configuration files and subdirectories to be used in system administration, such as network configuration file, file system, x system configuration file, device configuration information, setting up user information and so on.

/sbin This directory is used to store system administrator's system management program.

/home If a user named "XX" is established, then there is a corresponding "/home/xx" path in the/* directory to hold the user's master directory.

/lib This directory is used to store system dynamic connection shared libraries, almost all applications will use the shared library in this directory

/lost+found the directory is empty in most cases. However, some files are temporarily stored here when there is a sudden power outage or an abnormal shutdown.

/mnt The directory is also empty in general, you can temporarily hang other file systems in that directory.

/proc can obtain system information in this directory, which is generated by the system itself in memory.

/root If you are logged in as a superuser, this is the Superuser's home directory

/tmp is used to store temporary files generated when different programs are executed

Many applications and files for the/usr user are stored in this directory


5. Common commands for Linux


If you encounter a command that will not be used in the Linux command line mode, you can hit "man [command]" to get the help of the command, if you want to know what the parameters of a command, you can hit Command-help to get.


Note: The parameter input form in Linux is not the same as DOS, the command should be followed by a space, and then hit "-", and then one or more parameters, and Linux under the case is different!


Here are some of the most commonly used commands under Linux, each of which is compared to the corresponding DOS commands and lists some common parameters.


Command parameter meaning

Ls

-a lists the hidden files in the system, the hidden files under Linux are represented by the format of the file name, unlike DOS, which is represented by the document attribute, that is, as long as the file is "." Start, then it is an implicit file.

-L is listed as long. is to list all the information for that file or directory, one for a single row

Corresponds to the dir command under DOS, which is the command for the list of column files.

CD and DOS under the same CD, the conversion directory commands. Note: Go to the parent directory under Linux to hit "CD." Instead of a Dos "CD.", which is a space after "CD"

PWD lists the current directory command, which is equivalent to a CD command with no parameters under DOS. For example:

[Email protected] bin]# Pwd/usr/bin [[email protected] bin]# This means that it is currently under the "/usr/bin" directory.

Mkdir

-M mode indicates the default directory mode when the directory is established. This is DOS and Windows does not have the function, mainly about the permissions of the problem.

Create a new directory, equivalent to the DOS command. Generally used mkdir [dirname]

RmDir Delete directory, equivalent to the DOS Rd command.

Usage: rmdir [dirname]

Cat appends files to the file, or prints the contents of the file on the screen, appending the equivalent of a DOS copy file1+file2, while printing the contents of the file on the screen can be analogous to the DOS typeml. If the file is too large to be fully displayed on one screen, the more command is available

More split screen displays the contents of the file, and dos the more command is roughly the same, but it can be used in conjunction with other commands. Example: Cat/home/eec/myfile | More

Cp


-R equals Dos xcopy/s. Used to copy all subdirectories and file copy files in a directory, equivalent to a DOS copy, using the same method as copy under DOS.


=======================================


System installation: Linux Quick Start


Many beginners feel that the Linux operating system is difficult to use, and now the basic operation of Linux and DOS operating system similar to the comparison of the following, so that everyone get started as soon as possible



[First, basic knowledge]

1. [System Installation]

When installing Linux, use tabs, arrows, spaces, carriage returns, and other keys to make your selection. Linux generally must be installed in a separate partition, in order to avoid the Windows system registry, shortcut path error, preferably installed in the last partition of the hard disk. After the last partition is deleted, partition software (recommended with pqmagic) is divided into Linux Native (root partition) and Linux swap (data exchange area), if your hard disk is larger than 8G, your Linux root partition should be installed in the first 8G (Linux The root partition terminates the sector <1023 cylinder). Native partitions are generally larger than 240MB, depending on the size of the installed Linux components, it is recommended not to be greater than 2G. The swap partition must have more than 60MB. Before installing, collect your hardware information such as: CPU, Memory, monitor, video card, mouse, keyboard and so on. Linux has a lot of versions, and constantly updated, according to the prompt installation generally can be completed smoothly.


2, [login into]

Default installation, after startup, after the advent of Lilo boot: Enter Linux (or carriage return), Linux will start, when the login prompt login: Enter the user name, and then appear password prompt password: Enter the password. Access to the appropriate user environment. If you enter: root, and its password, you can enter the Super User environment #, enter a different user name and password, you can enter the user environment $ (of course, due to the different version may be%, etc.).


3. [Close System]

At the Super User prompt # Enter halt (immediate shutdown) or shutdown [TIME] (delay time after the shutdown, giving each user a warning about how long it will take to shut down), the computer will perform a series of shutdown work, and finally, when the system halt appears, Indicates that the power supply can be turned off. Non-superuser is required to exit the operating environment with the Exit command, and then use the Superuser: root login to perform the shutdown operation.


4. [Precautions]

Where DOS is not exactly the same:


DOS Linux Notes

The command-line letter is case-insensitive in Linux, the system prompt for the superuser is #, and the normal user's system prompt is $, and the normal user's system prompt can be changed as well as DOS. The wildcard character in *,? is the same as in DOS, [] is only the symbol inside the parentheses, the consecutive symbol can be replaced with the "-" link to the end of the symbol, such as [12345678] may be replaced by [1-8], [Abcdefijk] available [a-fi-k].

Path delimiter/

Prompt > #, $

Wildcard characters *,? *、?、[]


5. [File Type]

Unlike DOS, Windows, in Linux systems, directories and devices are considered files, a total of four file types, they are: ⑴ ordinary files, that is, we usually say the file, in the long list of directories in the way before the beginning of the line with a symbol "-" represented. The ⑵ directory file, which is what we usually call a directory, is denoted by the first letter "D" in the long list. ⑶ character device files, such as displays, printers, terminals, etc., are denoted by a letter "C" before the beginning of a long list of directories. ⑷ block device files, such as hard disks, floppy disks, and discs are denoted by a letter "B" before the beginning of a long list of directories. When using the Long Format Column Directory command ls-l in Linux, for example:


-rwxrw-r--5 User Group 1089 Nov 1998 filename

Access Rights user group number of sections last modified time file name


The file name under DOS is in 8.3 format, WINDOWS95 supports long filenames later, and Linux supports long filenames. In DOS, the file extension is COM, exe or bat files are executable files, but in Linux file types can only be known through the file properties, with the command ls–f can be distinguished directories and files, after the "/" symbol for the directory, after the "*" Symbol for the executable file, with ls– AF can list all files and directories, including hidden files and directories, with the name "." Begins with a hidden file.


6. [Read access]

In Linux, the owner of the file is called the owners, other users are known as the same group, others, in order to ensure the security of the user files, Linux inherits the Unix practice, by setting access permissions, restrict some users to the file arbitrary access. There are three levels of access rights: Read Right R, write right W, executive right x. There are nine characters in the access right in the order: owner, group, other person. In the above example, said: The owner of the file has read and write rights and enforcement rights, the same group of people have read and write rights to the document, other people only have read rights.


7. [Use Help]

In Linux, you can get online Help for the command by simply playing the man command on the command line (you want to see the help command). Man has its own command, usually composed of a single key, press the SPACEBAR and the F key to turn to the next page, press the B key to the previous page, press the Q key to exit man, back to the command line.


[Ii. file management and directory operations]

1. [File Management]


Feature DOS Linux notes

Show file contents type, more cat, more type, cat is all displayed, more is paginated display

Copy file copy CP

Moving files and renaming move MV

Delete Files del, erase RM

Print file, print lpr


2. [Directory operation]


Feature DOS Linux notes

Column directory and file dir/option ls– option in Linux cd/is returned directly to the directory at login instead of the root directory

Show current directory CD pwd

Change Working directory CD directory cd/directory

Set up directory MD, mkdir mkdir

Delete Directory Rd, RmDir rmdir

Catalog Rename Move MV

Copy directory xcopy copy


It is said that many DOS commands are borrowed from UNIX, and Linux is developed from UNIX, so the format of DOS and Linux commands is very similar, but the function of the command of Linux is more powerful, the options, parameters have a big difference, use the help command.


[Third, the use of external memory]

In Linux, there is generally no direct access to floppy disks, other hard disk logical partitions, CDs, etc., they are considered files in Linux and must be loaded into the/MNT directory of the system using mount command mount before use, and should be uninstalled after the end of use. The command format is as follows:


Mount–t file system type device name mount directory


The commonly used file types are:

Msdos DOS Partition file

VFAT DOS partitions that support long file names

EXT2 Linux File system

Swap Linux swap partition or swap file

ISO9660 installing the CD-ROM file system

HPFS OS/2 Partition File system


Device name refers to the name of the device to be loaded, such as floppy disk, hard disk, CD-ROM, etc., floppy disk is generally/dev/fd0 FD1, hard disk is generally/dev/hda HDB, hard disk logical partition for a general period of hda1 hda2 ... And so on, CDs are generally/DEV/HDC. Before loading generally in the/DEV/MNT directory to create an empty directory (first name), such as floppy disk can be floppy, hard disk partition for its disk such as C, D and so on, CD-ROM can be CD-ROMs, individual use example:


mount a floppy disk in mddos format: mount–t msdos/dev/fd0/mnt/floppy

mount a floppy disk in Linux format: Mount–t ext2/dev/fd0/mnt/floppy

Mount the hard disk partition in WINDOWS98 format (C-drive): Mount–t vfat/dev/hda1/mnt/c

Mount a disc: Mount–t Iso9660/dev/hdc/mnt/cd-rom


After the load is completed, you can operate the directory, you must exit the directory before using the new floppy disk and the CD-ROM, use the uninstall command Umount Uninstall, you can use the new floppy disk and CD-ROM, or the system will not admit that the CD before uninstalling the eject key before the drive panel can not exit.


The above is just the basic knowledge of Linux, but I believe you have mastered the rapid step into the Linux gate, further in-depth study of other Linux knowledge should not be a problem


Beginner must See, Linux Learning Basics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.