Directory Operations

Alibabacloud.com offers a wide variety of articles about directory operations, easily find your directory operations information here online.

Linux file and Directory Operations Basic command: mkdir command

The mkdir (make directory) command is used to create a directory. For example, to establish a datal subdirectory in the system: [Root@teacher tmp] #mkdir datal

Linux files and Directory Operations Basic command: MV command

To move the file, use the MV command. Common options for MV include:-i-interaction. If the file you select will overwrite the existing file in the target, it will prompt you. This is a practical option because, like the-i option in CP, it gives you an opportunity to confirm the replacement of the saved file. f coercion. It goes beyond the interactive mode and moves the file without prompting. This option is dangerous unless you know what you're doing. Use this option carefully before you have confidence in your system. -v-details. Displays the progress of the file's movement. e.g.

Linux file and Directory Operations Basic command: CP command

The CP (copy) command can copy files or directories to other directories, just as the copy command in DOS is very powerful. When using the CP command, you only need to specify the source file name and destination file name or destination directory. Format: CP < SOURCE > < target >

Linux file and Directory Operations Basic command: chmod command

The chmod command changes the access rights of a file or directory. Let's take a look at this document first. At the shell prompt, type: LS sneakers.txt the previous command shows this file information:-rw-rw-r--1 Test test 39 March 12:04 Sneakers.txt provides a lot of detail here. You can see who can read (R) and write (w) files, and who created the file (test), the group where the owner is located (Te ...).

Linux file and directory operations basic commands: grep command

The grep command is useful for locating a specified string in a file. For example, if you want to find every place in the Sneakers.txt file that mentions "coffee," You can type: grep coffee sneakers.txt You will see each row with "coffee" in the file.

Linux file and Directory Operations Basic command: Tail command

The opposite of the head command is the tail command. With the tail command, you can view the 10 lines at the end of the file. This helps you view the last ten lines of the log file to read important system messages. You can also use tail to observe the process of updating log files. With the-f option, tail automatically displays new messages from the open file to the screen in real time. For example, to instantly observe/var/log/messages changes, type the following command at the shell prompt as root: tail ...

Linux file and directory Operations basic commands: Head command

You can use the Head command to see the beginning of a file. This command is: Head <filehttp://www.aliyun.com/zixun/aggregation/11696.html ' >name> Head is a useful command, but since it is limited to the first few lines of the file, You can't see how long the file actually is. By default, you can only read the first 10 lines of the file. You can change the number of rows to display by specifying a number option ...

Linux file and Directory Operations Basic command: Locate command

Sometimes you know that a file or directory exists, but you don't know where to find it. You can use the Locate command to search for files or directories. Using the Locate command, you will see each directory or file that includes the search criteria. For example, if you want to search for files with the word finger in all names, type: The Locate finger locate command uses a database to locate files and directories with the word finger in the directory name. This search result may include a name called ...

Linux file and Directory Operations basic command: LS command

Use the LS command to display the contents of your current directory. The LS command has many options available. To see all the options for the LS command, you can read the instructions page by typing man ls at the shell prompt. The following is a short list of some common options used with LS. Comma all. Enumerates all the files in the directory, including hidden files (. filehttp://www.aliyun.com/zixun/aggregation/11696.h ...

Linux file and Directory Operations Basic command: PWD command

The pwd command represents "Print sharable directory" (print working directory). When you type PWD, you are asking your Linux system to display your current position. For example: [Root@teacher apache]# Pwd/tmp/apache indicates that you are currently in the/tmp/apache directory.

Linux file and directory operations basic commands: CD command

cd command to change the working directory. For example: the command function CD ~ will send you back to your login directory CD/Take you to the root directory of the entire system cd/root take you to the root user's home directory; You must be a root user to access the directory Cd/home take you to the home directory where the user's login directory is usually stored on CD. Move up one level directory Cd/dir1/subdirfoo no matter which directory you are in, this absolute path will take you directly to Subdirfo ...

php directory manipulation functions (delete, create, determine)

This article is mainly introduced in php tutorial directory operations functions is_dir, rd_dir, mkdir and other commonly used directory operation function examples. * / function dir_writeable ($ dir) / / Custom function extensions to create a writable directory {if (! is_dir ($ dir)) & nb ...

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.