Linux additions and deletions change

Source: Internet
Author: User

Linux additions and Deletions change command

Objective:

Now more and more people in the work of the use of Linux, its powerful features, system open source, for engineers to provide a particularly good working environment, of course, one of the main reasons in the country is free, of course, free of charge is not equal to open source,

In understanding the GPL terms
The GPL clause is to ensure that GNU software is free to use, reproduce, modify and distribute, and that all GNU software has an agreement to grant all rights to any person without limiting any restrictions to others.
3) Understanding free software means:
A) You have the freedom to run the program for any purpose.
b) You have the freedom to modify the program to suit your needs.
c) You have the right to republish the copy, either in white or at a charge.
D) You have the right to publish the modified version of the program so that others benefit from your improvements.

It is known that open source is the sharing of sources, after you can modify the original file after better improve you can profit is also possible, so open source is not equal to free.

Mentioned the most important point in the domestic free so all companies are in order to save money, all in use this creates a single door windows is not enough for you to walk in the IT industry, you need to be Linux under a system, here we recommend CentOS, It is rubbing down by the veteran server operating system Redhat. Why do you want to learn him, because at the beginning of the domestic Windows Server charges Redhat free so many companies are using Redhat. Today Redhat charges for the creation of the CentOS system at the same time. It can be said that they are a systematic difference between charging and not charging. So learning CentOS is also equivalent to learning a lot of redhat.

About the concept of roots:

Just like you drift away one day you go back to your hometown, this is you find root, in Windows you open C:/ddd/ss/aaa.exe when you step back to the C-drive is like back to the root, when you are drifting again is from the C packing directory down a layer to go.

There is only one disk under Linux so "/" is with

Rough Chat:

today for everyone to talk about the process of additions and deletions under Linux, first of all, we first familiar with the Linux interface

This is the minimized login interface

This is a graphical interface

We will only install the minimum version on the server.

In a blank area-----> right-click-------> Open in Terminal

The ability to open command mode is what we need to be in constant contact.

Re-Solution:

(i). Command mkdir

1. Command format

mkdir [Options] Directory name

2. Command options

-m=Mode

Specify access permissions for the directory, similar to chmod.

-P If the directory already exists, there is no error message. If the parent directory does not exist, the parent directory will be created. This option is commonly used to create cascading catalogs.

-V Displays the prompt information for each directory.

As an example:

There is no intermediate Directory AAA folder shown here

Here is the mandatory addition of the AAA folder is also recursive increase

(ii). Command Touch

1. Command format:

touch [Options] ... Filename

2. Command options

-A Change access time only
-C,--no-create does not create any files
-D,--date= string represents time instead of current time using the specified string
-F (Ignore)
-H,--no-dereference affects the symbolic link itself, not the destination indicated by the symbolic link
(This option is useful when the system supports changing the owner of a symbolic link.)
-M only changes the modification time
-R,--reference=file Use this FILE ' s times instead of the current time
-T STAMP use [[CC]YY]MMDDHHMM[.SS] instead of the current time
--time=word Change the specified time:
WORD is access, atime, or Use:equivalent to-a
WORD is modify or mtime:equivalent to-m
--HELP Display this help message and exit
--version display version information and exit

As an example:

Add a Aaa.txt file to the ETC folder

(iii) Delete command RM

1. Command format

RM [Options] File or directory

2. Parameter options:

-F,--force Force Delete, no matter if there are files, do not prompt

-V,--verbose detailed display of the removal steps

-i,--interactive Prompt before deleting, interactive

-r,-r,--Recursive Delete the directory, and recursively delete all directories and subdirectories in the parameters.

--HELP Display Help information

--version Output Version Information

As an example:

means to delete a folder

Plus-rf don't prompt to delete files

(iv) MV command

1. Parameter format
MV [options] source file or directory destination file or directory

2. Parameter options

-I: Interactive mode operation. If the MV operation will result in overwriting an existing target file, then the system asks whether to overwrite it, asking the user to answer "y" or "n", which avoids overwriting the file by mistake.

-F: Disables interactive operation. MV operation to overwrite an existing target file without giving any indication, after specifying this parameter the I parameter will no longer work.

As an example:

(1) Move all files in the/usr/udt to the current directory (".") Representation) in:

mv/usr/udt/*. Rename the file Test.txt to Wbk.txt on behalf of the current directory (2):
MV Test.txt Wbk.txt (v) CP command1. Parameter FormatCP (option) (parameter)2. Parameter Options -A: The effect of this parameter is the same as specifying the "-DPR" parameter; - D: When a symbolic connection is copied, the destination file or directory is also established as a symbolic connection and points to the original file or directory connected to the source file or directory;

-F: Forcibly copy the file or directory, regardless of whether the destination file or directory already exists;
-I: Ask the user before overwriting existing files;
-L: Make a hard connection to the source file instead of copying the file;
-P: Preserves the properties of the source file or directory;
-R/R: Recursive processing, all files under the specified directory are processed together with subdirectories;
-S: Create a symbolic connection to the source file instead of copying the file;
-U: When using this parameter, the file will only be copied when the source file is changed more than the target file is updated or the target file corresponding to the name does not exist;-S: Replaces the default suffix of the file with the specified suffix "SUFFIX" when backing up the file;
-B: The target file is backed up before overwriting the existing file target;
-V: Displays the actions performed by the command in detail.

3. An example

Copy the passwd folder to the Media folder

Copy the passwd folder to media under Rename to Passwd123

Develop:

querying all objects within a folder command: LS

The LS command format is:

LS (option) (parameter)

LS Common options

-A: All files, including hidden files, are displayed together

-A: All files, including hidden files, but not displayed. And.. These two directories

-D: Lists only the directory itself, not the archive data in the directory

-F: Direct output, no sorting (LS presets are sorted by file name)

-F: According to the file information, give additional data structure, for example: * Represents the executable file/representative directory = Socket File | represents FIFO file

-H: File capacity displayed in a human-understandable way (e.g. GB, KB, etc.)

-I: List inode numbers

-L: Long data output with more complete file information

-N: Lists UID and GID instead of user and group names

-r: Reverse sequence output of the result

-R: Listed together with subdirectory contents

-S: Sort by file size, not by file name

-T: Sort by time, not by file name

Common commands to use:

View files under Home folder

View hidden files

View file Details

To view the date and time:

Modified Date:

View calendar:

View the stipulated date:

Let's get here.

Linux additions and deletions change

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.