linux文件系统

Genaral

  • windows使用磁盘分区等来进行管理,Linux下有文件管理标准FHS来进行规范。linux文件系统中每一个目录都有特定的功能,存放特定的文件内容和类型,比如有系统文件,用户文件;还有文档和可执行文件等;
    linux的文件是一层一层的结构,使用“/”分割;

命令instructions

## 目录跳转 ##
cd ../  //go back to last level
cd~        //go to /home/user

pwd     //show current absolute path    


##新建##

touch+<filename>    //create a new empty file under current path
mkdir   <name>      //make directory在当前目录下新建一个目录    
mkdir -p <name1><name2> //新建父目录 ../name1/name2

##copy files##
cp <file_to_be_copied> <directory>  //copy file 

cp -r <dir_to_copy> <target_dir>    //将给定目录拷贝至给定目录

##delete/remove##
rm <file>   //remove a file(delete)
rm -f <file>    //remove a file though you have no access/permission
rm -r <directory/file>  //delete a file in given directory

##move##
//cut&paste
mv <file> <directory>   //将文件移动至给定目录下

##View##
cat //view file in terminal
cat -n  //view & show line number

more/less +<file>   //查看文件
enter   //向下一行
space   //next page

head n  //first n lines
tail n  //last n lines
tail -f //动态显示文件内容

更改权限

linux的文件权限为rwxrwxrwx
这三个数字可以按照二进制来设置其值,比如
111-000-000表示用户有rwx三个权限
也可以直接设置为700

sudo chmod 600 <file>   //read&write

linux显示权限命令:

ls -l   //显示文件类型,权限,所有者,用户组,大小,最后修改时间,文件名

这里写图片描述

这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值