In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the basic knowledge about the Linux operating system. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
1. Introduction to Linux
2. Introduction to Ubuntu
3. File and directory operations
3.1 basic shell operation
3.1.1 Command parser
Essence: call the corresponding executable program according to the name of the command
The type of shell used for viewing: echo $SHELL
3.1.2 commonly used shortcut keys
Use the tab key to complete the main keyboard shortcuts such as command / directory
3.1.3 Linux directory structure
Important directory structure:
/ bin: executable system-level binary commands under the Linux operating system
/ dev: device directory
/ etc: contains information about all configurations of the current operating system user
/ home: home directory
/ lib: the library files used by the operating system and related configurations have been placed in this directory
/ media: the system mounts the directory automatically
/ mnt: manually mounted directory
/ root: home directory of root user
/ usr: unix software resource pack management directory, which stores some things under the current user
3.1.4 user directory
Absolute path and relative path
User directory
Devin: currently logged in user
Ubuntu: hostnam
~: user's home directory (host directory)
$: the current user is an ordinary user
#: superuser
3.1.5 File and directory operations
Tree: displays the current files and directories in a tree
Ls: view all files and directory information under the execution directory
-a view hidden files
-l View details.
Cd: enter the specified path (cd ~ / cd -)
Pwd: show current path
Create / delete directories, files
Cp: copy a file or directory
View the contents of the file
Ln
File and directory properties
Which: view the path where the specified command is located
3.1.6 File permissions / users / user groups
3.1.7 find and retrieve
3.1.8 installation and uninstallation of software
Online installation (preferred)
Deb package installation
Source code installation
3.1.9 disk Management
The system mounts the directory by default: / media
Manually mount the directory: / mnt
Mounting method: mount + device name + mount directory
Uninstall: when unmount is uninstalled, the user's current location must not be in / mnt (/ media) or its subdirectories, otherwise it cannot be uninstalled.
3.2 compressed package Management
Packing
Compress
3.3 process Management
Who: view the status of current online users
Ps: view the status of processes running within the entire system (ps-aux)
Kill: used to terminate the specified process
Env: view current process environment variables
Top: viewing Task Manager
3.4 Network Management
Ifconfig: get network interface information
Ping: test connectivity to the target host
-c: stop after the specified number of packets are sent
-I: set a few seconds interval to send a packet
Nslookup: the IP address corresponding to the domain name of the production server
3.5 user Management
Create a user
Sudo addusr + user name
Sudo useradd-s / bin/bash-g devin-d / home/devin-m devin
Set user group: sudo groupadd devin
Delete a user:
Sudo delusr + user name
The function of sudo usrdel-r itcast:-r is to delete the user's home directory together
Switch user: su + user name
Root user: sudo su
Set password: sudo passwd + user name
Log out login user: exit
4. Common servers
Ftp server
Install the ftp server
Sudo apt-get install vsftpd
Modify the configuration file (/ etc/vsftpd.conf)
Start the process: sudo service vsftpd restart
Data transmission
Problem: 500OOPS: vsftpd: refusing to run with writable root inside chroot ()
Solution: add a line to the configuration file: allow_writeable_chroot=YES
5 、 vim
Vim is a text editor with no menus, only commands, and many commands
There are three modes of vim
Command mode insert mode last line mode
5.1 Command mode
5.1.1 move the cursor
5.1.2 Delete and undo
5.1.3 copy and paste
5.1.4 Visual mode
5.1.5 find and replace
5.1.6 text Line Mobility and Man Page
5.2 insert mode
5.3 Last line mode
5.4 split screen operation
6 、 gcc
Gcc is a compiler. The common parameters are as follows:
-v/--version to check the version number
-O generate target file
-I specify the header file directory
-D define macros at compile time
-On optimization 0 is not optimized, 1 is the default, and 3 is the highest optimization level
7. Production and use of static library
7.1 advantages and disadvantages of static libraries
Advantages:
Convenient addressing and high speed
The library is packaged into an executable program, which can be used by publishing the executable program directly.
Disadvantages:
The code of the static library has been loaded into the executable program during the compilation process, so it is larger.
If the static library changes, the program needs to be recompiled
7.2 making and using static libraries
8. Production and use of dynamic library
8.1 advantages and disadvantages of dynamic libraries
Advantages:
The code of the shared library is loaded into memory when the executable program is running and is only a simple reference during compilation, so the code is small and easy to update (dynamic link).
Disadvantages:
Delayed binding, slightly slower
8.2 production and use of dynamic Library
9. Gdb debugging
This is the end of the basic knowledge about the Linux operating system. I hope the above content can be helpful to you and 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: 288
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.