Linux basic commands: (1) commands for managing files and directories

Source: Internet
Author: User
Tags touch command

1. Commands for managing files and directories:
(1) Pwd:print working directory (print working directory), when entering PWD, requires the Linux system to display the current location.
(2) CD command: The CD command is used to change the directory in which it is located. Always return to the current home directory. If you need to convert to a different directory, you need a path name. [The difference between an absolute path and a relative path: if the first character of a path is/, then this path is the absolute path] CD. Tells the system to move up to the direct ancestor directory of the directory in which the current directory is located, or a CD if you want to move the level two directory up. /..
(3) LS command: Used to view the contents of the directory.
Ls-a is used to view all files in the directory, including hidden files.
LS-L lists the details of the contents of the directory, including permissions, owner, group, size, creation date,
Ls-s Sort by File size
(4) Cat command: Displays the contents of the entire file on the screen. If the file is longer, it will be rolled over quickly. To prevent this from happening, you can use Cat Filename.txt | Less command.
(5) grep command: The biggest function is to find a specific character in a bunch of files. For example, grep print Linux,grep is case-sensitive. The band (-i) is case insensitive, for example: Grep-i Print Linux. The option [-h] not only outputs this line, but also outputs the matching file name together.
(6) Touch command: Used to create a new file. Touch file name
(7) CP command: Used to copy files. CP source Target. You can also copy files to a directory below. CP Test.txt/home/user.
(8) MV command: Used to move files [mkdir new directory as folder, rmdir Delete directory]
(9) RM command: Used to delete files.

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.