面试题总结之Linux/Shell

Posted 浩然

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了面试题总结之Linux/Shell相关的知识,希望对你有一定的参考价值。

Linux

 

Linux cshrc文件作用

Linux如何起进程/查看进程/杀进程

Linux 文件755 代表什么权限

Linux辅助线程

Linux进程间通信方法

  pipeline,msgq...

  进程间通信_百度百科

    http://baike.baidu.com/link?url=tLNXNQvG5Wo6NptnjkflYaUQbdqW5fC3n40Cv4iF4YSX5EzgfJgwIbZnAfpXLVV1QRvP1293Dgo9qRBmSVfME_

 

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

以上是关于面试题总结之Linux/Shell的主要内容,如果未能解决你的问题,请参考以下文章

Android 面试题总结之Android 基础

Android 面试题总结之Android 基础

Android 面试题总结之Android 基础

Android 面试题总结之Android 基础

Android 面试题总结之Android 基础

Android 面试题总结之Android 进阶