Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1450703
  • 博文数量: 1279
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 13084
  • 用 户 组: 普通用户
  • 注册时间: 2018-03-07 16:26
个人简介

Linux学习小标兵,专注Linux资讯分享,技术文章分享

文章分类

全部博文(1279)

文章存档

2023年(236)

2022年(285)

2021年(265)

2020年(248)

2019年(213)

2018年(32)

我的朋友

分类: LINUX

2019-11-09 21:53:03

导读 前面使用的,有几个用到了参数如ls -l, head -n 6等,需要注意的是跟参数之间要有空格。
获取可用命令行参数

Linux学习教程-获取可用命令行参数 or 文件上下翻转和左右翻转Linux学习教程-获取可用命令行参数 or 文件上下翻转和左右翻转
终端运行man ls可以查看ls所有可用的参数,上下箭头翻页,按q退出查看。(man: manual, 手册)

ct@ehbio:~/data$ man ls
NAME
 ls - list directory contents
SYNOPSIS
 ls [OPTION]... [FILE]...

DESCRIPTION
 List  information  about  the  FILEs  (the current directory by default).
 Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

 Mandatory arguments to long options are mandatory for short options too.

 -a, --all
  do not ignore entries starting with .

 -A, --almost-all
  do not list implied . and ..

 --author
  with -l, print the author of each file

 -b, --escape
  print C-style escapes for nongraphic characters
 ....
文件上下翻转和左右翻转

两个有意思的命令,tac: 文件翻转,第一行变为最后一行,第二行变为倒数第二行;rev每列反转,第一个字符变为最后一个字符,第二个字符变为倒数第二个字符。

ct@ehbio:~/data$ cat <  first
> second
> third
> END
third
second
first
ct@ehbio:~/data$ cat <  abcde
> xyz
> END
edcba
zyx

本文来自《Linux就该这么学》官方资讯站。
阅读(6809) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~