Some basic things about Linux.

Source: Internet
Author: User
Tags temporary file storage file permissions

Learn a bit about Linux basic operations. Write here to do a little of your own summary and look back at the future.
First is a Linux system installation, here is installed Linux CentOS6.9 system, now the latest CentOS system has come 7.0, we use 6.9, why use 6.9, I do not know, you do not ask.
This is because we are learning the basics of Linux, so it is necessary to install a virtual machine on Windows, which uses VMware's virtual machines. The same virtual machine can also choose Virtusbox, where VMware because the function is more powerful.
Download a CentOS6.9 image CD file from the network, create a new virtual machine with VMware, choose a custom installation, select a classic installation, and later enter the selection hardware, where you can choose the virtual system of memory, hard disk, Processor and other hard-core data to the virtual machine is probably a 20g of hard disk is enough, memory and so do not have to choose too big, enough is good, this choice is good, because after the system is installed later can also be changed. Open the virtual machine into the installation system interface, select the language and keyboard distribution layout, the choice is English, will go to choose the time zone, select East Eight Shanghai, so you can set the time, after entering the sub-disk interface, due to the basic operation, so about three disk around is enough, the first disk select boot, It's enough to divide a 200M. The second disk chooses swap, this is when the memory is not enough to have a swap space, about 2g is enough. Fill the remaining space to the last disk. Will let set a root user's password and hostname and password, the former is the administrator, the latter is the host, choose what type of system installed, here installed desktop, this is the desktop GUI, for long-term use of windos system is a relatively good over. The system is installed so that it is ready. Make a snapshot so that you don't have to redo the system after it's broken.
You can choose to install a secure or xmanage software on your computer that allows you to perform a command-on-Linux interface on Windows.
In the interface, the first is the command prompt with the # is the current root user, with $ indicates that the current is a normal user, through PS1 This constant can change the command prompt, usually in the production environment to change this is necessary, so that the programmer can distinguish between what is being done, But since we're just using a virtual system, it's not necessary.
into the command interface, the command becomes the only way we can operate the operating system, in the Linux system, we generally difficult to manipulate the kernel files, so the designers in the outside of the kernel surrounded by a shell into the shell, our command is to execute on the shell. is divided into external commands and internal commands, the internal command is the Shell's own command, and the external command is to go through the path to the executable file command.
Proceed to a node, and then take a few simple commands: the command format is usually the commands OPTIONS ... ARGUMENTS ... Format, in the Linux system, the space case is very sensitive, so when the command is to pay attention to the place.
1, Time command, enter date to see the current system time. In general, if the connected network does not need to change the time, but if you want to change the time input date +%s
2. Some basic commands include shutdown: Halt, Poweroff, init 0 restart: reboot, init 6-f: Force, do not call shutdown-p: Switch off power off or restart: shutdown shutdown [OPTION] ... Time [MESSAGE]. General operation.
3, the introduction of a man command, this command is usually a help document, if the English is good enough to understand Linux is a great benefit, but on the Web page is a Chinese version of the link, is not recommended in Chinese, one is not helpful to study, and the other is that the Chinese document is not written in a complete.
This is the most basic command, and then the other about the operation of the command, in the default CentOS6.9 file management system, file management system name has the following items:
/boot: Boot file directory, kernel file (vmlinuz), boot loader (bootloader, grub) are stored in this directory
/bin: A basic command for all users, a program that is not associated to a separate partition, and that is used by OS startup
/sbin: The basic command of the management class, which cannot be associated to a separate partition, the program that is used by OS startup
/lib: Basic shared library files that the program relies on at startup and kernel module files (/lib/modules)
/LIB64: storage location for secondary shared library files dedicated to x86_64 systems
/etc: Configuration file directory
/home/username: Normal User home directory
/root: Administrator's home directory
/media: Portable mobile device mount point
/MNT: Temporary file system mount point
/dev: Device files and special file storage locations
B:block device, random access
C:character device, linear access
/OPT: Where to install third-party applications
/SRV: Data used by services running on the system
/tmp: Temporary file storage location
Record these or for some time do not understand the point of view back to see. Here are some simple operations commands
1, CD is to change the directory, in Linux, there are absolute paths and relative paths in two ways.
2, LS is to display all the files in the current directory. With the Ls-a command, you can view hidden files, which are usually in front of the file.
3, stat can view the file's three timestamp.
4, touch can create an empty file and refresh the file time.
5, CP is to copy files and directories, generally speaking, this command is not able to copy multiple files.
6, MV is to move and rename files and directories.
7, RM is to delete the command, generally rarely use this command, because in the Linux system is deleted is no chance to get back, so the common way is to create a garbage station and other directories, the file you want to delete to the dumpster, and then delete the selection.
8, then there are some redirects, pipelines and other commands, which will be used in the actual operation of the production environment. Piping means that the output before the pipe is the input behind the pipe.
This is the relatively simple operation of Linux, in the Linux system, the operation is the authority of the responsibility. In the ordinary user divided into the system users and landing users, the system is run by the security context. The user action computer is the operation and use of the process to operate the computer, the process on behalf of the user is running, the user's permissions are the permissions of the process.
Permissions in the metadata called mode, in fact, the user's permission to manipulate the file is divided into the following three kinds of R, W, x read and write execution. To the file, reading is to view the contents of the corresponding file, W is to modify its contents, X can draw this file to the kernel to boot into a process. Normal files If no execution command is impossible to execute, the R permission of the directory can use LS to view the list of files in the directory, all can find the mapping file from the directory, the directory's W permissions to create files in the directory and delete files, x permission can use Ls-l to view the list of files in the directory, CD access to this directory. This refers to an octal constant. R stands for 4w for 2x Rep 1
File Permissions Operation command chmod
Text View filtering
Cut intercept field-d '-F single quote is the delimiter, the bar F is the first paragraph, the head is truncated-the number represents the first line, tail means from the back intercept,-F can monitor the last 10 rows of changes.
Here a new knowledge is referred to as the regular expression (BRE), the BRE basic regular characters also have matches, character matches, number of matches \? + {n} {m,n}, location anchors, grouping, and referencing
Ere is known as an extended regular expression, ere extended: character matching. [] [^], number of matches? + {M,n}
Fgrep is a fastgrep that represents a quick match. Search for characters directly. The regular expression is not applicable.
This is all the basic Linux operation, I hope everything is good after.

Some basic things about Linux.

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.