Basic operational commands for Linux files

Source: Internet
Author: User
Tags bz2 gz file

File Class Operation command:

Touch 123 "Create File"
CP file name-directory name "copy files to the specified directory"
Cp-r Directory Name-directory name "copy directory to specified directory"
Cp-p "Keep the properties of the original file unchanged" (Verify: Normal user login Create file,
Copy it to/root with the CP command in Cp-p and Ls-l view)
MV file name-directory name "move file to specified directory"
MV Original file name-new name "Change Name"
RM file Name "Delete file"
Rm-r directory Name "Delete Empty directory"
RM-RF Directory Name "Force Delete"
Find/root-name 6 "Find a file of the specified name in the specified directory"
Find/root-name ' *.txt ' "to find files with a. txt extension in the/root directory"
Find/root-type d "Looking for file types in the/root directory is a directory file"

Cat file name "Quick View File Contents"
More filename "Paging through file contents"
Less file name "paginated Display and controllable"
Heat file name "View Top 10 pages"
Tail file name "View after 10 night content"
Create a soft link
Ln-s/home/abc/ab/a/root/cc
"Create a link in the/root directory called CC, which links to/home/abc/ab/c
So create a file to the/ROOT/CC directory, actually create the file under/home/abc/ab/c "

Shortcut keys
Ctrl+u emptying to the beginning of the line
Ctrl+k empty to end of line
Ctrl+l Empty the entire screen
CTRL + C ends the currently edited command
CTRL + A cursor moves to the beginning
Ctrl+e cursor moves to end of line
CTRL + LEFT or RIGHT ARROW key once a word
Ctrl+w Delete a previous word
Ctrl+d equivalent to exit

WC statistics
Wc-l count rows
Wc-w count the number of words
Wc-c Statistics bytes
gzip-9 file "compressing files to. gz Files"
wc-c filename "Viewing file bytes"
gzip-d file "File extract"
Wc-c file name "To see if the file is unzipped back"
bzip2-9 file "compress files into. bz2 files"
bzip2-d file "Unzip the file"

tar [options] File name original file name after package
Tar-c "Create a package file in. tar format"
Tar-f "means using an archive file"
Tar-t "Viewing files within a package"
Tar-x "Unpack package files in. tar format"
Tar-v "Output Details"
Tar-z "Call the GZIP program for compression or decompression"
Example: TAR-CZVF tar.gz File File
Tar-j "Call bzip2 program for compression or decompression"
Example: TAR-CVJF tar.bz2 File File

VIM "Text Editor"
I "Enter input mode"
ESC key "Return to command mode"
shift+: "Enter the last line mode"
"Enter WQ in last line mode to save Exit"
"Enter q! in the last line mode Do not save Exit "

Basic operational commands for Linux 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.