In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What is the specific basis of linux? in view of this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
View ip
Ifconfig: view virtual machine ip
Hostname-I: view ip
Environment variable configuration
Global: / etc/profile
Personal: ~ / .bash_profile or ~ / .bashrc
Effective configuration
Global: source / etc/profile
Individual:. .bash _ profile (.bashrc) or source .bash _ profile (.bashrc)
Alias
Alias: check what aliases are in the virtual machine
Set up a temporary alias:
Alias rt='cd / home/hadoop' (= no spaces before and after)
Set permanent alias: need to configure to the user's environment variable, and then execute the effective command
1. Modify the root user's profile: vi / etc/profile
two。 Add: alias rt='cd / home/hadoop' command on the last line
3. Execute the effective command: source / etc/profile
View History Command (history)
History # shows all the history
History n # shows n records
! n # execute Article n record
Pipe command (|)
There are commands on both sides of the pipe. The command on the left is executed first, and the result of the execution is used as the input of the command on the right.
How to query the port number and ip of a program (ntp)?
Netstat-nlp | grep ntp
Common commands for users and user groups:
Add user (useradd)
Query user information (id user name)
Delete user (userdel)
Add a user to a new user group (usermod)
Change password (passwd)
Switch users (su) when we use su-switch users, we also execute the user's profile (/ home/grace/.bash_profile). Generally use su-switch users.
Modify the users and user groups to which the file or folder belongs (chown)
Modify file permissions (chmod)
Sudo command to set root permissions for ordinary users
Operations on RPM packages
Rpm-qa queries all software installed on linux
Rpm-qa | grep sudo queries the sudo software installed on the operating system
Rpm-e software name (uninstall)
Rpm-e sudo deletes the sudo software and deletes the / etc/sudoers file as well, but the system automatically generates a
/ etc/sudoers.rpmsave file backup source file
The dependency problem of rpm
When you use rpm to install or uninstall software in the linux operating system, there will be
Dependency problems exist, such as: to install a software, first install b software and c software.
If you want to forcibly install or uninstall without considering dependencies, you need to use the-nodeps parameter
-nodeps do not verify package dependencies
Rpm-e-nodeps software name # forcibly uninstall the software
YUM
Yum [- y] install software name
Query
Yum list # query the software on the yum source
Yum list installed | more
Query software packages that have been installed on this computer
# yum list updates | more
Query software packages that can be updated
Unloading
Yum [- y] remove software name
-y: automatically enter yes during uninstallation
Wget downloads network resources
Wget network address
# download the files on the network and store them in the current directory
Wget-O file name network address
# after a file on the network is downloaded, it is directly stored in a file
Wget-b network address
# download network files in the background
Compression and decompression
Package Compression Command
Files packaged and compressed using tar end with .tar.gz
Compress the file:
Tar-zcvf filename.tar.gz file1 file2...
Extract the file:
Tar-zxvf filename.tar.gz
Tar-zxvf filename.tar.gz-C directory # unzipped to the specified directory
Check the hard disk, memory and system condition.
F-h check the usage of the hard drive
Free-m to view memory usage
Top to check the system status
Job scheduling (crontab)
Check which jobs are under the current user: crontab-l
Add, edit: crontab-e
Execute commands in the background
. / test.sh &
Nohup. / test.sh &-"generate nohup.out
Nohup. / test.sh > test.log 2 > & 1 &
Screen:
Screen-list View session
Screen-S xxx establishes a background session
Screen-r xxx/id enters the session
Exit session: ctrl+a+d-"[detached] detach
This is the end of the answer to the specific questions about the basis of linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
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.
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.