linux Shell获取某目录下所有文件夹的名称
网络编程
查看目录下面的所有文件:
#!/bin/bash cd /目标目录 for file in $(ls *) do echo $file done
延伸的方法,查看目录下面的所有目录
#!/bin/bash cd /export/bak/original_document for dir in $(ls split*) do [ -d $dir ] && echo $dir #先判断是否是目录,然后再输出 done
Linux 进程替换(exec函数)实现代码
Linux进程替换(exec函数)实现代码#includestdio.h#includestdlib.h#includeunistd.h#includefcntl.h#includesys/types.h#includesys/stat.h#includestring.hintmain(){pid_tid=fork();if(id==0){printf(
数据结构 二叉树的递归与非递归
数据结构二叉树的递归与非递归实例代码:#includeiostream#includequeue#includestack#includeassert.husingnamespacestd;templateclassTstructBinaryTreeNode{BinaryTreeNodeT*_left;BinaryTree
使用Linux的alternatives命令替换选择软件的版本方法
上周在安装搜索引擎Elasticsearch时,要求安装比较新的java版本,我选择了java1.8.0,安装java成功后使用java-version发现使用的版本仍旧是1.6.0,查询了一些资
编辑:一起学习网
标签:递归,目录,数据结构,版本,代码