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

Detailed explanation of Linux command II

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

Share

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

I. Preface

Linux command displays file attributes: file attributes play an important role in the security management of the file system. The lsattr command under linux is used to view file attribute information.

Common subdirectories and functions of 1.Linux

/ root administrator home directory (host directory)

/ home the home directory of an ordinary user

/ bin command file directory for all users

/ sbin administrator command file directory

/ boot boot partition (grub boot menu, compressed kernel, etc.)

/ user application directory

/ etc configuration file directory

/ var variable length file directory (log)

/ dev device file directory (disk, optical drive, etc.)

/ tmp temporary file

/ proc hardware information (CPU, memory)

/ lib service management file (systemcrl) / lib/systemd/system

Basic operation and mode of 2.Linux

Init 0 shutdown

Init 1 single user mode (system maintenance, password cracking)

Init 2 multiuser mode without network (character interface)

Init 3 multi-user mode has a network (character interface)

Init 4 reserved

Init 5 multi-user mode graphical interface and network

Init 6 restart (reboot)

3. Common command

More: display file contents in full-screen paging mode

Cat view small files

Less views the contents of the file the same as the more command, but has more extended functions

N search from bottom to top

N look up from top to bottom

Head-n default first ten lines

Tail-n defaults to the last ten lines

Information such as the number of words in the wc statistics file

Wc-l: count rows

Wc-w: count the number of words

Wc-c: count bytes

Grep finds and displays the line containing the specified string in the file

-I ignore case when searching

-v reverses the lookup and outputs lines that do not match the lookup criteria

"^." Denote with. Start with ". $" means with. End

"^ $" represents a blank line

Gzip, bzip2: make compressed files, unzip compressed files (gunzip, bunzip usage is the same)

Tar makes archive files and releases them

Tar-c creates a compressed package

Tar-x decompression

Tar-v shows the detailed process

Tar-f execution

Tar-p retains the original permissions

Tar-t view the contents of the compressed package

Extract tar-C to the specified folder

Tar-z gzip format

Tar-j bzip2 format

Text Editor vim command

Three working modes: command mode, input mode, and last line mode

Switching between different modes:

A, insert after the cursor position

Insert in front of the cursor

O, insert under the cursor

O, insert above the cursor position

All switches between modes go through command mode.

Basic operation of vim editor

Set nu! Cancel the line number

Summary

Learning Linux commands is a difficult hurdle for us, and the only trick is that we need to knock more and practice more before we can master it skillfully. This is the basis of our study, as long as we master the commands well, we can make better progress in the next study, otherwise we will come into contact with more and more orders in the future, if we do not absorb them well now, it will be more difficult to absorb them in the future. So we must practice more!

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