常用linux命令
2016-04-13 20:10
489 查看
1. mkdir -p:创建多级目录 eg: mkdir -p A/B
2. 复制: ctrl+insert 粘贴:shift+insert
3. vi编辑时--》撤销:esc-->u 撤销本次编辑时被撤销的内容:ctrl+R
4. 反引号` `的作用《==》$(),都是执行夹在里面的命令
5. 修改文件的权限:chmod -R 744 *
修改当前目录下所有的子目录、文件的权限:当前用户rwx 组用户:r 其他用户:r
6. 调试shell脚本:shell -x
7. 替换文件中匹配的字符串:sed -i 's/原字符串/替换字符串/g' filename //替换文件中的所有匹配项
8. 字符串切换编码:iconv -c -f gbk -t utf8 feed_test_data.txt>feed_test_data.txt_utf8
9. 查找:
find /disk9/cmsdata/file_product -name '*.csv' -type f -newermt "${yesterdaystr}" ! -newermt "${todaystr}" | xargs -i cp -vr {} $rawpath'/' | tee copy.log
find -newermt
man find的解释::
-newerXY reference
Compares the timestamp of the current file with reference. The
reference argument is normally the name of a file (and one of
its timestamps is used for the comparison) but it may also be a
string describing an absolute time. X and Y are placeholders
for other letters, and these letters select which time belonging
to how reference is used for the comparison.
a The access time of the file reference
B The birth time of the file reference
c The inode status change time of reference
m The modification time of the file reference
t reference is interpreted directly as a time
Some combinations are invalid; for example, it is invalid for X
to be t. Some combinations are not implemented on all systems;
for example B is not supported on all systems. If an invalid or
unsupported combination of XY is specified, a fatal error
results. Time specifications are interpreted as for the argu-
ment to the -d option of GNU date. If you try to use the birth
time of a reference file, and the birth time cannot be deter-
mined, a fatal error message results. If you specify a test
which refers to the birth time of files being examined, this
test will fail for any files where the birth time is unknown.
2. 复制: ctrl+insert 粘贴:shift+insert
3. vi编辑时--》撤销:esc-->u 撤销本次编辑时被撤销的内容:ctrl+R
4. 反引号` `的作用《==》$(),都是执行夹在里面的命令
5. 修改文件的权限:chmod -R 744 *
修改当前目录下所有的子目录、文件的权限:当前用户rwx 组用户:r 其他用户:r
6. 调试shell脚本:shell -x
7. 替换文件中匹配的字符串:sed -i 's/原字符串/替换字符串/g' filename //替换文件中的所有匹配项
8. 字符串切换编码:iconv -c -f gbk -t utf8 feed_test_data.txt>feed_test_data.txt_utf8
9. 查找:
find /disk9/cmsdata/file_product -name '*.csv' -type f -newermt "${yesterdaystr}" ! -newermt "${todaystr}" | xargs -i cp -vr {} $rawpath'/' | tee copy.log
find -newermt
man find的解释::
-newerXY reference
Compares the timestamp of the current file with reference. The
reference argument is normally the name of a file (and one of
its timestamps is used for the comparison) but it may also be a
string describing an absolute time. X and Y are placeholders
for other letters, and these letters select which time belonging
to how reference is used for the comparison.
a The access time of the file reference
B The birth time of the file reference
c The inode status change time of reference
m The modification time of the file reference
t reference is interpreted directly as a time
Some combinations are invalid; for example, it is invalid for X
to be t. Some combinations are not implemented on all systems;
for example B is not supported on all systems. If an invalid or
unsupported combination of XY is specified, a fatal error
results. Time specifications are interpreted as for the argu-
ment to the -d option of GNU date. If you try to use the birth
time of a reference file, and the birth time cannot be deter-
mined, a fatal error message results. If you specify a test
which refers to the birth time of files being examined, this
test will fail for any files where the birth time is unknown.
相关文章推荐
- linux下golang的配置
- centos中pppoe每次重新启动都要设置的问题
- linux下.vimrc配置
- CentOS 7 firewalld取代 iptables
- CentOS安装mysql*.rpm提示conflicts with file from package的解决的方法
- Linux内核分析作业 NO.8 完结撒花~~~
- 《linux内核设计与实现》第四章
- CentOS 7 安装 caffe
- centOs修改网卡名
- linux 如何清理僵尸进程
- Linux学习笔记--压缩和解压缩命令
- linux下查看端口的连接数
- CentOS添加永久静态路由所有方法汇总
- Linux 针对用户的操作
- centos下的samba共享文件在windows下打开没有权限
- linux awk 内置函数详细介绍
- 运维必须掌握的Linux面试题【转自CentOS中文站】
- 远程linux服务器mysql数据库导入和导出.sql文件
- Linux学习笔记——例说makefile 增加系统共享库 ——非常好的学习Linux makefile 等的博客
- centos文本模式与界面模式默认运行修改