面试总结之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 ...
随机推荐
- POJ 1159 Palindrome(最长公共子序列)
http://poj.org/problem?id=1159 题意: 给出一个字符串,计算最少要插入多少个字符可以使得该串变为回文串. 思路: 计算出最长公共子序列,再用原长-LCS=所要添加的字符数 ...
- 爬虫模拟登陆之formdata表单数据
首先HTTP协议是个无连接的协议,浏览器和服务器之间是以循环往复的请求回复来交互的,交互的形式是以文件形式来进行的.比如在chrome开发者工具network中看到了 每一行是一个文件,又文件大小啊, ...
- 一次由webview报错引起的追根溯源
最近客户端那边需要搞了个h5嵌入app,想想是移动端的webview,前端这边也比较忙.就没想太多,直接用了async/await处理api数据,于是就不怪测试就来搞事情了... 一.error: 1 ...
- [Kafka] - Kafka Java Consumer实现(二)
Kafka提供了两种Consumer API,分别是:High Level Consumer API 和 Lower Level Consumer API(Simple Consumer API) H ...
- vue-router与v-if实现tab切换的思考
vue-router 该如何使用 忽然碰到一个常见的问题,明明可以使用 v-if / v-show 可以的解决的问题,有没有必要是使用 vue-router来解决. 比如常见的 tab 切换.一时间, ...
- 002——php字符串中的处理函数(一)
<?php /** * 字符串处理函数: * 一.PHP处理字符串的空格: * strlen 显示字符串长度 * * trim 对字符串左右空格删除: * ltrim 对字符串左侧空格删除 * ...
- 前序+中序->后序 中序+后序->前序
前序+中序->后序 #include <bits/stdc++.h> using namespace std; struct node { char elem; node* l; n ...
- iptables Configuration
iptables usage: Add Rules: iptables -I INPUT -p tcp --dport -j ACCEPT iptables -I INPUT -p tcp --dpo ...
- Mac iStat Menu 注册码
9185-4915-3252-3716-0000 1574-5977-7956-8062-0000 6015-5448-3282-4975-0000 9665-5955-6856-2071-0000 ...
- selenium对应三大浏览器(谷歌、火狐、IE)驱动安装
selenium:v3.7.0 一.谷歌浏览器 chromdriver.exe 根据自己谷歌浏览器版本安装对应chromedriver的版本. 我电脑谷歌版本是65的,装的v2.36版,链接:http ...