#!/bin/bash function getdir(){ ` do dir_or_file=$"/"$element if [ -d $dir_or_file ] then getdir $dir_or_file else echo $dir_or_file fi done } root_dir="/home/test" getdir $root_dir…
Java NIO Path接口和Files类配合操作文件 @author ixenos Path接口 1.Path表示的是一个目录名序列,其后还可以跟着一个文件名,路径中第一个部件是根部件时就是绝对路径,例如 / 或 C:\ ,而允许访问的根部件取决于文件系统: 2.以根部件开始的路径是绝对路径,否则就是相对路径: 3.静态的Paths.get方法接受一个或多个字符串,字符串之间自动使用默认文件系统的路径分隔符连接起来(Unix是 /,Windows是 \ ),这就解决了跨平台的问题,接着解析连…
#!/bin/bash #remove the MER.*_ in file name for all the files in a dir function getdir(){ for element in `ls $1` do dir_or_file=$1"/"$element if [ -d $dir_or_file ] then getdir $dir_or_file else #deal with each file in dir mv $dir_or_file `echo…
For some days I have searched for a working solution to an error Error: EMFILE, too many open files It seems that many people have the same problem. The usual answer involves increasing the number of file descriptors. So, I've tried this: sysctl -w k…
System startup files When you log in, the shell defines your user environment after reading the initialization files that you have set up. The characteristics of your user environment are defined by the values given to your environment variables. You…
Automake是用来根据Makefile.am生成Makefile.in的工具 标准Makefile目标 'make all' Build programs, libraries, documentation, etc. (same as 'make'). 'make install' Install what needs to be installed, copying the files from the package's tree to system-wide directories.…
本文为命令rsync的man文档翻译,几乎所有的选项都翻译了,另外关于筛选规则部分只翻译了一部分.由于原文很多地方都比较啰嗦,所以译文中有些内容可能容易让国人疑惑,所以我个人在某些地方加上了注释.若有错误之处,盼请指出.   rsync(1) rsync(1) 名称 rsync - 一个快速.多功能的远程(和本地)文件拷贝工具 摘要 Local: rsync [OPTION...] SRC... [DEST] Access via remote shell: Pull: rsync [OPTIO…
准备深度学习的训练数据时,可能会用到将图片文件名保存到txt文件中,所以用python实现了该功能.输入参数只设了两个,图片存放路径,和输出的txt文件名. 代码里写死了只识别.jpg格式,并不进行目录递归,有需要可以进行修改.使用示例:python files2txt.py --dir dirname --outfile txtname #files2txt.py import os,sys import argparse def parse_args(): """ Par…
ClamAV是一个可用于Linux平台上的开源杀毒引擎,可检测木马.病毒.恶意软件和其他恶意的威胁. 官网:http://www.clamav.net/ 一.CentOS环境安装 # yum install -y epel-release # yum install -y clamav 二.病毒库更新检查:freshclam # freshclam ClamAV update process started at Fri Sep :: main.cld , sigs: , f-level: ,…
目录: 1             文件操作 1.1          快速入门 1.1.1       用Python创建一个新文件 1.1.2       文件内容追加,从0到9的10个随机整数 1.1.3       文件内容追加,从0到9的随机整数, 10个数字一行,共10行 1.1.4       把标准输出定向到文件 1.2          文件的读写 1.2.1       文件打开 1.2.2       关闭文件 1.2.3       清空文件内容 1.2.4      …