chown

doraemon的python centos的入门(二)文件目录操作

霸气de小男生 提交于 2019-12-03 15:10:11
4 文件的操作 4.1 增 mkdir mkdir liujiamkdir liujia-{2..10} 批量创建文件夹mkdir -p a/b/c/d 递归创建mkdir -pv {s13,s14}/{ss11,ss12}/{sss11,sss12} 显示创建过程 4.2 查 tree yum install -y treetree name-L 控制显示的层数-b 值显示目录​ 4.3 删 只能删除空目录 mkdir -p liu/jia/dan/nirmdir -p liu/jia/dan/ni 文件类型:用ll查询的时候权限前面的那个字母 表示文件 d表示目录 l 表示链接 b 块设备 c 字符设备 s 表示socket套接字 4.4 链接 硬链接(硬链接就是指向源文件的内存地址,相当于python中的一个变量名) ln 源文件 目标文件 源文件发生改变,目标会发生改变 将硬盘的引用次数+1 删除 将磁盘上的引用次数-1 源文件删除对目标不会受影响 不能对目录做硬链接 不能跨越分区 软链接 相当于windows的快捷方式 ln -s 可以生成软链接 链接大小就是制定的源文件的字符数 源文件发生改变,目标会发生改变 删除 源文件删除目标会收影响 可以对目录做软链接 可以跨域分区 4.5 i/o重定向 输入 标准输入:接收来自键盘的输入 stdin 0 输出 标准输出

centos安装mysql5.6

≯℡__Kan透↙ 提交于 2019-12-03 13:10:30
环境: centos7 mysql版本: mysql-5.6.46 安装mysql5.6 # 1. 使用rz上传tar包 # 2. 校验md5值,检查是否和下载页面的md5值一致 md5sum mysql-5.6.46-linux-glibc2.12-x86_64.tar.gz # 解压 tar zxf mysql-5.6.46-linux-glibc2.12-x86_64.tar.gz yum install libaio groupadd mysql useradd -r -g mysql mysql cd /usr/local/ ln -s /root/mysql-5.6.46-linux-glibc2.12-x86_64 mysql cd mysql chown -R mysql . chgrp -R mysql . scripts/mysql_install_db --user=mysql chown -R root . chown -R mysql data # 启动 bin/mysqld_safe --user=mysql & # 关闭 mysqladmin shutdown # another start /etc/init.d/mysql.server start # stop /etc/init.d/mysql.server stop cp support

chown: Operation not permitted

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have problem where i need to set the file owner permission to different user in the system via a php script so i do this via this following command where 1002 is the user id of the system. file_put_contents($filename, $content); system("chown 1002 " . $filename . ""); however i get this error in productions server only (test server it works fine) chown: changing ownership of `/var/spool/asterisk/06h12m7.call': Operation not permitted 回答1: Since you tagged this question as Linux I'm assuming that you use Apache server. In production servers

What is the Python way for recursively setting file permissions?

一世执手 提交于 2019-12-03 07:28:20
问题 What's the "python way" to recursively set the owner and group to files in a directory? I could just pass a 'chown -R' command to shell, but I feel like I'm missing something obvious. I'm mucking about with this: import os path = "/tmp/foo" for root, dirs, files in os.walk(path): for momo in dirs: os.chown(momo, 502, 20) This seems to work for setting the directory, but fails when applied to files. I suspect the files are not getting the whole path, so chown fails since it can't find the

Apache - Permissions are missing on a component of the path

你离开我真会死。 提交于 2019-12-03 06:21:25
None of my website images are loaded, although paths are correct. In my Apache logs, I have plenty of : (13)Permission denied: [client 87.231.108.18:57108] AH00035: access to my/file/path/some-photo.jpg denied because search permissions are missing on a component of the path Within httpd.conf file : User apache Group apache All the way down to my website directory, folders are owned by apache:apache , with chmod set to 774 all the way down. SELinux boolean httpd_can_network_connect has been is On . I am using a .htaccess file to redirect my domain name to the appropriate directory. I suspect

创建用户

元气小坏坏 提交于 2019-12-03 04:28:27
查看用户 1 whoami #要查看当前登录用户的用户名 2 who am i #表示打开当前伪终端的用户的用户名 3 who mom likes who 命令其它常用参数 1 参数 说明 2 -a 打印能打印的全部 3 -d 打印死掉的进程 4 -m 同am i,mom likes 5 -q 打印当前登录用户数及用户名 6 -u 打印当前登录用户登录信息 7 -r 打印运行等级 1. 创建用户 adduser这个命令,我们很容易理解其作用,因为完全可以顾名思义:add是英语“添加”的意思,user是英语“用户”的意思,因此adduser就是用于添加用户。 1 adduser newname // 新建用户newname useradd 只创建用户,创建完了用 passwd lilei 去设置新用户的密码。 adduser 会创建用户,创建目录,创建密码(提示你设置),做这一系列的操作。 其实 useradd、userdel 这类操作更像是一种命令,执行完了就返回。而 adduser 更像是一种程序,需要你输入、确定等一系列操作 删除用户 deluser是delete和user的缩写,delete是英语“删除”的意思,user是“用户”的意思。 1 userdel newname 单单用deluser命令,不加参数的话,只会删除用户,但是不会删除在/home目录中的用户家目录

Linux命令详解 三

情到浓时终转凉″ 提交于 2019-12-03 04:23:16
Linux用户和组的属性与权限 本章结构 1.用户账号和组账号概述 2.用户账号和组账号管理 3.查询账号信息 4.查看目录或文件的属性 5.设置目录或文件的权限 6.设置目录或文件的归属 前言 在linux中一切都是文件(文件夹和硬件设备是特殊的文件),如果有可能尽量使用文本文件。文本文件是人和机器能理解的文件,也成为人和机器进行交流的最好途径。由于所有的配置文件都是文本,所以你只需要一个最简单的编辑器就可以修改。由于修改文本文件如此简单,所以Linux系统本身肯定要加以规范。这就引出了用户(组)和权限这2个概念。而这2个概念的引入,完美的保证了Linux的安全性,同时没有添加复杂性。由于一切皆为文件。所以Linux引入了3个文件来管理用户(组), /etc/passwd存放用户信息,/etc/shadow存放用户密码信息,/etc/group存放组信息,然后在文件系统中的每个文件的文件头里面添加了用户和文件之间的关系信息。 一、用户和组的信息查看 1.用户:在Linux下,用户分为三类:超级用户(root)、普通用户、程序用户。 超级用户:UID=0 程序用户:Rhel5/6,UID=1-499; Rhel7,UID=1-999 普通用户:Rhel5/6,UID=500-65535; Rhel7,UID=1000-60000 超级用户有且只有一个,且不能被代替! 匿名用户

Brew update failed: untracked working tree files would be overwritten by merge

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Trying to update Homebrew with brew update I got the following error error: The following untracked working tree files would be overwrittenby merge: Library/Formula/argp-standalone.rb Library/Formula/cocot.rb Please move or remove them before you can merge. Aborting Updating e088818..5909e2c Error: Failed while executing git pull origin refs/heads/master:refs/remotes/origin/master I found a blog post by someone who experienced a similar problem after having installed Mountain Lion (which I did this week too). He explains how he removed the

Brew doctor says: “Warning: /usr/local/include isn't writable.”

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Brew doctor says: Warning: /usr/local/include isn't writable. This can happen if you "sudo make install" software that isn't managed by Homebrew. If a brew tries to write a header file to this directory, the install will fail during the link step. You should probably chown /usr/local/include I've tried different commands to solve this but I'm still stuck here. I'm running homebrew on 10.8.2 回答1: Take ownership of it and everything in it. $ sudo chown - R $USER : admin / usr / local / include Then do another $ brew doctor 回答2: What