Linux Commands for Beginners--Changing Ownership --chown command
来源:互联网 发布:sift 算法编程原理 编辑:程序博客网 时间:2024/06/01 10:26
In this part, we'll learn how to change ownership of files and folders.
1.COMMAND:
chown
DESCRIPTION:
change file owner and group
SYNOPSIS
chown [OPTION]... [OWNER][:[GROUP]] FILE...
OPTION:
-R, --recursive
operate on files and directories recursively
Example:
piniheaven@fish:~/Documents$ls
assemble C++primer_ex C++primer_note Ebook linux QT_ex QT_note tutorial
piniheaven@fish:~/Documents$ ls -l ./tutorial/
total 0
-rw-rw-r-- 1 piniheaven piniheaven 0 Aug 25 21:42 essay.txt
piniheaven@fish:~/Documents$ sudochown jack ./tutorial/essay.txt #change essay.txt's owner
piniheaven@fish:~/Documents$ ls -l ./tutorial/
total 0
-rw-rw-r-- 1 jack piniheaven 0 Aug 25 21:42 essay.txt
piniheaven@fish:~/Documents$ sudochown piniheaven:Students ./tutorial/essay.txt #change essay.txt's owner and group
piniheaven@fish:~/Documents$ ls -l ./tutorial/
total 0
-rw-rw-r-- 1 piniheaven Students 0 Aug 25 21:42 essay.txt
piniheaven@fish:~/Documents$ sudochown -R jack:piniheaven ./tutorial #change all files's owner and group in tutorial directory
piniheaven@fish:~/Documents$ ls -l ./tutorial/
total 0
-rw-rw-r-- 1 jack piniheaven 0 Aug 25 21:42 essay.txt
1.COMMAND:
chown
DESCRIPTION:
change file owner and group
SYNOPSIS
chown [OPTION]... [OWNER][:[GROUP]] FILE...
OPTION:
-R, --recursive
operate on files and directories recursively
Example:
piniheaven@fish:~/Documents$ls
assemble C++primer_ex C++primer_note Ebook linux QT_ex QT_note tutorial
piniheaven@fish:~/Documents$ ls -l ./tutorial/
total 0
-rw-rw-r-- 1 piniheaven piniheaven 0 Aug 25 21:42 essay.txt
piniheaven@fish:~/Documents$ sudochown jack ./tutorial/essay.txt #change essay.txt's owner
piniheaven@fish:~/Documents$ ls -l ./tutorial/
total 0
-rw-rw-r-- 1 jack piniheaven 0 Aug 25 21:42 essay.txt
piniheaven@fish:~/Documents$ sudochown piniheaven:Students ./tutorial/essay.txt #change essay.txt's owner and group
piniheaven@fish:~/Documents$ ls -l ./tutorial/
total 0
-rw-rw-r-- 1 piniheaven Students 0 Aug 25 21:42 essay.txt
piniheaven@fish:~/Documents$ sudochown -R jack:piniheaven ./tutorial #change all files's owner and group in tutorial directory
piniheaven@fish:~/Documents$ ls -l ./tutorial/
total 0
-rw-rw-r-- 1 jack piniheaven 0 Aug 25 21:42 essay.txt
- Linux Commands for Beginners--Changing Ownership --chown command
- Linux Commands for Beginners-- Changing Permissions --chmod command
- Linux Commands for Beginners--The top Command
- Linux Commands for Beginners--The Watch Command
- Linux Commands for Beginners-- Regular Expressions--the grep command
- Linux Commands for Beginners--Head and Tail Command
- Linux Commands For Beginners: SUDO
- Linux Commands for Beginners--The .bashrc File
- Linux Commands for Beginners--Finding Files
- Linux Commands for Beginners--Create Your Own Commands Via alias
- Linux Commands for Beginners--which and whatis commands
- Linux Commands for Beginners--Viewing Resources--du,df,free commands
- Linux Commands for Beginners--Arithmetic in Bash--expr,let commands
- Linux Commands for Beginners---SSH for Remote Administration
- Linux Commands for Beginners-- FTP for Remote Administration
- Linux Commands for Beginners-- Echo And Creating Variables
- Linux Commands for Beginners--Creating Your First Scripting
- LINUX Command: chown & chmod
- C#中使用设置介绍
- HDU 4642 (13.08.25)
- 【专题】Catalan数
- Hadoop集群配置(最全面总结)
- android GridView 通过json显示网络图片和文字
- Linux Commands for Beginners--Changing Ownership --chown command
- exit 与 return 的区别
- 如何优化cocos2d程序的内存使用和程序大小:第二部分(完)
- 多校第十场 1009 Sum
- 学习
- 谈谈我这几年的C++学习之路
- 关于java23种设计模式
- JSON数据解析
- 天乙社区社区首页分析(三)