面试总结之Linux / Shell

All contents are moved to haoran119/linux (github.com).


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

46个Linux面试常见问题

面试中22 个 Linux 高频命令

面试 | Linux 下的动态链接库问题

面试 | Linux 下软链接和硬链接的区别

100 道 Linux 笔试题

10道常见的 Linux 面试题 (qq.com)

How to find log files ?

How to find and kill python process ?


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脚本如何定义函数呢 ?

常见的 shell 脚本面试题

posted on 2016-06-04 17:04  浩然119  阅读(437)  评论(0编辑  收藏  举报