Basic operation under Linux 02 (file related commands) __linux

Source: Internet
Author: User
Tags chmod
1. Access to User root directory
CD ~ or CD
CD ~hadoop
Back to the original path
CD-


2. View file Details
Stat A.txt


3. Mobile
MV a.txt/ect/
Renamed
MV B.txt A.txt
Move and rename
MV A.txt. /b.txt


4 copies and renamed
CP A.txt/etc/b.txt


5.VI Undo Modification
CTRL + U (undo)
Recovery
CTRL + R (Redo)


6. Name Order set alias (invalid after reboot)
Alias ll= "Ls-l"
Cancel
Unalias LL


7. If you want the alias to restart, you still need to modify
VI ~/.BASHRC


8. Add User
Useradd Hadoop
passwd Hadoop


9 Creating multiple Files
Touch A.txt B.txt
Touch/home/{a.txt,b.txt}


10. Copy the contents of one file into another file
Cat A.txt > B.txt
Append content
Cat A.txt >> B.txt




11. The A.txt and B.txt are set to be writable by the owner and the same group to which they belong, but others are not writable:
chmod ug+w,o-w a.txt B.txt


chmod a=wx C.txt


12. All files and subdirectories under the current directory are set to anyone can read:
Chmod-r A+r *


13. Set the user owner of the A.txt to users, and the group's owner is set to Jessie:
Chown Users:jessie A.txt


14. The user of all files and subdirectories under the current directory is Lamport, and the group owner is users.
Chown-r Lamport:users *


15. Copy all Java language programs to the finished subdirectory:
CP *.java finished


16. List all files in the current directory and its subdirectories that are java.
Find-name "*.java"
Find files in the current directory with Java extensions
Find-name *.java


17. Delete files in the current directory where the extension is Java
Rm-f *.java

Related Article

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.