鄙人从邮箱下载一份C++文件放到/mnt/CPP/tree/tree1(可执行文件),head.h,tree.cpp三个
一开始很天真
cd mnt/CPP/tree
vim head.h
写完一段
esc+:wq
发现只可读不能写
后来发现需要用
chmod go+rw/rx filename
来改变权限
一开始仅仅在普通用户下改变权限,发现还是只可读
后来知道需要su root
进入超级用户权限才能改:
su root
chmod go+rw head.h
ls -l head.h
chmod go+rw tree.cpp
ls -l tree.cpp
chmod go+rx tree1
ls -l tree1
修改完可以退出超级权限用户:
exit或者su yourname
这时在普通用户下可以对外来文件正常读写或者执行啦!当然如果文件是放在/home下就不用考虑这些问题。
Ubuntu下提示U盘没有些权限的只能读不能写:http://www.linuxdiyf.com/linux/12255.html