Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the Linux commands that programmers must have?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about what Linux commands as programmers must have. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Find File command:

Find /-name name.txt looks for the name.txt file in the / directory by name.

Find. -name "* .xml" recursively finds all xml files.

Find. /-size 0 | xargs rm-f & Deletes files with zero file size

Ls-l | grep '.jar' to find all JAR files in the current directory

Grep 'test' d * displays the lines that contain tests in all files that start with d.

Grep 'test' aa bb cc displays the lines that match the test in the AA,BB,CC file.

Grep'[a murz] {5}'aa displays all lines that contain at least five consecutive lowercase characters for each string.

two。 Copy file command:

Cp source dest copy Fil

Cp-r sourceFolder targetFolder recursively copies the entire folder

3. Package and compress file commands:

Bunzip2 file.bz unzips a file called file.bz'

Bzip2 file compresses a file called 'file'

Gzip-9 file1 * degree compression

Rar a file1.rar test_file creates a package called 'file1.rar'

Rar a file1.rar file1 file2 dir1 compresses both 'file1',' file2' and directory 'dir1'

Rar x file1.rar decompress the rar package

Unrar x file1.rar decompress the rar package

Tar-cvf archive.tar file1 creates an uncompressed tarball

Tar-cvf archive.tar file1 file2 dir1 creates an archive file that contains' file1', 'file2' and' dir1'

Tar-tf archive.tar displays the contents of a package

Tar-xvf archive.tar releases a package

Tar-xvf archive.tar-C / tmp releases the package to the / tmp directory

Zip file1.zip file1 creates a compressed package in zip format

Zip-r file1.zip file1 file2 dir1 compresses several files and directories into a package in zip format at the same time

Unzip file1.zip unzips a package in zip format.

4. Create directory command:

Mkdir newfolder

5. View files, including hidden files

Ls-al

6. View the current working directory

Pwd

7. Delete directory

Rmdir deleteEmptyFolder delete empty directory rm-rf deleteFile recursively delete everything in the directory

8. Move Fil

Mv / temp/movefile / targetFolder

9. Rename command

Mv oldNameFile newNameFile

10. Switch users

Su-username

11. Modify file permissions

Permissions for chmod xike file.java / / file.java-rwxrwxrwx,r for read, w for write, x for executable

twelve。 Start tomcat

Go to tomcat's bin directory, nohup. / startup.sh & tail-f.. / logs/catalina.out, tail-f.. / logs/catalina.out and view the tomcat startup log.

Thank you for reading! This is the end of this article on "what are the Linux commands that programmers must have?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report