Common UNIX Instruction set

Source: Internet
Author: User
Tags file size mkdir

1. ls

This is the most basic file instruction. LS is the meaning of "list", that is, a directory or

The contents of a certain file are displayed. If you do not follow any filename after the LS command, it will display all the files in the current directory. You can also add the name of the directory or file you want to view in the back of the LS, such as

% LS/ETC

LS has some special parameters that can give users more information about the following:

-A: In UNIX if the first character of a directory or file name is ".", use LS

Will not show the name of this file, we call this type of file a hidden file. such as the tcsh of the first document. TCSHRC; If we want to see such files, we must add the parameter-A.

-L: This parameter represents the long format using LS, which can display more information, such as file access, file owner (owner), file size, last updated date, and even symbolic link's file is link that file and so on. As follows

% Ls-l

2. CP

The meaning of the CP Directive is to copy ("copy"), i.e. copy one or more files into another file or copy them to another directory.

-I: This parameter is when the file named F2 files, if the use of CP will be the original F2 content to cover up the past, so before you have to cover the user must first ask. The copy action is performed if the user's answer is y (yes).

-r: This parameter is used for recursive replication, a whole subtree can be copied to another directory.

3. MV

The meaning of MV is move, which is mainly to change a file name or to another directory. Like CP, it also has

Three kinds of formats:

There are two parameters of MV,-F and-I, of which the meaning of-I is the same as in CP, which is the meaning of interactive inquiry. And-F for Coercion (force), that is, whether or not there is a file with the same name, anyway, I just want to move over, all the other parameters encountered-F will be invalidated.

4. RM

The meaning of RM is remove, which is the instruction used to kill a file. A file that's been killed in Unix will not be able to be saved in a DOS as well unless the system happens to have backups. So users should be particularly careful when doing RM actions.

-F: Will cause the system to not raise any warning messages when it is deleted.

-I: Ask if you want to remove the file before you remove it.

-R: Recursive deletion.

5. mkdir

mkdir is an instruction that allows users to create a directory. You can use it under a directory

Midir to create a subdirectory, the use of the method is needless to say it!

6. ChDir (CD)

This is used by the user to transfer the working directory.

ChDir dirname

So you can move the current directory to the DirName directory. or use "chdir." To move to the previous level directory.

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.