
linux
文章平均质量分 56
空~自由
懒虫,心血来潮更一下
展开
-
执行shell脚本出错:No such file or directoryc/sys/vm/drop_caches
,在 Linux 中被识别为。有可能是由于编码问题导致的。说明文件格式需要转换。脚本文件可能包含 。,导致路径被截断。原创 2025-03-24 00:30:00 · 174 阅读 · 0 评论 -
centos7配置 SFTP(限制指定用户访问指定目录)
确保您已经安装了OpenSSH服务器和vsftpd软件包。如果没有安装,可以使用以下命令进行安装。这样就可以对/home/oss/files/device目录进行读写,文件上传等操作。如果想要在该目录下执行写操作,则再新建目录,并授予当前登录用户的权限。禁用sftpuser用户的SSH登录,以确保只能通过SFTP访问。可以使用以下命令来查看系统中的有效用户和组。创建一个新的系统用户,并设置其密码。编辑OpenSSH服务器的配置文件。原创 2023-09-18 19:54:51 · 1543 阅读 · 0 评论 -
Centos7 python2.7误删重装
1、查看系统内核cat /etc/redhat-release2、彻底卸载python2rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps #强制删除已安装程序及其关联whereis python |xargs rm -frv #删除所有残余文件 ##xargs,允许你对输出执行其他某些命令3、卸载yum由于yum会依赖python2,python2误删,导致yum不可用,不可用了就先删掉,以防依赖出错#删...原创 2021-09-06 21:02:33 · 589 阅读 · 0 评论 -
centos7ntp时间同步和时区设置
1、timedatectl查看时间各种状态:Local time: 三 2021-04-21 00:01:05 CST Universal time: 二 2021-04-20 16:01:05 UTC RTC time: 三 2021-04-21 00:01:05 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: noNTP synchronized: noRTC in local TZ: yes.........原创 2021-04-20 16:38:45 · 4336 阅读 · 0 评论 -
centos7:无法分配内存 (errno=12)
启动项目报错:OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000f5a9b000, 66166784, 0) failed; error='无法分配内存' (errno=12)部分日志内容:## There is insufficient memory for the Java Runtime Environment to continue.# Native memory allocation (mmap) f原创 2020-12-09 17:14:50 · 12556 阅读 · 0 评论 -
Linux下的.sh文件在windows下修改后无法执行
使用 vim 编辑文件,在命令模式下使用set ff查看文件格式(doc 或 unix);如果为 doc,则使用set ff=unix将文件格式设置为 unix 即可解决上述问题。在vim/vi中,输入:set ff=unix,同样也是转换成unix的格式。步骤如下:1. 首先要确保文件有可执行权限#sh>chmod a+x filename2. 然后修改文件格式#sh>vi filename3. 利用如下命令查看文件格式:set ff 或 :...原创 2020-06-30 21:49:45 · 681 阅读 · 0 评论 -
centos7开放端口
1.查看防火墙是否开启:systemctl status firewalld从上面可以看出是启用状态;对防火墙启用/禁用的基本操作命令如下:启动: systemctl start firewalld关闭: systemctl stop firewalld查看状态: systemctl status firewalld开机禁用 : systemctl disable firewalld开机启用 :systemctl enable firewalld2.获取所有...原创 2020-06-01 11:02:49 · 247 阅读 · 0 评论