只修改文件夹的权限: chmod 755 `find 目录 -type d`
只修改文件的权限: chmod 644 `find 目录 -type f `
其中find命令分别找出目录下的所有目录和文件。``是把find命令的输出作为chmod的参数。
.tgz
解压:
1 gunzip FileName.tgz | jar xvf FileName.tar
2 tar -zxvf test.tgz -C path
3. unzip -O GBK vulgar_and_others.zip -d vulgar_and_others
压缩:
tar -zxvf FileName.tgz
tar -czvf FileName.tgz path
.tar.tgz
解压:tar zxvf FileName.tar.tgz
压缩:tar zcvf FileName.tar.tgz FileName
Shell_Linux Shell 中实现字符串切割的几种方法
https://blog.csdn.net/u010003835/article/details/80750003
#!/bin/bash
# run this code in d-cv-dev/reid_data_process/ directory
#apart[10]='丰华家园/20200601/出,丰华家园/20200601/入'
#apart[11]='丰景湾名邸/20200528/丰镇路100弄入,丰景湾名邸/20200528/丰镇路100弄出,丰景湾名邸/20200528/华严路211弄出,丰景湾名邸/20200528/华严路211弄入,丰景湾名邸/20200528/华严路228弄出,丰景湾名邸/20200528/华严路228弄入'
#apart[12]='丰镇路151弄/20200526_雨/出,丰镇路151弄/20200526_雨/入'
#apart[13]='临潼小区/20200602/出,临潼小区/20200602/入'
#apart[14]='余庆小区/20200602/出,余庆小区/20200602/入'
#apart[15]='余杭小区/20200603/出,余杭小区/20200603/入'
#apart[16]='兰侨大厦/20200526_雨/出,兰侨大厦/20200526_雨/入'
#apart[17]='华严路68弄/20200526_雨/出,华严路68弄/20200526_雨/入'
#apart[18]='华进公寓/20200602/出,华进公寓/20200602/入'
#apart[19]='场中路755弄/20200526_雨/出,场中路755弄/20200526_雨/入'
#apart[20]='奎照路411弄/20200601/出,奎照路411弄/20200601/入'
#apart[21]='宇泰公寓/20200602/出,宇泰公寓/20200602/入'
#apart[22]='建唐小区/20200531/出,建唐小区/20200531/入'
#apart[23]='忠烈小区/20200531/出,忠烈小区/20200531/入'
#apart[24]='新市北路1491弄/20200526_雨/出,新市北路1491弄/20200526_雨/入'
#apart[25]='新申小区/20200526_雨/出,新申小区/20200526_雨/入'
#apart[26]='木材大厦/20200526_雨/出,木材大厦/20200526_雨/入'
#apart[27]='梅福花苑/20200526_雨/入,梅福花苑/20200526_雨/出'
#apart[28]='水电路1600弄/20200526_雨/出,水电路1600弄/20200526_雨/入'
#apart[29]='池沟公寓/20200601/出,池沟公寓/20200601/入'
#apart[30]='汽服小区/20200603/出,汽服小区/20200603/入'
apart[31]='溧阳小区/20200601/出,溧阳小区/20200601/入'
apart[32]='电器小区/20200602/出,电器小区/20200602/入'
apart[33]='荣胜公寓/20200526_雨/出,荣胜公寓/20200526_雨/入'
apart[34]='蕃兴小区/20200602/出,蕃兴小区/20200602/入'
apart[35]='虹口玫瑰苑/20200529/出,虹口玫瑰苑/20200529/入,虹口玫瑰苑/20200529/2出,虹口玫瑰苑/20200529/2入'
apart[36]='融创外滩188/20200525/出,融创外滩188/20200525/入'
apart[37]='路平小区/20200601/出,路平小区/20200601/入'
apart[38]='车站南路25弄/20200530/出,车站南路25弄/20200530/入'
apart[39]='逸仙路1230弄/20200526_雨/入,逸仙路1230弄/20200526_雨/出'
apart[40]='逸兴苑_三门路743_719弄/20200522/三门路743弄入,逸兴苑_三门路743_719弄/20200522/三门路743弄出'
for num in ${apart[*]};
do
array=(${num//,/ })
for var in ${array[@]}
do
echo $var
VIDEO_ROOT='/mnt/data/datasets/HongKou/videos/20200601/'
VIDEO_ROOT=$VIDEO_ROOT$var
cd $VIDEO_ROOT
SAVE_ROOT_OUT='/data/private_data/datasets/hongkou/ori_data/20200601/'
SAVE_ROOT_OUT=$SAVE_ROOT_OUT$var
for i in `ls *_10 -d`
do
cd $VIDEO_ROOT
IMG_ROOT=$VIDEO_ROOT/$i
echo $IMG_ROOT
SAVE_ROOT=$SAVE_ROOT_OUT/$i
echo $SAVE_ROOT
D="--video_root $VIDEO_ROOT --img_root $IMG_ROOT --save_root $SAVE_ROOT"
cd /data/users/kui.duan/code/d-cv-dev/reid_data_process/
#python3 body-det/multi_thread_bodydet_conf.py $D
python3 body-kps/multi_thread_bodykps_conf.py $D
#python3 body-id/multi_thread_bodyid_conf.py $D
#python3 clean/clean_intra_bodyid_conf.py $D
python3 clean/merge_inter_bodyid_conf.py $D
python3 prepostprocess/prepostprocess.py --method vis_bodyid_intra_result $D # --save_img 1
python3 prepostprocess/prepostprocess.py --method vis_bodyid_inter_result $D # --save_img 1
python3 prepostprocess/prepostprocess.py --method generate_bodyid_json $D
done
done
echo '#########'
echo $D
cd /data/users/kui.duan/code/d-cv-dev/reid_data_process/
python3 clean/merge_camera_bodyid_conf.py $D
python3 prepostprocess/prepostprocess.py --method vis_bodyid_camera_result $D
python3 prepostprocess/stats_formconv.py --method formatconv $D
python3 prepostprocess/stats_formconv.py --method formatconv2 $D
python3 prepostprocess/stats_formconv.py --method stats_inter_intra $D # mv vis_fig
python3 prepostprocess/stats_formconv.py --method stats_camera $D
python3 prepostprocess/stats_formconv.py --method vis_camera $D # --save_as_part 1
#python3 prepostprocess/stats_formconv.py --method vis_camera --save_as_part 1 $D # --save_as_part 1
python3 clean/filter_camera_bodyid_conf.py --method load_camera_bodyid2 $D
python3 prepostprocess/stats_formconv.py --method stats_camera_new $D
python3 prepostprocess/stats_formconv.py --method vis_camera_new $D # --save_as_part 1
python3 prepostprocess/stats_formconv.py --method vis_camera_new --save_as_part 1 $D # --save_as_part 1
python3 prepostprocess/prepostprocess.py --method vis_bodyid_camera_result_to_min $D
echo '@@@@@@@@'
done
# run the following code at 172.16.3.58
#cd ~/Desktop/
#mkdir 万康小区
#cd 万康小区
#cp /data/private_data/datasets/hongkou/ori_data/20200601/万康小区/20200526_雨/vis_fig/*new* .
screen -ls|awk 'NR>=2&&NR<=20{print $1}'|awk '{print "screen -S "$1" -X quit"}'|sh
先按Ctrl+a键,然后释放,然后再按[键即可进入翻页模式。Esc推出模式
使用命令ps -A -ostat,ppid,pid,cmd |grep -e '^[Zz]'定位僵尸进程以及该僵尸进程的父进程
du -sh
ls -l |grep "^d"|wc -l # 统计当前文件夹下文件夹个数
ls -lR |grep "^d"|wc -l # # 统计当前文件夹下文件夹个数(包括子文件夹)
ls -l | grep '^-' | wc -l # 统计当前文件夹下文件个数
sudo su # 切换到root模式
echo 3 > /proc/sys/vm/drop_caches # 清除cache内存至free
su username # 返回到~目录
kill -9 32552
ssh root@192.168.1.** u**u**@123 # 使用root权限
sudo userdel dk # 删除dk
sudo adduser dk # 创建dk
sudo usermod -G sudo dk # 添加权限
方法1:whereis python
查看所有python的路径,不止一个
方法2:which python
查看当前使用的python路径
scp -r user@192.168.1.96:/home/username/program/covering/model_fcn/cla/uface_celeb A/resnet/alldata_demo ./ # -r 文件夹
scp user@192.168.1.96:/home/username/program/covering/model_fcn/cla/uface_celeb A/resnet/alldata_demo ./ # 文件
mv * 0 # 将当前文件夹下所有文件移到0这个目录下。
shopt -s extglob
rm -rf !(keep) #删除keep文件之外的所有文件 cd到目录,在执行
rm -rf !(keep1 | keep2) #删除keep1和keep2文件之外的所有文件 cd到目录,在执行
Ubuntu 16.04安装配置Samba服务
https://blog.csdn.net/wbaction/article/details/72758673
https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20%28Command-line%20interface/Linux%20Terminal%29%20-%20Uncomplicated%2C%20Simple%20and%20Brief%20Way%21
删除samba账号
sudo gedit /etc/samba/smb.conf
sudo service smbd restart
sudo mount -t cifs -o username=username,password=123456789,uid=$(id -u),gid=$(id -g) //192.168.1.8/workspace/username /home/username/store --rw
import mxnet as mx # error on this line
libcudart.so.8.0: cannot open shared object file: No such file or directory
所需的libcudart.so.8.0如果正确安装的话,以下两种方法同理:
sudo ldconfig /usr/local/cuda-9.2/lib64
(转自libcudart.so.8.0: cannot open shared object file: No such file or directory)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64。如果仍然不行,再尝试执行:
export PATH=$PATH:/usr/local/cuda-8.0/bin
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda-8.0/lib64
source /etc/profile
若需要将文件移到根目录下,需要在命令前面加上sudo
若出现以下错误信息:解决办法:$ unset LD_PRELOAD
查看隐藏文件夹
进入到你要查询的目录,按住ctrl+H,即可以显示隐藏的文件夹。
ls -a
ll -i
ln -s /home/*** ~/link # 将/home/*** 软连接到~/link
./Demo # 执行Demo执行文件
find -name zip
[软件自动安装的系统目录]
/usr/local/bin
Ctrl + —> 或者 Ctrl + <—
tree -d
grep -n -H -R "..." # -n 显示行号;-H显示文件名 -R递归查找
查看文件夹下某文件的位置
find -name “…hpp”
Linux-matlab
参考文献 https://blog.csdn.net/qq_27262673/article/details/79635924
rm -rf /usr/local/MATLAB/R2010b
rm /usr/local/bin/matlab /usr/local/bin/mcc /usr/local/bin/mex /usr/local/bin/mbuild
ver(‘matlab’) # 查看当前matlab版本,在matlab命令行输入
matlabroot # 查看当前运行matlab根目录,在matlab命令行输入
Linux-界面