Linux Command Line 备忘
1. 如果要删除目录,
rmdir or rm -d 或许可以删除空目录,但是只有
rm -R 可以把目录以及其内容连带删除!
2. 查看文件大小:
ls -l --block-size=G 还可以换成MB
#or
ls -lh
3. mac中使用sudo user:
sudo -s
然后输入你的用户密码(不是master code)即可!
4. 截取部分文件
截取行: head - file.txt > top_100_row.txt 同理可用tail截取 还可使用grep进行行的选择 截取列: cut -f1- -d',' file.txt > top_10_column.txt
5. 查找文件中是否含有某字符串
#查找目录下的所有文件中是否含有某个字符串
find .|xargs grep -ri "IBM"
#查找目录下的所有文件中是否含有某个字符串,并且只打印出文件名
find .|xargs grep -ri "IBM" -l
#or
find ./ -name "IBM"
#Ref:http://blog.sina.com.cn/s/blog_691a84f301015khx.html
6. Export path
export PATH=/Volumes/Macintosh_HD_2/Programs/samtools-0.1./misc/:$PATH
#you can now type directly on the terminal "samtools"
7. comm 命令
#找出两个文件不同的地方:
comm - <(sort a) <(sort b)
#注意这里的“<“。这个符号是”using a file as standard input"
#i.e. cat xyz.txt 和 cat < xyz.txt 效果是一样的
8. sed command
#to delete the 3rd line of a file
sed '3d' fileName.txt
#to select several lines of a file
sed -n '320123,320150'p filename
9. less command
less text.txt
#then, just type
450g
#you can find the 450th line
Linux Command Line 备忘的更多相关文章
- 《The Linux Command Line》 读书笔记04 Linux用户以及权限相关命令
Linux用户以及权限相关命令 查看身份 id:Display user identity. 这个命令的输出会显示uid,gid和用户所属的组. uid即user ID,这是账户创建时被赋予的. gi ...
- 《The Linux Command Line》 读书笔记02 关于命令的命令
<The Linux Command Line> 读书笔记02 关于命令的命令 命令的四种类型 type type—Indicate how a command name is inter ...
- 《The Linux Command Line》 读书笔记01 基本命令介绍
<The Linux Command Line> 读书笔记01 基本命令介绍 1. What is the Shell? The Shell is a program that takes ...
- Linux Command Line Basics
Most of this note comes from the Beginning the Linux Command Line, Second Edition by Sander van Vugt ...
- Linux Command Line 解析
Linux Command Line 解析 0 处理模型 Linux kernel的启动包括很多组件的初始化和相关配置,这些配置参数一般是通过command line进行配置的.在进行后续分析之前,先 ...
- 15 Examples To Master Linux Command Line History
When you are using Linux command line frequently, using the history effectively can be a major produ ...
- 10 Interesting Linux Command Line Tricks and Tips Worth Knowing
I passionately enjoy working with commands as they offer more control over a Linux system than GUIs( ...
- Reso | The Linux Command Line 的中文版
http://book.haoduoshipin.com/tlcl/book/zh/ 本书是 The Linux Command Line 的中文版, 为大家提供了多种不同的阅读方式. 中英文双语版- ...
- [笔记]The Linux command line
Notes on The Linux Command Line (by W. E. Shotts Jr.) edited by Gopher 感觉博客园是不是搞了什么CSS在里头--在博客园显示效果挺 ...
随机推荐
- java 面向对象编程 --第十二章 JDK常用类
1. 系统类 java.lang包 System类 sys.out;sys.exit;sys.gc; sys.currentTimeMillis();----得到从1970-01-01到当前时间 ...
- 10款优秀Vim插件帮你打造完美IDE
导读 如果你稍微写过一点代码,就能知道“集成开发环境”(IDE)是多么的便利.不管是Java.C还是Python,当IDE会帮你检查语法.后台编译,或者自动导入你需要的库时,写代码就变得容易许多.另外 ...
- [Js]焦点图轮播效果
一.所用到的知识点 1.DOM操作 2.定时器 3.事件运用 4.Js动画 5.函数递归 6.无限滚动大法 二.结构和样式 <div id="banner" class=&q ...
- AngularJS 指令实践
概述 如果你写过AngularJS的应用,那么你一定已经使用过指令,不管你有没有意识到.你肯定已经用过简单的指令,比如 ng-mode, ng-repeat, ng-show等.这些指令都赋予DOM元 ...
- 长理ACM 14-星期几(谌海军)
题目描述:编一个程序,已知今天是星期几,计算出n天后是星期几.要求使用枚举变量. 输入描述:输入为两个正整数,第一个数n(n<=6)表示今天是星期几,第二个数m(m<=1000),表示求m ...
- SQL CAST, CONVERT 比较
本文转自:http://www.cnblogs.com/denylau/archive/2010/12/01/1893371.html if (@StartTime > @EndTime) ...
- C语言基础--while循环
while循环格式: while (条件表达式) { 语句; ... } 执行说明: while是对给定的条件进行判断, 如果条件满足, 就执行while后面大括号中的内容, 执行完毕之后会再次判 ...
- as3资源加载-Loader和URLLoader
⊙ Loader:只能加载SWF和图像.⊙ URLLoader:除了能加载swf和图像,还可以加载二进制文件(txt , xml , swc , ........). ================ ...
- ODI 11g & 12c中缓慢变化维(SCD)的处理机制
缓慢变化维(Slowly changing Dimensions)指的是维表中的维度字段值会随着时间或业务调整,而在后续的分析中,历史数据仍然要使用旧的维度值,新的数据会使用当前维度值.在数据仓库建设 ...
- ODI 12c 安装
软件下载地址: http://www.oracle.com/technetwork/middleware/data-integrator/downloads/index.html 下载这个版本: Or ...