显示前3行数据

ls -l|head -n 3

显示后3行数据

ls -l|tail -n 3

ls显示前几行或后几行数据的更多相关文章

  1. linux文件截取前几行,后几行,中间几行命令

    1. 如果你只想看文件的前5行,可以使用head命令,如: head -5 /etc/passwd 2. 如果你想查看文件的后10行,可以使用tail命令,如: tail -2 /etc/passwd ...

  2. php while循环 指定显示内容 例如不想显示前10条和后10条

    <?php //查询信息总的条数 $db_num = query_num("表","where 1=1"); //每页显示的条数 $page_size=2 ...

  3. 【Linux】grep显示匹配行的上下几行的用法

    打印匹配行的前后5行 grep -5 ‘something’ file 打印匹配行的前后5行 grep -C 5 ‘something’ file 打印匹配行的后5行 grep -A 5 ‘somet ...

  4. linux利用grep查看打印匹配的下几行或前后几行的命令

    转自:http://www.itokit.com/2013/0308/74883.html linux系统中,利用grep打印匹配的上下几行   如果在只是想匹配模式的上下几行,grep可以实现.   ...

  5. linux查看文件前几行和后几行的命令

        可以使用head(查看前几行).tail(查看末尾几行)两个命令.例如:查看/etc/profile的前10行内容,应该是:# head -n 10 /etc/profile查看/etc/pr ...

  6. 转 linux查看文件前几行和后几行的命令

    可以使用head(查看前几行).tail(查看末尾几行)两个命令.例如:查看/etc/profile的前10行内容,应该是:# head -n 10 /etc/profile查看/etc/profil ...

  7. javascript超过容器后显示省略号效果(兼容一行或者多行)

    javascript超过容器后显示省略号效果       在实际的项目中,由于文字内容的长度不确定性和页面布局的固定性,难免会出现文字内容超过div(或其他标签,下同)区域的情况,此时比较好的做法就是 ...

  8. jqeury显示前几个,隐藏后几个,点击后隐藏前几个显示后几个

    <script type="text/javascript"> $(".ul li").each(function(){ if($(this).in ...

  9. CSS把容器中的内容限制行数,在超过行数后,在最后一行显示"..."

    <style type="text/css"> .main{ width: 400px; background-color: #3498db; display: -we ...

随机推荐

  1. 1101 Quick Sort(25 分

    There is a classical process named partition in the famous quick sort algorithm. In this process we ...

  2. spring不同环境下用不同的配置文件

    @Configuration @PropertySource("xx-${spring.profiles.active}.properties") public class Top ...

  3. Java中常用的数据源

    几种常用的Java数据源解决方案 Java中的数据源就是javax.sql.DataSource.DataSource的创建可以有不同的实现. JNDI方式创建DataSource 以JNDI方式创建 ...

  4. 10g duplicate and 11g dupliacte db for standby

    ###################10g Creating a Physical Standby Database OASSTBY Make sure database is in archive ...

  5. SpringCloud+MyBatis+Redis整合—— 超详细实例(一)

    1.SpringCloud+MyBatis MyBatis 是一款优秀的轻量级半自动持久层框架,与之相对应的还有hibernate框架.①   话不多说,接下来搭建SpringCloud+MyBati ...

  6. 004 Median of Two Sorted Arrays 两个有序数组的中位数

    There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two ...

  7. 016 3Sum Closest 最接近的三数之和

    Given an array S of n integers, find three integers in S such that the sum is closest to a given num ...

  8. 最大利润-城市A和B

    1,问题描述 jack每天同时只能在A和B其中一个城市工作赚钱,假设两个城市间的交通费为m.已知每天在A 和 B 能赚到多少钱,那么jack怎么选择每天工作的城市才能赚到最大利润. 比如 moneyA ...

  9. datagrid 里面的formatter方法

    A.{field:'station_staus',title:'工位状态',width:250,align:'center',formatter: function(value,row,index){ ...

  10. Primefaces dataTable设置滚动条问题

    primefaces dataTable设置滚动条后不论有几行数据都会有滚动条的位置,当数据所占高度大于scrollHeight设定的值时才会出现滚动条,问题是,没有出现滚动条时,预留滚动条的位置不仅 ...