chmod

How to `chmod -R +w` with Ant, files and folders?

牧云@^-^@ 提交于 2020-01-02 00:38:08
问题 I'd like to do the equivalent of a chmod -R +w foo/ in an Ant build script. So far I'm using this: <chmod perm="g+w"> <dirset dir="${basedir}/foo"> </dirset> <fileset dir="${basedir}/foo"> </fileset> </chmod> Is there a neater way to write that to include files and folders recursively ? 回答1: The following does work: <chmod file="${basedir}/foo/**" perm="g+w" type="both"/> Credits shared with the OP. See also Chmod Task 回答2: To chmod one can use exec: <exec executable="chmod" dir="${basedir}

Deploying with capistrano does ignore group setting

倖福魔咒の 提交于 2020-01-01 09:17:29
问题 In my deploy-file I set the group to www-data: set :user, "root" set :group, "www-data" so when using cap:setup I expected capistrano to chown the folders with root:www-data But all folders and files are root:root. Any ideas where this problem could come from? Information: I'm Using system-wide-rvm. 回答1: as for my understanding you should do it manually, what setup does is to use the user to login, not to set the rights to directory. I have found no group setting for capistrano, maybe you

软件测试学习LINUX常用命令

时光总嘲笑我的痴心妄想 提交于 2019-12-31 22:49:27
liunx通常用作服务器,运行服务器软件,服务器要等待,类似超市 学关键命令操作 内核,外壳 shell命令跟内核打交道 用的是发行版本,不是内核,Radhat公司的CentOS,阿里巴巴也用这个 liunx通常用来做服务器,各种各样的服务器, 用来保存文件的叫FTP服务器 用来放网站的叫Web网站服务器, 用来远程登录的叫远程登录服务器 用来做数据库系统叫数据库服务器 QQ要连腾讯电脑服务器,服务器类似超市,超市是固定的,提供服务 客户要下载,就放文件;客户要上网,就放网站 就放数据库 部署数据库,Tomcat部署,用户操作,网络操作,文件操作,创建文件夹,创建文档,打开我的电脑 跟Window一样,Window用界面,linux用命令跟cmd进去的DOS命令一样 日期命令,linux内核版本查看 管理,安装,卸载,硬件知识:网络IP地址,版本信息,硬件信息,内核信息 软件知识:电脑有多少用户,可以创建多用户,查看内容,ls可以查看文件,文件是谁,文件长度 测试之前要启动它吧,启动服务器,启动失败了,vim工具查看日志文件,配置文件,找到要命令,要改它也要命令 保存,或者退出,服务器配置信息都不知道,都登录不进去,能进行测试吗 CentOS(Community Enterprise Operating System,中文意思是:社区企业操作系统)是Linux发行版之一

初学者常用的LINUX命令

僤鯓⒐⒋嵵緔 提交于 2019-12-31 22:49:02
测试初学者常用的LINUX命令 一、常用管理命令: 1、 shutdown -h now 关机命令 2、 shutdown -r now (reboot) 立即重启命令 3、 clear 清屏命令 4、 ifconfig -a 查看所有网卡的信息(ip,MAC) 5、 ifconfig eth0 查看物理网卡信息 6、 pwd 查看当前路径 7、 cd 切换路径 8、 tab键用来路径补全功能 9、 whoami 查看当前用户 10、uname -r 查linux内核版本号 11、setup 设置命令(ip,防火墙等)。 (1)firewall configuration (防火墙设置) 12、service network restart 重启网卡 13、命令帮助:命令 --help man 命令 14、打包,解压缩: tar格式: tar -cvf 打包后名字.tar 需要打包文件名 打包 tar -xvf 打包后名字.tar 解包 tar.gz格式:tar -zcvf 压缩文件名.tar.gz 需要压缩文件名 压缩 tar -zxvf 压缩文件名.tar.gz 解压 zip格式: zip 压缩文件名.zip 需要压缩文件名 压缩 unzip 压缩文件名.zip 解压 二、文件管理命令 1、mkdir 文件夹名 创建文件夹 2、mkdir -p /first/second

Linux chmod修改文件权限

随声附和 提交于 2019-12-31 00:40:22
语法:chmod [who] [+ | - | =] [mode] 文件名 命令中各选项的含义为 u 表示“用户(user)”,即文件或目录的所有者。 g 表示“同组(group)用户”,即与文件属主有相同组ID的所有用户。 o 表示“其他(others)用户”。 a 表示“所有(all)用户”。它是系统默认值。 操作符号可以是: + 添加某个权限。 - 取消某个权限。 = 赋予给定权限并取消其他所有权限(如果有的话)。 设置mode所表示的权限可用下述字母的任意组合: r 可读。 w 可写。 x 可执行。 X 只有目标文件对某些用户是可执行的或该目标文件是目录时才追加x 属性。 s 在文件执行时把进程的属主或组ID置为该文件的文件属主。方式“u+s”设置文件的用户ID位,“g+s”设置组ID位。 t 保存程序的文本到交换设备上。 u 与文件属主拥有一样的权限。 g 与和文件属主同组的用户拥有一样的权限。 o 与其他用户拥有一样的权限。 实例 修改文件可读写属性的方法 例如:把index.html 文件修改为可写可读可执行: chmod 777 index.html 要修改目录下所有文件属性可写可读可执行: chmod 777 *.* 把文件夹名称与后缀名用*来代替就可以了。 比如:修改所有htm文件的属性: chmod 777 *.htm 修改文件夹属性的方法 把目录

linux命令——chmod/chown

三世轮回 提交于 2019-12-31 00:40:13
改变文件所有权 chown 例如 sudo chown username myfile 1 myfile 文件的所有权变为 username 。 chown -R username /files/work 1 加入参数 -R , work 文件夹 以及文件夹里的所有文件和子目录 所有权都变为 username 。 改变文件权限 chmod chmod 修改文件或者目录的权限码 语法: chmod [ 选项 ] [ 数字或者字符权限表示 ] filename 选项: -c:类似于-v,仅显示更改部分 -f:不显示错误信息 -R:递归处理 -v:显示指令执行过程 --reference=参考文件或目录 权限码表示: 权限分为拥有者u,群组g,其他o,权限码读权限r值为4,写权限w值为2,执行权限x值为1 例如: 777代表ugo三个权限的rwx权限都具有。 754代表u是rwx都有,g是rx,o是r。 也可以用符号给权限赋值: u=rwx,g=rx,o=r u=rwx,go=rx 增加或者删除某权限: g-w,o-x go-w 对ugo全部操作用a来代表: a=rwx a-w 注:chmod在修改链接文件的权限后,链接文件的权限不会被改变,链接指向的文件会被改成修改的权限。 rwx权限对文件和目录的意义: 对于文件来说:r:可读取文件的内容 w:可编辑或修改该文件的内容,不包括删除文件

CentOS安装mysql*.rpm提示conflicts with file from package的解决的方法

有些话、适合烂在心里 提交于 2019-12-30 14:46:27
CentOS 6.5下安装MySql 5.6 解压文件:tar xvf MySQL-5.6.19-1.linux_glibc2.5.x86_64.rpm-bundle.tar 释放出下面文件: MySQL-embedded-5.6.19-1.linux_glibc2.5.x86_64.rpm MySQL-devel-5.6.19-1.linux_glibc2.5.x86_64.rpm MySQL-shared-compat-5.6.19-1.linux_glibc2.5.x86_64.rpm MySQL-shared-5.6.19-1.linux_glibc2.5.x86_64.rpm MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm MySQL-client-5.6.19-1.linux_glibc2.5.x86_64.rpm MySQL-test-5.6.19-1.linux_glibc2.5.x86_64.rpm 例如以下图: 通过lss查看文件名称都是红色的。说明文件的訪问权限比較高。我们用命令“chmod 777 ./*”将权限改的低一点, 777应该是最低的权限,相当Windows下everyone可读可写可运行,也就是全然控制。 详细能够看一下: chmod 755和chmod 4755的差别 这里仅仅用到了: MySQL

c copy file permissions from another file

£可爱£侵袭症+ 提交于 2019-12-30 10:36:35
问题 What's the simplest way to copy the unix file permissions of a file and set them to another file? Is there a way to store a file's permissions to a variable and then use that variable to set those permissions to another file? 回答1: Sure. Use stat() and chmod() (may need root). #include <sys/stat.h> struct stat st; stat("/foo/bar.txt", &st); chmod("/baz/quirk.jpg", st.st_mode); 来源: https://stackoverflow.com/questions/16680302/c-copy-file-permissions-from-another-file

MySQL LOAD_FILE returns NULL

岁酱吖の 提交于 2019-12-30 06:44:31
问题 I want to get SQL LOAD_FILE function to work and have read every single question/answer + documentation about this, but here is what's been happening. When I want to LOAD_FILE from my home directory: mysql> SELECT LOAD_FILE('/home/myuser/somefile.txt'); +----------------------------+ | LOAD_FILE('/home/myuser/somefile.txt') | +----------------------------+ | NULL | +----------------------------+ 1 row in set (0.00 sec) So after getting this, I thought maybe the problem is that MySQL cannot

How do I change file permission to a certain file pattern to sub folders of my current directory?

断了今生、忘了曾经 提交于 2019-12-29 11:35:09
问题 Using chmod , I do chmod +x *.sh in the current directory but what if I want to change all files including files within subfolders that has an sh file extension?. chmod +x -R * will work but I need something more like chmod +x -R *.sh 回答1: use find: find . -name "*.sh" -exec chmod +x {} \; 回答2: Try using the glorious combination of find with xargs. find . -iname \*.sh -print0 | xargs -r0 chmod +x The . is the directory to start in, in this case the working directory. 回答3: With modern versions