Linux operation and maintenance notes (1)

Memory size: cat / proc / meminfo
cpu information: cat / proc / cpuinfo
shutdown / restart: poweroff / reboot

The tree structure of the Linux operating system:
directory == folder
cd change directory .. return to the previous directory
pwd List the current working directory
ls list List the contents of the current working directory
/ Starting path of the operating system
/ bin Ordinary users and administrators can perform command
/ sbin only the administrator can execute the shutdown command to restart
/ boot boot master boot directory separate partition boot menu kernel
/ dev device device device file storage directory
/ etc configuration files directory
/ home ordinary users Home directory
/ root Administrator's home directory
/ media Mount directory of the CD-ROM drive
/ mnt The temporary device mount directory
/ proc The data in the memory are all in the memory, the process directory
/ tmp temporary file storage directory
/ usr software installation directory
/ var variable file storage directory log file mail file

Shortcut key application:
ctrl + l clear screen
tab completion command
ctrl + c terminate command

How to distinguish the file type in the linux system:
blue directory
black ordinary file can cat
light blue symbolic link (shortcut)
black background yellow word device file hard disk sda
green with permission to execute file
red compressed package file
purple picture module file

Add, delete, and modify command:
query: check what is in the directory. View the contents of the file ls / cat
increase: create file create directory
touch file name
echo "hello"> file
mkdir directory name create directory
change: cut and copy
mv cut, rename
cp copy file copy
symbolic link ln -s absolute Path source file established link file
delete rm -f 1.txt force delete file
rm -rf class recursive delete folder delete directory

Help command word queries:
Linux Command Word Format:
command word [options] [directory or file]
1. How do I see a command word help manual
man LS
-a show hidden files
-l displays detailed information
-lh displays the file size
- R recursive display

Commands that come with the internal command command interpreter help cd Commands that come with
external commands installed by third-party software basically have help manual

Compression and decompression
create a 100m file / tmp directory bigfile
dd if = / dev / zero of = / tmp / bigfile bs = 1M count = 100
inputfile
outputfile
bs unit
count counter
compression method: gzip, bzip2
gzip compressed file
gunzip decompression Compressed file
bzip2 / bunzip2
(the red file is a compressed package)
View the directory size: du -sh directory name

How to "package" the directory
two-step compression
tool tar-> tar -cf /tmp/allfile.tar / tmp / allfile
tar -cf generate file source file
tar -xf file to be unpacked -C unpack directory
createfile
tar -tvf allfile.tar-> View the packaged information
tar -zcf Generate file source files-> At the same time package and compress tar -zxf The files
to be unpacked -C Unpack the directory-> At the same time unpack and unzip
-x Unpacking-
C Make decompression path-
z-> gzip
-j-> bzip2

vim editor (vi):
command mode-> input mode (i)
command mode-> last line mode (:)
input mode-> command mode (esc)
last line mode: wq write quit
q! exit without saving
set nu Display line number
% s / old / new / g The old in each line is replaced by the new
command mode shortcut
2yy Copy the current line and the next line
p Paste under the current line
dd Delete the current line
gg Back to the first line
G back Go to the last line
50G to 50 lines 11dd
Delete the following 11 lines
: 50,55d-> delete lines 50-55

The software installation
software classification of the Linux operating system. The characteristics
of the packaged
source package of the packaged source package
1. Provided in the form of compressed package
2. Open source

Note (source package) installed
1. Unwrap
2.// compiler can compile a path specified functions required to install
3. entering path for software decompression effect and a mounting method of
$ ./configure --prefix = PREFIX specify the installation path
$ make
$ make install
$ PREFIX / bin / apachectl start
4. make controls makefile files to be compiled sequentially
5. Copy the compiled files to the installation path
ss -antpl | grep 80

Packaged software package
installation convenient
suffix name rpm redhat
deb debian
/ media / CD / Packages
ls | grep "tree"
installation notes
1. Have I installed this software
rpm -qa all software
2. Confirm the role of the software
rpm -qpi software package
3. Confirm software installation path
rpm -qpl software package
4. Install software
rpm -ivh software package
5. Use software
tree / boot
6. Software uninstall
rpm -e tree

Uninstall the vim editor tool
1. The name of the software
rpm -qa | grep "vim"
2. Uninstall the
rpm -e vim-enhances
CD has the dependency list / repodata /

Guess you like

Origin www.cnblogs.com/mzi-mzi/p/12731549.html