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

Summary of commonly used commands in linux

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

Share

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

This article mainly explains "the summary of common commands in linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn the "summary of common commands in linux"!

Man looks at the detailed explanation of the command and man it as long as he thinks which command is not clear.

Man ls

Ln creates a linked file

Ln-s sourceName destName

Ls lists files

-l: display line by line and list detailed attributes

-a: list all files, including. Hidden file at the beginning

Ls-lqt / bin

Cat reads text content

-n: displays the line number

-b: displays the line number and ignores blank lines

Cat-n 1.txt

Wc: count

-l: number of rows

-w: number of words

-c: number of characters

Wc-l file1 file2. You can count multiple files.

Cp copy file directory

-I: interactive mode, if the target file exists, ask whether to overwrite

-r: copy the directory

Cp file1 file2 file3.... Dir means to file1,file2... Copy to dir

Cp-r dir1 dir2 dir3... Dirn will dir1, dir2,dir3... Copy to dirn

File view file type

File test.sh

Mv move files, change file name

-I: interactive mode, if the target file exists, ask whether to overwrite

-r: move the directory and change the directory name

Rm deletes a file

-I: interactive mode, asking whether to delete

Rm-r dir1 dir2 dir3... Multiple can be deleted

Mkdir create directory

-p: parent, if the parent directory does not exist, create a parent directory

Mkdir-p test/test

Rmdir delete directory

Equivalent to rm-r

Rmdir dir1 dir2 dir3....

Rm-r dir1 dir2 dir3....

Chmod change permissions

Chmod-R 777 DIR changes the permissions of all files in the directory to 777, which must be-R

Permissions-rwxrwxrwx

421421421

The first-indicates that the file type is a normal file

The next three represent owner permissions

The next three bits represent group permissions

The last three represent other user permissions

If a permission is not assigned, it is indicated by -. -rwxr--rwx indicates that the group does not have write and execute permissions

File plus night has executable permission, but indicates whether it is allowed to find files in this directory.

Chown changes owner

Chgrp change group

Command &

Add a & after the command to indicate running in the background

Find. -name "* .sh" &

Fg puts the background process on the foreground

Fg 1 put the first job in the background to the foreground

Bg

Put the foreground process in the background

Jobs

Show background or suspended processes

Ps

Show all processes

Ps-f displays complete information, including cpu time, start time.

Kill

-9 forced termination

More displays text content, one screen at a time, press the space to continue

Find /-name "* .sh" | more

Tail starts to display the following content from the specified location.

Tail-f server.log is used to view logs while running on server

Tail-10 dos2unix.sh check the last 10 lines

Head

Corresponding to tail

Sort sorting

-r reverse order

-d dictionary order

Ls | sort-r

Tr character substitution

-d delete the specified character ls | tr-d 'log'

Ls | tr'd''g'to change d to g

At time date job

Timing scheduling

Compress

-f compressed file

-v shows the compression scale

Compress-vf project.tar will generate project.tar.Z and project.tar will be deleted

Uncompress

-f unzip the file

-v shows the compression scale

Uncompress project.tar.Z will generate project.tar and project.tar.Z will be deleted

Tar

-c create a new document

-x unpack

-v displays the name of the file being processed

-f replaces the default file name

Tar-cvf project.tar project/* packages all the files in the project directory

Tar-xvf project.tar

At this point, I believe you have a deeper understanding of the "summary of common commands in linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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