Linux Command Learning Notes

Source: Internet
Author: User

1. Touch filename To create a new file

2. Readlink-f filepath trace the true file path of the symbolic link

3. Id-u gets the ID of the current user, if the ID is 0, it is the root user, otherwise the general user

4. Echo $? Outputs the end state of the previous command, if it is 0, execution succeeds, otherwise execution fails

6. sudo-i Switch to root user

7. Root user, exit switch to normal user, or Su-username

8. Copying Files cp-a source destination

9. deleting files Rm-r

10. View the file Ls-l

11. View the current working directory PWD

12. Package and compress files or directories TAR-ZCVF xxx.tar.gz directory

13. Unzip the file to the specified directory TAR-ZXVF xxx.tar.gz-c directory

14. Download the entire site wget-r-p-np-k http://www.dimi.com

15. Find the location of the executable file in the directory specified by the PATH variable which executefilename

Xargs data transfer: Locate Name.txt |xargs Open, locate the file and open

17.mail Send mail: echo "This is mail content" | Mail-s "This is subject" "[Email protected]"

18. Download file from remote: scp-r [email protected]:/home/admin/file.tar.gz./file.tar.gz

19. View the specified process: Ps-ef |grep Ngix

20. Create a new File > NewFile

21. Output standard error to file command 2>error.txt

22. Use the contents of the file as command parameter < Input.txt

23. Turn uppercase to lowercase echo ' This is A TEst ' | TR ' [: Upper:] ' [: Lower:] '

24. See what Shell:cat/etc/shells are currently available on the Linux system.

25. View the current default Shell:echo $SHELL

26. Change user Default Shell:chsh-s/bin/zsh

27. View file Details: Stat filename

28. Force copying of files or directories into a directory, CP-RF SourceDir DestDir

29. View the total size of the current directory du-sh.

Linux Command Learning Notes

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.