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. Java使用volatile实现多线程输出ABC共10次

    问题 有A,B,C三个线程, A线程输出A, B线程输出B, C线程输出C.要求,同时启动三个线程, 按顺序输出ABC, 循环10次. 今天在写多线程的时候找例子,见到了这样一个题,觉得不难,但是在网 ...

  2. 一篇文章搞定mongodb

    一 安装 1 安装目录下新建文件夹data,etc,logs #在bin文件下启动cmd,指定数据存储的路径mongod --dbpath D:\MongoDB\data\db 2 etc文件夹中新建 ...

  3. springboot mybatis搭建

    非常easy直接写,没有搭建成分 1.目录 2. @RestController public class UserController { @RequestMapping("/hello& ...

  4. 12-tinyMCE文本编辑器+图片上传预览+页面倒计时自动跳转

    文本编辑器插件:1.将tinymce文件夹全部复制到webContent下2.tinymce/js目录下放 jquery等三个js文件3.语言包:tinymce/js/tinymce/langs目录下 ...

  5. Filebeat原理与简单配置入门

    Filebeat工作原理 Filebeat由两个主要组件组成:prospectors 和 harvesters.这两个组件协同工作将文件变动发送到指定的输出中. Harvester(收割机):负责读取 ...

  6. yum 彻底删除nodejs,重新安装

    第一步 用自带的包管理先删除一次 yum remove nodejs npm -y1手动删除残留 进入 /usr/local/lib 删除所有 node 和 node_modules文件夹进入 /us ...

  7. 小程序——返回上个页面触发事件(onUnload)

    //页面销毁前--上传被提交的数据 onUnload:function(){ var _this=this; let updateStatus = wx.getStorageSync('UpdateS ...

  8. Java this与super的仇与恨

    刚开始学习面向对象的时候,看到this和super觉得this就是指当前对象,super指最近的父级对象.觉得用处不大. 后来,随着学习的深入,看别人的代码越来越多,发现this和super的使用率贼 ...

  9. Uint 5.css继承权重,盒模型和border padding

    一 .css的继承性和权重 1.1 继承性:继承是CSS的一个主要特征,它是依赖于祖先-后代的关系的.继承是一种机制,它允许样式不仅可以应用于某个特定的元素,还可以应用于它的后代. 可以被继承的属性有 ...

  10. Shell命令-线上查询及帮助之man、help

    线上查询及帮助 - man.help 1.man:获取命令的帮助信息 man命令的简单介绍 man命令是Linux系统中最核心的命令之一 ,因为通过它可以查看其它Linux命令的使用信息.当然了 ,m ...