shebang = sharp-bang = #!

1.echo $PATH

export PATH="$PATH:/home/user/bin"

PREPEND

prepend() { [ -d "$2" ] && eval $1=\"$2':'\$$1\" && export $1; }

2.echo -e "\e[1;31m This is red text \e[0m"

0 black 30 red 31 green 32 yellow 33 bule 34 yangred 35 qing 36 white 37

backgroud color 0 black 40 red 41 green 42 y 43 bule 44 yangred 45 qing 46 white 47

3.env

cat /proc/$PID/environ

pgrep gedit  -> serch process ID

4.let (()) [  ]   bc

echo "scale=2;22/7" | bc

5.$?

echo $?

6. command | tee FILE1 FILE2  | otherCommand

cat a* | tee -a out.txt | cat -n     # -a  add

7.declare -A ass_array

8.alias rm='cp $@ ~/backup && rm $@'

unalias

\command

&& yu

||  huo

-eq =

-ne  !

-gt >

-lt <

-ge >=

-le <=

9. if condition;

then

commands;

fi

if conditon;

then

commands;

else if condition; then

commands;

else

commands;

fi

10.

find

find . -type f -print

file type : f l d c b s p

-atime

-mtime

-ctime

find . -type f -atime -7 -print

-amin

-mmin

-cmin

find . -type f -amin +7 -print

-newer

find . -type f -newer file.txt -print

find . -type f -size +2k

-2k

2k

find . -type f -perm 644 -print

find . -type f -name "*.php" ! -perm 644 -print

find . -type f -user slynux -print

find . -type f -name "*.swp" -delete

find . -type f -user root -exec chown slynux { } \;

find . -type f -name '*.c' -exec cat { } \;>all_c_files.txt

find . -type f -name '*.c' -exec cat { } >all_c_files.txt \;

find . -type f -name '*.c' -exec cat { } >all_c_files.txt +

find . -type f -mtime +10 -name "*.txt" -exec cp { } OLD \;

find . -type f -name "*.txt" -exec printf "text file: %s\n" { } \;

11. xargs

echo "split1Xsplit2Xsplit3X" | xargs -d X

echo "splitXsplitXsplitXsplit" | xargs -d X -n 2

shell1的更多相关文章

  1. hadoop入门手册4:Hadoop【2.7.1】初级入门之命令:文件系统shell1

    问题导读1.Hadoop文件系统shell与Linux shell有哪些相似之处?2.如何改变文件所属组?3.如何改变hdfs的文件权限?4.如何查找hdfs文件,并且不区分大小写? 概述文件系统 ( ...

  2. shell--1.shell 相关及变量

    1.shell脚本解释器 Bourme Shell (/usr/bin/sh 或 /bin/sh ) Bourme Again Shell ( /bin/bash ) C Shell ( /usr/b ...

  3. 执行shell文件是,提示chmod: 更改'./shell1.sh' 的权限: 不允许的操作。

  4. 自学Linux Shell1.1-Linux初识

    点击返回 自学Linux命令行与Shell脚本之路 1.1-Linux初识(架构.内核.shell) 1. Linux架构 Linux系统一般有4个主要部分:内核.shell.文件系统和应用程序.(有 ...

  5. 自学Linux Shell1.2-Linux目录结构

    点击返回 自学Linux命令行与Shell脚本之路 1.2-Linux目录结构 /:  根目录,一般根目录下只存放目录,不要存放文件,/etc./bin./dev./lib./sbin应该和根目录放置 ...

  6. 自学Linux Shell1.3-Linux文件系统

    点击返回 自学Linux命令行与Shell脚本之路 1.3-Linux文件系统 文件系统是文件存放在磁盘等存储设备上的组织方法.Linux系统能支持多种目前流行的文件系统,如EXT2. EXT3. F ...

  7. shell-1.shell概述、2.shell脚本执行方式

    目录

  8. Linux之Shell1

    1.输出命令:echo echo [选项] [输出内容] : -e  支持反斜线控制的字符转换.(类似于C语言的\) \\ 输出\本身 \t Tab键 \n 换行符 \f 换页符 ...  

  9. 【学习笔记】Shell-1 变量:命名规范、变量赋值/取值/取消、局部变量/全局变量、预设环境变量

    1.Shell变量 从变量的实质上来说,变量名是指向一片用于存储数据的内存空间. Shell变量是一种弱类型的变量,即声明变量时不需要指定其变量类型,也不需求遵循“先声明再使用”的规定,想用即可用. ...

随机推荐

  1. logback.xml的使用,将日志异步保存到数据库中

    想要把日志异步保存到数据库中,首先需要创建一个数据库,然后创建三张固定的表: https://github.com/xiaorenwu-dashijie/logback.git <?xml ve ...

  2. jdk 环境变量

    1. jdk安装后的目录 2.JAVA_HOME C:\Program Files\Java\jdk1.8.0_172 3.PATH %JAVA_HOME%\bin 4.CLASSPATH .;%JA ...

  3. MySql数据库在NodeJS中简单的基本操作

    阅读目录 一:连接数据库 二:数据的增删改查操作 2.1 数据库新增和查询数据 2.2 获取该数据的主键值 2.3 多语句查询 回到顶部 一:连接数据库 const mysql = require(' ...

  4. git完全cli指南之详细思维导图整理分享

    一直以来都觉得 在开发过程中 能用命令行的还是用命令行 能用快捷键的就要快捷键 前期可能要点学习成本 但是熟练后带来的好处还是非常可观的 所以一直坚持使用命令行的方式来使用git 基本上每个操作都能心 ...

  5. .NET 开源项目 Polly 介绍

    今天介绍一个 .NET 开源库:Polly,它是支持 .NET Core 的,目前在 GitHub 的 Star 数量已经接近 5 千,它是一个强大且实用的 .NET 库. Polly 介绍 官方对 ...

  6. 关于mysql中的count()函数

    1.count()函数是用来统计表中记录的一个函数,返回匹配条件的行数. 2.count()语法: (1)count(*)---包括所有列,返回表中的记录数,相当于统计表的行数,在统计结果的时候,不会 ...

  7. jdbc,mybatis,hibernate各自优缺点及区别

    先比较下jdbc编程和hibernate编程各自的优缺点.    JDBC:    我们平时使用jdbc进行编程,大致需要下面几个步骤:    1,使用jdbc编程需要连接数据库,注册驱动和数据库信息 ...

  8. ;。【】DAY14、递归,匿名函数

    一.三元运算符 三元运算符也称三目运算符,就是if .....else.....语法糖 前提:if 和 else 只有一条语句 例:a = 20 b = 30 res = a if a > b ...

  9. AirBnB春招笔试题

    试题说明 笔试题只有一道,限时1小时. 模拟一个战争外交游戏,游戏中定义了三种操作: A city1 Hold : 军队A 占领了city1 A city1 Move city2 : 军队A从city ...

  10. mysql 基本语句

    求知若渴 虚心若愚   博客园 首页 新随笔 联系 管理 随笔-391  文章-0  评论-7  mysql sql常用语句大全   SQL执行一次INSERT INTO查询,插入多行记录 inser ...