Linux system command notes

Linux system command notes

This article describes the linux system commands. Share with you for your reference, the details are as follows:

1. Linux system directory

/bin system command directory
/dev Device Directory
/home Each system user has a directory under home.
Each user will automatically log in to this directory after logging into the system.
The root user will be in the /root folder.
/lib system library directory
/media multimedia directory
/mnt Mount directory
/proc system memory directory
/sbin Superuser system command directory
/tmp System temporary files
/var Directory for files that change frequently (such as databases, logs)
/boot system startup file directory
/etc Configuration File Directory
/lost+found Lost and found
/opt Directory where third-party applications are located
/root superuser directory
/usr System application directory

2. Commonly used shells

1. What is a shell?

Shell is a set of commands

2. Linux command syntax

Prompt> command name-option parameter

3. Common commands

ls View all files in the directory
-l View file details
-a View all files, including hidden files
pwd View the current working path
cd switch working path
clear
logout
shutdown
-h number of minutes to shut down after
-r number of minutes to restart
-k warning
-c cancel shutdown
halt Shut down immediately
reboot Restart immediately

*ctrl+alt+F(1-6) to the character interface, ctrl+alt+F7 to the graphical interface.

VI Editor

1. What is VI?

Visual interface

2.vi operation mode

1) Command mode
After opening a file, it is in command mode by default. You cannot edit files in command mode.
2) Input mode
Press i in command mode to enter input mode to facilitate editing file contents
3) Last line mode
After editing the content, press the ESC key to enter the command mode, and then press: to enter the last line mode

3.vi command syntax

1)vi filename edits the file. If the file does not exist, it will be created.
2)vi + filename opens the file and positions the cursor on the last line.
3)vi +n filename opens the file and positions the cursor on line N.
4)vi +/string filename Open the file, search for keywords and highlight them, press n to jump.
5)vi filename filename Edit multiple files, enter the next file: n, enter the previous file: prev

4. vi shortcut keys

i Enter content before the cursor and enter input mode
a Enter content after the cursor
esc Enter command mode
yy copy a line
dd deletes a line
p Paste
: Enter last line mode
:Number The cursor is positioned on the specified line
:w save
:q quit
:x Save and exit
:set nu display line number
:set nonu cancel line numbering
:w! or q! Force save or force exit
/keywords Search for keywords and highlight them

5. Install vi software<br>

rpm: implement software installation, uninstallation, upgrade and query
-q query
-a all packages
-e delete
-i Install
-v shows progress
-h Display with #

1) Check whether the vi software is installed

rpm -qa|grep vi

2) If already installed, delete

rpm -e package name

3) Mount the second disc

eject Eject the CD-ROM drive

mount -t auto /dev/cdrom /mnt/cdrom

Mount the cdrom to the cdrom under mnt. If it prompts that cdrom does not exist, then mkdir /mnt/cdrom

This way you can access the CD contents under /mnt/cdrom

umount /mnt/cdrom

Unmount the cdrom

4) Find the installation package rpm and install it

rpm -i installation package

4. Single-user password cracking

1) When entering the system countdown, press any key to enter the following interface, then press e.

2) Then select the following option and press e to enter the following interface.

3) Add a space and single at the end, press Enter, and press b to start.

4) After entering the system, use passwd to change the password

5)Finally, reboot

I hope this article will help you maintain your Linux system.

You may also be interested in:
  • PHP programmers play Linux series nginx beginner guide
  • Nasm implements the boot code of running a self-made Linux boot disk with vmware
  • Analysis of Linux boot process
  • Linux Administrator's Guide (5) -- Booting and Shutting Down
  • Summary of Linux system user management commands
  • Summary of methods to clear cache in Linux system
  • Detailed explanation of sudo command in Linux system
  • Linux system command to delete folders and files
  • How to use the dd command under Linux system
  • Summary of ten tips for sudo command in Linux system
  • Analysis of Linux boot system methods

<<:  Summary of some small issues about MySQL auto-increment ID

>>:  Vue.js implements timeline function

Recommend

A brief analysis of MySQL cardinality statistics

1. What is the cardinality? Cardinality refers to...

How to set npm to load packages from multiple package sources at the same time

Table of contents 1. Build local storage 2. Creat...

Using js to achieve the effect of carousel

Today, let's talk about how to use js to achi...

MySQL Query Cache and Buffer Pool

1. Caches - Query Cache The following figure is p...

Basic concepts and common methods of Map mapping in ECMAScript6

Table of contents What is a Mapping Difference be...

A brief discussion on the design and optimization of MySQL tree structure tables

Preface In many management and office systems, tr...

Common date comparison and calculation functions in MySQL

Implementation of time comparison in MySql unix_t...

Use of Linux xargs command

1. Function: xargs can convert the data separated...

Installation and configuration method of vue-route routing management

introduce Vue Router is the official routing mana...

How to clean up Alibaba Cloud MySQL space

Today I received a disk warning notification from...

...

JavaScript implements simple calculator function

This article example shares the specific code of ...

VMware and CentOS system installation method to reset the root password

Today's Tasks 1. Choice of Linux distribution...

Detailed explanation of prototypes and prototype chains in JavaScript

Table of contents Prototype chain diagram Essenti...

How to view and set the mysql time zone

1. Check the database time zone show variables li...