linux 下修改文件夹的用户权限和所属组,为文件建立软连接
发布时间:2018-03-13 16:35,
浏览次数:626
, 标签:
linux
chown wlq testfilwe //为文件夹testfile更改拥有者为wlq
chgrp [-r] wlq testfile //为文件夹testfile更改拥有者组为wlq
sudo du -sh /home/* //查看一台机器上各个用户占用空间情况
sudo userdel -r username //删除用户
ln -s [源文件或目录] [目标文件或目录] #建立软链接
rm -rf 软连接的名称 //删除软连接
scp 将数据从一台linux服务器复制到另一台linux服务器
(1) 复制文件:
命令格式:
scp local_file remote_username@remote_ip:remote_folder
或者
scp local_file remote_username@remote_ip:remote_file
或者
scp local_file remote_ip:remote_folder
或者
scp local_file remote_ip:remote_file
(2) 复制目录:
命令格式:
scp -r local_folder remote_username@remote_ip:remote_folder
或者
scp -r local_folder remote_ip:remote_folder
对于退出Xshell客户端服务器上的程序经常挂掉的问题解决办法
使用nohub命令(no hang up)
nohup command > myout.file 2>&1 &
日志输出被重定向到了文件myout.file文件中。起到守护进程的目的。
压缩当前的文件夹 zip -r ./xahot.zip ./* -r表示递归
zip [参数] [打包后的文件名] [打包的目录路径]
解压 unzip xahot.zip 不解释
reference:https://blog.csdn.net/zzllabcd/article/details/49475351
reference:https://blog.csdn.net/mm_bit/article/details/50401869
1.统计当前目录下,py文件数量:
find . -name “.py" |wc -l
2.统计当前目录下,所有py文件行数:
find . -name ".py” |xargs cat|wc -l
3.统计当前目录下,所有py文件行数,并过滤空行:
find . -name “*.py” |xargs cat|grep -v ^$|wc -l