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 备忘的更多相关文章

  1. 《The Linux Command Line》 读书笔记04 Linux用户以及权限相关命令

    Linux用户以及权限相关命令 查看身份 id:Display user identity. 这个命令的输出会显示uid,gid和用户所属的组. uid即user ID,这是账户创建时被赋予的. gi ...

  2. 《The Linux Command Line》 读书笔记02 关于命令的命令

    <The Linux Command Line> 读书笔记02 关于命令的命令 命令的四种类型 type type—Indicate how a command name is inter ...

  3. 《The Linux Command Line》 读书笔记01 基本命令介绍

    <The Linux Command Line> 读书笔记01 基本命令介绍 1. What is the Shell? The Shell is a program that takes ...

  4. Linux Command Line Basics

    Most of this note comes from the Beginning the Linux Command Line, Second Edition by Sander van Vugt ...

  5. Linux Command Line 解析

    Linux Command Line 解析 0 处理模型 Linux kernel的启动包括很多组件的初始化和相关配置,这些配置参数一般是通过command line进行配置的.在进行后续分析之前,先 ...

  6. 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 ...

  7. 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( ...

  8. Reso | The Linux Command Line 的中文版

    http://book.haoduoshipin.com/tlcl/book/zh/ 本书是 The Linux Command Line 的中文版, 为大家提供了多种不同的阅读方式. 中英文双语版- ...

  9. [笔记]The Linux command line

    Notes on The Linux Command Line (by W. E. Shotts Jr.) edited by Gopher 感觉博客园是不是搞了什么CSS在里头--在博客园显示效果挺 ...

随机推荐

  1. PostgreSQL数据库系统优点

    PostgreSQL 是世界上可以获得的最先进的开放源码的数据库系统, 它提供了多版本并行控制,支持几乎所有 SQL 构件(包括子查询,事务和用户定 义类型和函数), 并且可以获得非常广阔范围的(开发 ...

  2. web开发-前端到服务器Controller中的数据传递

    一, ajax方式 1. ajax获取页面中的数据,包括表单中的数据, 然后封装成对象,数组, 字符串, 或其他基本类型的数据. 2. 将封装得到的数据通过ajax传递到controller中(注:在 ...

  3. AlarmManager手机闹钟简介

    1.void set(int type , long triggerAtTime , PendingIntent operation ) : 设置在 triggerAtTime时间启动由operati ...

  4. hduacm 3183 rmq

    http://acm.hdu.edu.cn/showproblem.php?pid=3183 问题等价与取N-M个数,每次取的时候保证后面能取的个数足够,并且取的数最小  查询最小用rmq #incl ...

  5. 判断子元素(or属性)是否存在

    if(typeof($("#aid").attr("rel"))=="undefined") 即可

  6. [Elasticsearch] 多字段搜索 (三) - multi_match查询和多数字段 <译>

    multi_match查询 multi_match查询提供了一个简便的方法用来对多个字段执行相同的查询. NOTE 存在几种类型的multi_match查询,其中的3种正好和在“了解你的数据”一节中提 ...

  7. Codeforces Round #378 (Div. 2) D题(data structure)解题报告

    题目地址 先简单的总结一下这次CF,前两道题非常的水,可是第一题又是因为自己想的不够周到而被Hack了一次(或许也应该感谢这个hack我的人,使我没有最后在赛后测试中WA).做到C题时看到题目情况非常 ...

  8. Windows系统安装时间

    http://www.45it.com/windowszh/201206/30693.htm 修改系统安装时间 开始" - "运行" - 输入"regedit& ...

  9. VS2010下配置OCI编程

    OCI是Oracle官方出品的用于C/C++语言连接.操作Oracle数据库的API.在windows操作系统下使用VS等IDE编写.编译C++程序十分方便.简单,不需要使用Makefile.使用OC ...

  10. springMVC文件上传(转)

    原文链接: http://www.cnblogs.com/lonecloud/p/5989905.html 在Spring-mvc.xml注入bean 1 <!-- 配置文件上传,如果没有使用文 ...