面试总结之Linux/Shell
Linux
Linux cshrc文件作用
Linux如何起进程/查看进程/杀进程
Linux 文件755 代表什么权限
Linux辅助线程
Linux进程间通信方法
pipeline,msgq...
进程间通信_百度百科
http://baike.baidu.com/link?url=tLNXNQvG5Wo6NptnjkflYaUQbdqW5fC3n40Cv4iF4YSX5EzgfJgwIbZnAfpXLVV1QRvP1293Dgo9qRBmSVfME_
Linux基本命令
- Linux 命令大全 | 菜鸟教程
- http://www.runoob.com/linux/linux-command-manual.html
Linux监控命令,监测IO
Shell
What is $*?
Will display all the commandline arguments that are passed to the script
What is the difference between a shell variable that is exported and the one that is not exported?
export LANG=C
will make the variable LANG the global variable, put it into the global environment. all other processes can use it.
LANG=C
will change the value only in the current script.
How will you list only the empty lines in a file (using grep)?
grep "^[ ]*$" filename.txt
In character set (between [ and ] one space and tab is given)
this command will gives all the blank line including those having space and tabs (if pressed)only
How do you read arguments in a shell program - $1, $2 ?
#!/bin/sh
for i in $*
do
echo $i
done
On executig the above script with any number of command-line arguments it will display all the parametsrs.
How would you get the character positions 10-20 from a text file?
cut -c10-20 <filename.txt>
or
cat filename.txt | cut -c 10-20
用脚本实现:两个文件有多列,在指定列中找相匹配串。
精心汇总的 24 道 shell 脚本面试题 - 程序员大咖
- https://mp.weixin.qq.com/s/elYuWwwiYR2XzP2K3qDeNQ
- https://linux.cn/article-5311-1.html
- Q:1 Shell脚本是什么、它是必需的吗?
- Q:2 什么是默认登录shell,如何改变指定用户的登录shell
- Q:3 可以在shell脚本中使用哪些类型的变量?
- Q:4 如何将标准输出和错误输出同时重定向到同一位置?
- Q:5 shell脚本中“if”语法如何嵌套?
- Q:6 shell脚本中“$?”标记的用途是什么?
- Q:7 在shell脚本中如何比较两个数字 ?
- Q:8 shell脚本中break命令的作用 ?
- Q:9 shell脚本中continue命令的作用 ?
- Q:10 告诉我shell脚本中Case语句的语法 ?
- Q:11 shell脚本中while循环语法 ?
- Q:12 如何使脚本可执行 ?
- Q:13 “#!/bin/bash”的作用 ?
- Q:14 shell脚本中for循环语法 ?
- Q:15 如何调试shell脚本 ?
- Q:16 shell脚本如何比较字符串?
- Q:17 Bourne shell(bash) 中有哪些特殊的变量 ?
- Q:18 在shell脚本中,如何测试文件 ?
- Q:19 在shell脚本中,如何写入注释 ?
- Q:20 如何让 shell 就脚本得到来自终端的输入?
- Q:21 如何取消变量或取消变量赋值 ?
- Q:22 如何执行算术运算 ?
- Q:23 do-while语句的基本格式 ?
- Q:24 在shell脚本如何定义函数呢 ?
面试总结之Linux/Shell的更多相关文章
- 阿里Linux Shell脚本面试25个经典问答
转载: 阿里Linux Shell脚本面试25个经典问答 Q:1 Shell脚本是什么.它是必需的吗? 答:一个Shell脚本是一个文本文件,包含一个或多个命令.作为系统管理员,我们经常需要使用多个命 ...
- linux shell 中的sleep命令
开始还以为是这样的语法: sleep(1), 后面发现是: linux shell 中的sleep命令 分类: LINUX 在有的shell(比如linux中的bash)中sleep还支持睡眠(分,小 ...
- Linux shell脚本编程(三)
Linux shell脚本编程 流程控制: 循环语句:for,while,until while循环: while CONDITION; do 循环体 done 进入条件:当CONDITION为“真” ...
- Linux shell脚本编程(二)
Linux shell脚本编程(二) 练习:求100以内所有偶数之和; 使用至少三种方法实现; 示例1: #!/bin/bash # declare -i sum=0 #声明一个变量求和,初始值为0 ...
- Linux shell脚本编程(一)
Linux shell脚本编程: 守护进程,服务进程:启动?开机时自动启动: 交互式进程:shell应用程序 广义:GUI,CLI GUI: CLI: 词法分析:命令,选项,参数 内建命令: 外部命令 ...
- Linux Shell 流程控制语句
* 本文主要介绍一些Linux Shell 常用的流程控制语句* 1. if 条件语句:if-then/if-elif-fi/if- else-fi if [条件判断逻辑1];then command ...
- Linux Shell 截取字符串
Linux Shell 截取字符串 shell中截取字符串的方法很多 ${var#*/} ${var##*/} ${var%/*} ${var%%/*} ${var:start:len} ${var: ...
- Linux Shell 重定向与管道【转帖】
by 程默 在了解重定向之前,我们先来看看linux 的文件描述符. linux文件描述符:可以理解为linux跟踪打开文件,而分配的一个数字,这个数字有点类似c语言操作文件时候的句柄,通过句柄就可以 ...
- Linux Shell 通配符、元字符、转义符【转帖】
作者:程默 说到shell通配符(wildcard),大家在使用时候会经常用到.下面是一个实例: 1 1 2 3 4 [chengmo@localhost ~/shell]$ ls a.txt ...
随机推荐
- 【软件位置】Linux查看软件安装的位置
如果我们在Linux 系统上安装了某个软件,我们可以通过如下的三种方式来确定. 一. Which 命令 Shell 的which 命令可以找出相关命令是否已经在搜索路径中. 如: [ro ...
- UOJ #131 【NOI2015】 品酒大会
题目链接:品酒大会 学了后缀自动机之后再来写这道题就轻松多了…… 首先,题面中的两杯酒\(r\)相似就是这两个后缀的最长公共前缀大于等于\(r\).把串翻转过来之后就变成了两个前缀的最长公共后缀……然 ...
- angular大牛的博客
对angular的了解比亲娘还了解,http://each.sinaapp.com/angular/index.html 对angular比较深入的研究,这个人的所有博客都值得一看,这是7. http ...
- 递归--练习1--noi3089爬楼梯
递归--练习1--noi3089爬楼梯 一.心得 根据输入,是要写连续输入多个值的程序 二.题目 3089:爬楼梯 总时间限制: 1000ms 内存限制: 65536kB 描述 树老师爬楼梯,他可 ...
- BeginInit与EndInit的实践总结
在项目中,遇到这种情况,总结随便如下: 初始化时:添加操作,BeginInit{flag=true} 警情是一条条加入的,全部都加入后,图表再一次性生成 EndInit{flag=false} ...
- Hadoop Ambari 安装
ambari 1.2.4 下载地址:http://www.apache.org/dist/incubator/ambari/ambari-1.2.4/ambari-1.2.4-incubating.t ...
- <NET CLR via c# 第4版>笔记 第5章 基元类型、引用类型和值类型
5.1 编程语言的基元类型 c#不管在什么操作系统上运行,int始终映射到System.Int32; long始终映射到System.Int64 可以通过checked/unchecked操作符/语句 ...
- 1、lambda表达式
lambda表达式中的类型是通过上下文推断出来的,类似String[] strArr = {"as","sd"};右边元素的子类型. 匿名内部类的情况:需要引用 ...
- linux提权辅助工具(一):linux-exploit-suggester.sh
来自:https://raw.githubusercontent.com/mzet-/linux-exploit-suggester/master/linux-exploit-suggester.sh ...
- tornado框架的get方法传递参数
tornado框架的get方法传递参数,代码: # encoding: utf-8 """ @version: ?? @author: andu99 @contact: ...