当前位置:网站首页>UNIX commands often used in work
UNIX commands often used in work
2022-07-05 07:19:00 【jiankang66】
One 、 background
I have accumulated many server related commands in my work , Are commonly used , Record it and share it with you , I hope it helps .
Two 、 Common commands
1、vim Enter file , Exit edit mode , perform dd You can delete a whole line ,20dd Delete 20 That's ok
2、bash After execution , Input $? You can see the return value 0 or 1.
3、bash Add this sentence at the beginning of the script .
#!/bin/bash4、 perform bash Insufficient file prompt permission , Carry out orders
chmod +x ./ Your program 5、 When executed bash Script time , How to exit bash?
(1) Open up new cmd, perform
ps -ef|grep exportsql.sh(2) Get the port number , Execute the following command :
kill -9 pid6、 Check the size of the folder in the current directory
du -h --max-depth=1 |sort7、 Check the disk space
df -h8、 The migration file
(1)( Will remote all dbconfig.xml Download to local test Under the table of contents )
scp -P 54321 -r [email protected]:/root/dbconfig.xml /home/jiankangxu/test(2) Upload files to the server :
scp -P 22 -r D:\springdubbo20210902\nacos-server-2.0.3.tar.gz [email protected]:/nacos9、 View the server version
uname -n10、 Switch root user
sudo -s11、 Modify the permissions of all files in the directory, readable, writable and executable
chmod -R 777 /home/jiankangxu/var/atlassian/application-data/jira/data12、 Switch sub users test
su - test13、 Check which user the current user is
whoami14、 Modify the server language ,centos7 Just go to /etc/locate.conf Modify the , Execute the following command
source /etc/locale.conf15、 Check the running status of the task and the parent process number
ps -ef|grep scp16、 View directory permissions
ls -l17、 take attachments Directory move to data Catalog
mv /home/jiankangxu/var/atlassian/application-data/jira/datas/attachments /home/jiankangxu/var/atlassian/application-data/jira/data18、 The files are arranged from small to large
du -sh * | sort -nr 19、 Find files
whereis aaa.txt20、 Find out whether the system is installed jdk
rpm -qa | grep jdk21、cenos Unzip the file to the specified directory
sudo tar -xzvf j.tar.gz -C java22、cenos Extract the file to the current directory
sudo tar -zxvf a.tar.gz23、 Return to root
cd /24、 Add users
useradd ftpuser25、 Modify file permissions, user names and user groups are ftpuser
sudo chown -R ftpuser.ftpuser ./ftpfile/26、 Change user password
sudo passwd ftpuser27、 Modify security policy
sudo vim /etc/selinux/config28、 Check the port
ps -ef | grep nginxsudo lsof -i:800029、 Kill a port
sudo kill -9 85030、 see nginx Whether to start
ps aux|grep nginx31、 View the contents of a file
cat ~/.ssh/id_rsa.pub32、 Check whether the current directory has iptables
ll | grep ipt33、 The entire directory grants a user permission
sudo chown -R geely /developer/34、 Modify the file permissions under the directory, readable, writable and executable
(1) Write
sudo chmod u+w -R /developer(2) read
sudo chmod u+r -R /developer(3) perform
sudo chmod u+x -R /developer35、 View this machine ip
ifconfig -a36、 Switch to follow the user
sudo -s37、 Back to normal users (jiankang)
su jiankang38、 Use find Fuzzy matching names contain kafka File path
find / -name "*kafka*"39、 View the file permissions
ls -la40、 Give all users file executable rights
chmod a+rwx swapfile41、 View file properties
lsattr42、 Delete file attributes
chattr -i filename43、 Check the port
netstat -tunlp44、 See the specific port
netstat -tnlp | grep :8045、unix Get the full path of the file
readlink -f file.txt46、 Delete directory
rm -rf mysql47、 View remaining memory
free -h48、 View the current directory file size
ls -lht49、 Download the file
sudo wget --no-check-certificate https://dlcdn.apache.org/kafka/3.0.0/kafka-3.0.0-src.tgz3、 ... and 、 summary
The above are some commands commonly used in work , Record it here , I hope I can help you , If you think it's good , Welcome to wechat search java Basic notes , Relevant knowledge will be continuously updated later , Make progress together .
边栏推荐
- 并发编程 — 死锁排查及处理
- SOC_SD_CMD_FSM
- Xiaomi written test real question 1
- Altimeter data knowledge point 2
- Ros2 - common command line (IV)
- 第 2 章:小试牛刀,实现一个简单的Bean容器
- 剑指 Offer 56 数组中数字出现的次数(异或)
- Today, share the wonderful and beautiful theme of idea + website address
- GPIO port bit based on Cortex-M3 and M4 with operation macro definition (can be used for bus input and output, STM32, aducm4050, etc.)
- What is sodium hydroxide?
猜你喜欢

Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘

C learning notes

SOC_SD_DATA_FSM

Tshydro tool

Ros2 - install ros2 (III)

SD_CMD_SEND_SHIFT_REGISTER

【软件测试】04 -- 软件测试与软件开发

And play the little chestnut of dynamic agent

Matrix and TMB package version issues in R

Ros2 - first acquaintance with ros2 (I)
随机推荐
docker安装mysql并使用navicat连接
【软件测试】04 -- 软件测试与软件开发
Don't confuse the use difference between series / and / *
[software testing] 02 -- software defect management
基于Cortex-M3、M4的GPIO口位带操作宏定义(可总线输入输出,可用于STM32、ADuCM4050等)
第 2 章:小试牛刀,实现一个简单的Bean容器
2022.06.27_每日一题
An article was opened to test the real situation of outsourcing companies
Target detection series - detailed explanation of the principle of fast r-cnn
Literacy Ethernet MII interface types Daquan MII, RMII, smii, gmii, rgmii, sgmii, XGMII, XAUI, rxaui
Database SQL practice 4. Find the last of employees in all assigned departments_ Name and first_ name
Install deeptools in CONDA mode
Docker installs MySQL and uses Navicat to connect
D2L installation
Ros2 - configuration development environment (V)
ORACLE CREATE SEQUENCE,ALTER SEQUENCE,DROP SEQUENCE
list. files: List the Files in a Directory/Folder
PHY drive commissioning - phy controller drive (II)
并发编程 — 如何中断/停止一个运行中的线程?
IPage can display data normally, but total is always equal to 0