Linux Learning Basics Tutorial _unix Linux

Source: Internet
Author: User
Tags file copy mkdir parent directory posix
Basics of Linux Learning
1, what is Linux?
To be exact, the Linux kernel (the core program of the system), whose kernel copyright belongs to Linus Torvalds, is issued under the GPL (GNU general public License) Copyright Agreement, and anyone can copy (copy) and modify ( Change), package distribution (distribute), sales, but can not add any restrictions at the time of distribution, and all the original code must be public, so anyone can get all the execution files and the original code.
For Linux users and system administrators, Linux refers to a complete operating system that contains Linux kernel, utilities (System Tools), 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 Linux (including the kernel and a large number of applications) is already up to 200M to execute the program and will be larger (about 500M) after the full installation.
Linux is essentially a Unix "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 files can be run directly in the Linux environment.
Linux logo is cute penguin, as for why the use of penguins, Linus is said: The other is used by others, penguins, not also very cute?! The Linux author publishes just one kernel, and some companies or organizations distribute the kernel, the original code, and related applications together, resulting in a different Linux release (distributor) version, with a more famous release redhat, SlackWare , S.U.S.E, Debian and so on.
2, the development of Linux history?
The history of Linux dates back to 1990, Linus Torvalds, a student at the University of Helsinki in Finland, originally wrote a program in assembly language to handle multitasking in 80386 protection mode, later from Minix (for operating system teaching, very small Unix) Was inspired to write a better minix than Minix, and began to write some hardware device drivers, a small file system ..., This 0.0.1 version of Linux came out, but it must be in the Minix machine to play after compiling, this time the Linus has been completely "out of possession", decided to kick open Minix "revolution", so on October 5, 1991 released a Linux 0.0, 2 version, This version is already ready to run bash (a software that communicates with the OS kernel) and GCC (the GNU C compiler).
Linus from the outset, decided to freely spread Linux, including the source code, he put the source code online, and immediately attracted the attention of enthusiasts, they have joined the Linux core development work through the Internet, a large number of high-level programmers to join, so that the rapid development of Linux, by the end of 1993 , Linux 1.0 was finally born. Linux 1.0 is already a full-featured operating system, its core is compact and efficient, can give full play to the performance of the hardware, the 4 m memory of the 80386 machine also performed very well.
A lot of people have a misunderstanding of Linux, that is, always put Linux and low-end hardware platform to connect together, In fact, starting with the 2.1.XX-series kernel, Linux began to move up the path, after about 1.3, began porting to other hardware platforms, including the so-called fastest CPU---Digital Alpha (currently the highest frequency), At present Linux can give full play to the performance of hardware, can include low-end to high-end of all applications.
Linux joins the GNU and follows the public Copyright license (GPL), because does not exclude the merchant to the free software further development, does not reject the development commercial software on the Linux, therefore causes the Linux to start again the leap, has appeared many Linux distributions, like Slackware, Redhat , Suse, Turbolinux, OpenLinux and more than 10 kinds, and are also increasing, and 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 and so on all announced support linux! Merchants to join to make up for the lack of pure free software and development barriers, Linux can be quickly popularized.
1, how to quickly master Linux?
The method is to do more hands, brain, learn to often compare with Windows. It is recommended that you install Redhat Linux First, and then practice how to configure it, how to use Linux commands, how to operate under the X-windows, how to install the application software under Linux, how to access the Internet under Linux, edit documents, play multimedia files, play games and so on.
There is only one way to get started, and that is to do a lot of hands-on work and see if you can do it.
2. What are the similarities and differences between Linux and Windows?
Windows is a graphical interface, Linux similar to the previous DOS, is a text interface, if you run the Graphics interface program X-windows, Linux can also display a graphical interface, there are Start menu, desktop, icons and so on.
Windows has MS-DOS, in which the computer is operated by entering a DOS command, and Linux is similar to WINDOWS, and there are commands that Linux, if not executed after X-windows, will be in the command mode and must be ordered to operate the computer. In addition Linux also has a lot of application software, installation run these software, you can edit the documents on Linux, pictures, play games, Internet, play multimedia files and so on.
However, the Linux partition format and directory structure, unlike Windows, the application installation methods are different.
3, installation of Linux considerations
Before installation, determine which partition the Linux is installed on, and Linux also has system partitions and swap partitions (Windows-like virtual partitions, or swap files) two partitions. Because Linux supports a different partition format than Windows partition format, if you install Linux, Windows can continue to use, Linux should be installed on the hard disk partition of the last extended partition, and then Linux's swap partition must be guaranteed 60MB, System partitions to ensure that at least 240MB, in addition to gather good PC hardware before installation information, especially display information, which will directly determine your installation of Linux, the use of graphical interface program effect; Please note the case when you enter a command in the installation and use.
4, master the directory structure of Linux
Linux has a different directory structure than Windows and does not see Linux directories under Windows, and in turn, Linux does not see directories under Windows. The meaning of each directory under Linux is as follows:
Directory name meaning
/vmlinuz the system kernel is stored in this directory
/bin a common command for Linux in this directory, in some versions the same directory as the root directory.
/boot This directory is stored in the system to start with the program to use, when using Lilo to boot Linux, you will use some of the information here
/dev This directory contains all the external devices used in the Linux system, it is actually access to the ports of these external devices, you can access these external devices, and access to a file or a directory without distinction. For example, in the system type "Cd/dev/cdrom", you can see the files in the CD drive, type "Cd/dev/mouse" to see the mouse related files.
/cdrom This directory is empty when you just installed the system, you can hang the optical drive file system in this directory, such as "Mount/dev/cdrom/cdrom"
/etc
This directory holds 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 user information, etc.
/sbin This directory is used to store system administrator's system management programs.
/home If you create a user named "XX", there is a corresponding "/home/xx" path in the/home directory that holds the user's home directory.
/lib This directory is used to store system dynamic connection shared libraries, and almost all applications use the shared library under that directory.
/lost+found the directory is empty in most cases. But some files are temporarily stored here when there is a sudden blackout, or when the shutdown is abnormal.
/mnt This directory is also empty in general, you can temporarily hang another file system in the 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 Superuser, this is the home directory of the Superuser.
/tmp is used to store temporary files generated by the execution of different programs
Many applications and files for/usr users are stored in this directory
5, the common command of Linux
If you encounter a command that is not used in Linux command line mode, you can get help with the command by playing "man [command]", and if you want to know what parameters a command has, you can hit command-help to get it.
Note: In Linux, the parameter input form and DOS are not the same, after the command should play a space, and then hit "-", and finally with 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 of the commonly used parameters.
Command parameter meaning
Ls
-a lists the hidden files in the system, and the hidden files under Linux are represented by the format of the file name, unlike DOS, which is represented by file attributes, that is, as long as the file is "." Begins, then it is an implied file.
-L is a long list. is to list all the information for the file or directory, one file for a row
Equivalent to Dos under the dir command, is the column file List command.
CD and DOS CD-like, convert directory commands. Note: Linux to go to the parent directory to play "CD ..." Instead of a Dos "CD ...", a space after "CD"
PWD lists the current directory command, which is equivalent to a CD command with no parameters in DOS. For example:
[Root@ttqq bin]# Pwd/usr/bin [root@ttqq bin]# This means that it is currently under the "/usr/bin" directory.)
Mkdir
-M mode represents the default directory mode when creating a directory. This is DOS and Windows does not have the function, mainly about the issue of permissions.
Create a new directory that corresponds to the DOS MD command. Generally used mkdir [dirname]
RmDir deletes the 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, adding functionality equivalent to the copy file1+file2 of DOS, 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, you can use the more command
More split-screen display file content, and DOS under the more similar command, but it can be used with other commands. such as: Cat/home/eec/myfile | More
Cp
-R corresponds to Dos xcopy/s. Used to copy all subdirectories and file copy files in a directory, equivalent to DOS copy, using the same method as under DOS copy.
=======================================
System installation: Linux Quick Start
Many beginners feel that Linux operating system is difficult to use, is the basic operation of Linux and the DOS operating system similar to the operation compared to the following, so that you can get started as soon as possible
[First, basic knowledge]
1, [System Installation]
Linux installation, using the tab, arrows, spaces, carriage return and other keys to make a choice. Linux is typically installed under a separate partition, and it is best to install the last partition on the hard disk to avoid errors in the registry and shortcut paths in the Windows system. After the final 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 greater than 8G, your Linux root partition should be installed in the first 8G (Linux Root partition terminates sector <1023 cylinder). Native partitions 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 installation to collect your hardware information such as: CPU, Memory, monitor, video card, mouse, keyboard and so on. Linux version has a lot of, and constantly updated, according to the prompts to install generally can be successfully completed.
2. [Login Entry]
Default installation, after startup in the presence of Lilo boot: After entering Linux (or enter), Linux starts to start, when a login prompt login:, enter the username, then the password prompt password: Enter the password. Access to the appropriate user environment. such as input: root, and its password, you can enter the Superuser environment #, enter a different user name and password, you can enter the user environment $ (of course, due to the version of the difference may be%, etc.).
3. [Shutdown system]
At the root user prompt, enter halt (immediately shut down) or shutdown [TIME] (delay time to shut down, after giving each user a warning of how much time will be shut down at a certain time, the computer will perform a series of shutdown work, and when system halt finally appears, Indicates that the power supply can be turned off. Non-superuser needs to exit the operating environment with the Exit command, and then use Superuser: root to log in to perform the shutdown operation.
4. [Note]
Not exactly the same place as DOS:
DOS Linux Notes
Command line letters are case-insensitive case sensitive in Linux, Superuser's system prompt is #, the average user's system prompt is $, and the normal user's system prompt can be changed as DOS. Wildcard characters in *,? and DOS are the same meaning, [] is to include only the symbols in parentheses, consecutive symbols can be "-" connected to the end of the symbol instead, such as [12345678] may be replaced by [1-8], [Abcdefijk] available [a-fi-k].
Path Separator/
Prompt > #, $
Wildcard characters *,? *、?、[]
5. [File Type]
Unlike DOS and Windows, in a Linux system, directories and devices are treated as files, and there are four file types: ⑴ ordinary files, which are commonly referred to as files, are represented by a symbol "-" before the beginning of a long list of directories. The ⑵ directory file, which we usually call the directory, is represented by the first letter "D" in the long list way. ⑶ character device files, such as displays, printers, terminals, and so on, are represented 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 represented by a letter "B" before the beginning of a long column directory. When using a long Format Column directory command ls-l in Linux, for example:
-rwxrw-r--5 User Group 1089 Nov 1998 filename
Access Rights user group name section last modified time file name
DOS under the filename is 8.3 format, WINDOWS95 began to support long file names, Linux support long file names. In DOS, the extension is COM, exe or BAT file is an executable file, but in Linux file types can only be known through file properties, with the command ls–f can be divided into directories and files, after the "/" symbol of the directory, after the "*" Symbol for the executable, with ls– AF lists all the files and directories, including hidden files and directories, with the filename "." The beginning is the hidden file.
6, [Read permission]
In Linux, where the owner of the file is called the owner, and other users are referred to as the same group, other people, in order to ensure the security of each user's files, Linux inherits the UNIX approach, by setting access permissions, restricting the arbitrary access of some users to the file. There are three levels of access rights: Read Right R, write right W, executive right x. A total of nine characters in the access order are: Owner, same group, other person. In the above example, respectively, the owner of the document has read and write rights and enforcement rights, the same group of people have read and write rights to the document, others have only read the document right.
7. [Use Help]
In Linux, you can get the online Help for the command by simply calling the man command on the command line (you want to see the commands for help). Man has its own command, usually composed of a single key, press SPACEBAR and F key will turn to the next page, press B to turn to the previous page, press Q key to exit man, back to the command line.
[II, File management and directory operations]
1, [File management]
Features DOS Linux notes
Display file content type, more cat, more type, cat is all show, more is pagination display
Copy file copy CP
Moving the file and renaming the move MV
Delete Files del, erase RM
Printing files Print lpr
2. [Directory operation]
Features DOS Linux notes
Column directory and file dir/option ls– option in Linux cd/is to return directly to the directory at logon rather than the root directory
Displays the current directory CD pwd
Change Working directory CD directory cd/directory
Establish directory MD, mkdir mkdir
Delete Directory Rd, RmDir rmdir
Directory rename move MV
Copy directory xcopy copy
It is said that many DOS commands are borrowed from UNIX, and Linux has developed from UNIX, so the format of DOS and Linux commands are very similar, but the functions of Linux commands more powerful, the options, parameters have a greater difference, the use of the specific help commands.
[Third, the use of external memory]
In Linux generally cannot directly access floppy disk, other hard disk logical partitions, CD-ROM, etc., in Linux they are considered files, before use must use Mount command mount to load them into the/MNT directory of the system, after the end of the use will be unloaded. The command format is as follows:
Mount–t file system type device name mount directory
The common file types are:
Msdos DOS Partition files
VFAT DOS partitions that support long filenames
EXT2 Linux File system
Swap Linux swap partition or swap file
iso9660 install 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, and so on, the floppy disk is generally/dev/fd0 FD1, hard disk is generally/dev/hda HDB, hard disk logical partition General HDA1 Hda2 ... And so on, the disc is generally/dev/hdc. In general before loading to create an empty directory in the/dev/mnt directory (the name of the proposed), such as floppy disk can be floppy, hard disk partition for its disk Furu C, D, etc., CD-ROM can be CD-ROMs, individual use examples:
mount a floppy disk in mddos format: mount–t msdos/dev/fd0/mnt/floppy
Load a floppy diskette in Linux format: Mount–t ext2/dev/fd0/mnt/floppy
Hard disk partitions loaded in WINDOWS98 format (c disk): Mount–t vfat/dev/hda1/mnt/c
Mount a CD: Mount–t Iso9660/dev/hdc/mnt/cd-rom
This directory can be manipulated when the mount is complete. Before using the new floppy disk and CD must exit the directory, use the uninstall command Umount Uninstall, you can use the new floppy disk and CD-ROM, otherwise the system will not recognize, the CD before unloading is not a light drive panel eject key exit.
The above is only the basic knowledge of Linux, but I believe you have quickly entered the door of Linux, further in-depth study of other Linux knowledge should not be a problem.

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.