Basic use of the command line (file)

Source: Internet
Author: User

One, the file Operation command
1. Command name: Touch (create an empty file or modify the file time) Command path:/bin/touch Execute permissions: All user function Description: Create an empty file or modify the file time using: Touchfile name
2. Command name: Cat (View file contents, from beginning to end)command path:/bin/catExecute permissions: All usersfunction Description: View the contents of the file, from beginning to endHow to use: Cat [-n] File name- NList Line Numbers
3, command name: More (split screen display file content)command path:/bin/moreExecute permissions: All usersfunction Description: Split screen display file contentsHow to use: morefile name
Space: Page DOWN    B: Page UpQ: Exit
4. Command name: Head (show file header)tail (show end of file)command path:/usr/bin/headExecute permissions: All usersfunction Description: Displays the contents of the header section of the fileHow to use:Head- NNumber of rowsfile nameSpecify the first few lines of the file to displayHead- N -file nameHead-20file name
C and L are lowercase (write size for display effect)Ctrl + Cforced terminationCtrl + LClear Screen
5. Command name: ln (linked file)Command English original meaning: linkcommand path:/BIN/LNExecute permissions: All usersfunction Description: Link file
similar to shortcuts in WindowsNew connection, use different hard disk location to modify a file, both change delete source file, soft connection cannot open ln- Ssource Filetarget fileThe file name must write the absolute path
Ii. commands that can be manipulated by files and directories
RM (delete directory or file)Command name: RM Command English original: remove command path:/BIN/RM Execute permissions: All Users
Rm-RF    Catalogue        Delete files and directories- R                        recursive, deleting directories    - F                    forcing
cp (copy directory or file)command name: CPCommand English original: Copy command path:/BIN/CP Execute permissions: All user syntax: CPsource FileTarget LocationFunction Description: Copy directory example: $ cp    -RP[Original file or directory] [destination directory]              - R    Copy Directory                - P     Joint file attribute replication            - DIf the source file is a linked file, copy the link property             -Aequivalent-pdr
CPAA/tmp/        formerly copiedCPAA/tmp/bbRename Copy
MV (cut or renamed)Command name: MV Command English original: Move command path:/BIN/MV Execute permissions: All Users
Mvsource FileTarget LocationMV/ROOT/AA/tmp/    CutMVAABB                renaming



















From for notes (Wiz)

Basic use of the command line (file)

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.