1.Which is the command used to find the available shells in your Operating System Linux ?

Ans : $echo $shell

2.Which is the command used to view the environment variables?

Ans: printenv

3. How do you recall last command from the history list in Cshell ?

Ans: !!

4. How do you print the current job in Cshell ?

Ans: %%

5. Which is the command used to find the no of bytes in the file shell ?

Ans: du file name

6. Which is the command used to edits the input stream, line by line?

Ans: sed

7. What is the difference between finger and who?

Ans: Finger was a way to get information about a user from another system Who is used to find who all are using current machine.

8. Which are the Protocols used to access remote machines?

Ans: SSH ,RSH ,FTP

9. Which is the basic command while transfer a file from your home to the other user?

Ans: FTP

10. Which is command used to create a file Linus of zero bytes?

Ans: touch

11. Which is the command used to select parts of a line?

Ans: cut filename

12. How do you Find the free space of the hard disk in your home?

Ans: df filename

13. f a file A contains 200 bytes of data and file B contains 150 bytes of data, How do you say A is 50 bytes more than B?

Ans: cmp file A file B

14. Which is the command used to find the number of files in directory?

Ans: ls | wc -l

15. How will you change your shell?

Ans: tcsh

16. How will you change file permissions?

Ans: using chmod

17. Difference between find and locate?

Ans: Locate uses an internal database to look up indexed files. This database need to be updated using a command “updatedb”.
Find does only a normal search.

18. How will you search for a pattern
(String) in a file?

Ans: grep “string” filename

19. How will you kill a process? Give one
example?

Ans: 1. ps = It will list all processes on
that shells

2. kill process ID

20. How will you remove a file
interactively?

Ans: rm -i filename

21. Can we remove a nonempty directory? If
yes how?

Ans: rm -rf dirname

22. What do you mean by “su”? What is the
difference between “su” and “su -“?

Ans:su means switch user it changes the
shell we to key a exit to come back to previous shell.

23. How will you delete 50 lines in
vi?

Ans:50 dd in escape mode.

24. How will you search for a pattern in
vi?

Ans: ?pattern

25. How will you perform cut and paste in
vi?

Ans: dd for cut p for paste

26. How to list out the files in a
directory according to there size?

Ans: ls -S

27. How to insert a word as firstword for
all lines in the text?

Ans : sed -i s/word/firstword/

28. Which of the following characters is
used to signify the beginning of a line?
A. %
    B.
$
    C.
^
    D.
~

Ans : C

29. If you want to find every line in a
file that contains a number. Which of the following regular
expressions will accomplish this?
A. -n
    B.
"0 1 2 3 4 5 6 7 8 9"
    C.
[0-9]
    D.
[^0-9]

Ans : C

30.If you want to find all matches for two
distinctly different values. Which character is used to signify
that you want to match two values?
A. back slash (\)
    B.
forward slash (/)
    C.
pipe (|)
    D.
ampersand (&)

Ans : C

31. Which of the following should be used
to find "Sam" and "Samantha" in a file?
A. Sam(antha)*
    B.
Sam[antaha]
    C.
Sam|antha
    D.
Sam\(antha\)\?

Ans : B

32. Which of the following characters is
used to signify the end of a line?
A. %
    B.
$
    C.
^
    D.
~

Ans : B

33. What set of characters will be matched
if the expression is [1-9A-D]?
A. 123456789ABCDabcd
    B.
123456789ABCD
    C.
19ADad
    D.
19AD

Ans : B

34. Which of the following regular
expressions should be used to find lines that do not contain
numbers?
A. -n
    B.
"\0 \1 \2 \3 \4 \5 \6 \7 \8 \9"
    C.
[0-9]
    D.
[^0-9]

Ans : D

35. Which of the following can be checked
to see how many positional parameters were used to call a
script?
A. $#
    B.
$$
    C.
$!
    D.
$?

Ans : D

36. Which switch should be used with grep
to print all lines in a file that do not match the search criteria
given?
A. -i
    B.
-v
    C.
-c
    D.
-n

Ans : B

37. Which of the following would be the
result of the command echo 1{2,3,4}5 (choose all that apply)?
A. 15
    B.
125 135 145
    C.
12345
    D.1{2,3,4}5

Ans : B

38. Which switch should be used with grep
to ignore case as you look for matches in a file?
A. -i
    B.
-v
    C.
-c
    D.
-n

Ans : A

39. Which switch should be used with grep
to count all lines in a file that match the search criteria?
A. -i
    B.
-v
    C.
-c
    D.
-n

Ans : C

40. Which of the following utilities
processes most quickly?
A. grep B. egrep C. fgrep

Ans : The fgrep utility does not have the
same regular expression set as the other two, and is thus able to
execute the fastest hence ans is C.

41. Which of the following regular
expressions can be used to find all blank lines in a file?
A.""
    B.
^$
    C.
^" "$
    D.
[ ]

Ans : B

42. If the value of ALT is set to the
string "MPC", what will the command echo '$ALT' return?
A. $MPC
    B.
MPC
    C.
ALT
    D.
$ALT

Ans : D

43. Which is the command used to create
chain of directories?

Ans : mkdir -p dir1/dir2/dir3

44. Which is the command used to see two
files at a time?

Ans : vim -o filename1
filename2

45. What is the usage of top
command?

Ans : It will list all the currently
running processes on CPU.

46. How we can use a sed command as a head
command?

Ans : sed “5q” filename

47. What is the result of
“%s/Kacper/Kacpertech/g “?

Ans : Kacper will get replaced my another
string Kacpertech in all the lines of the file.

48. Which of the following interprets your
actions when typing at the command line for the operating
system?
a. Utility
    b.
Application
    c.
Shell
    d.
Command

Ans : C

49. Write a syntax for foreach loop in
shell script?

Ans : foreach variable name (some
list)
command1
command2
.........
end

50. How we can set the date and time for
the files?

Ans : using touch operator

linux FAQ(zz)的更多相关文章

  1. perl FAQ(zz)

    1. Why do you write a program in Perl? Ans : Easy to use and fast execution since perl script underg ...

  2. comp.lang.javascript FAQ [zz]

    comp.lang.javascript FAQ Version 32.2, Updated 2010-10-08, by Garrett Smith FAQ Notes 1 Meta-FAQ met ...

  3. verilog FAQ(zz)

    1. What is the race condition in verilog? Ans :The situation when two expressions are allowed to exe ...

  4. systemverilog FAQ(zz)

    1. What is clocking block? Ans: Clocking block can be declared using the keywords clocking and endcl ...

  5. XAMPP(Linux版-x86兼容)官网下载

    欢迎光临 XAMPP 的 Linux 版 (x86 兼容处理器版)顺便提一下:该软件以前被称作 LAMPP,但为了避免误解,我们将其重名命为 »XAMPP 的 Linux 版«.所以,如果您在寻找 L ...

  6. linux xampp常见问题

    一.常见问题 1.安装xampp4linux后,只能本机(http://localhost)访问,局域网内其他机器无法访问 解答:在/opt/lampp/etc中修改httpd.conf,将Liste ...

  7. XAMPP for Linux

     XAMPP 的 Linux 版图片集锦 安装过程仅 4 个步骤  步骤 1:下载 XAMPP PHP 5.4 XAMPP PHP 5.5  步骤 2:安装  步骤 3:开始运行  步骤 4:测试 使 ...

  8. [笔记]The Linux command line

    Notes on The Linux Command Line (by W. E. Shotts Jr.) edited by Gopher 感觉博客园是不是搞了什么CSS在里头--在博客园显示效果挺 ...

  9. Manual | BSD手册| Linux手册 | 数据库手册 | 编程开发手册 | WEB开发手册 | 软件应用手册 | 网络技术手册 | GNU手册

    豆豆手册 □ BSD手册 □ Linux手册 □ 数据库手册 □ 编程开发手册 □ WEB开发手册 □ 软件应用手册 □ 网络技术手册 □ GNU手册 在线手册 首 页 BSD手册   ·FreeBS ...

随机推荐

  1. Kafka备忘

    官网 http://kafka.apache.org/ 多生产者多消费者 多topic和多分区 多消费者组.每组中消息不能重复消费,组间不影响 启动 RunKafka(){ cd $kafka_hom ...

  2. Cocos2d-x教程(35)-三维拾取Ray-AABB碰撞检測算法

    欢迎增加Cocos2d-x 交流群:193411763 转载时请注明原文出处 :http://blog.csdn.net/u012945598/article/details/39927911 --- ...

  3. Python基础之初识递归

    初识递归 递归的定义: 在一个函数里再调用这个函数本身,这种魔性的使用函数的方式就叫做递归. 递归的最大深度--997 递归函数不受外力的阻止会一直执行下去,python为了杜绝此类现象,强制将递归层 ...

  4. HTML_<select>

    1.设置select只读不可编辑且select的值可传递 (1) <select onfocus="this.defaultIndex=this.selectedIndex;" ...

  5. 【ubantu】在Ubuntu上安装tar.gz,tar.bz以及deb文件(例:libreoffice安装)

    参考文章: https://blog.csdn.net/zhuquan945/article/details/52986712 ==================================== ...

  6. shell 遍历所有文件包括子目录

    1.代码简单,但是难在校验,不像python那么好理解 建议在Notepad++下编辑. 2.注意引用linux命令的`是[tab]键上面那个 3.if[] 这里 Error :  syntax er ...

  7. 由浅到深理解ROS(3)-命名空间

    全局命名空间: /rosout前面的反斜杠“/”表明该节点名称属于全局命名空间.之所以叫做全局名称因为它们在任何地方(包括代码.命令行工具.图形界面工具等的任何地方)都可以使用.无论这些名称用作众多命 ...

  8. SecureCRT的Home+End+Del键映射

    在securecrt界面:工具 → 键映射编辑器,在弹出的键盘中: 1.点击“home”,会弹出一个窗口,在“发送字符串”中输入:\033[1~ 2.点击“end”,会弹出一个窗口,在“发送字符串”中 ...

  9. ubuntu16.04下hive安装与配置

    Hive是什么? 由Facebook开源用于解决海量 结构化日志的数据统计: Hive是基于Hadoop的一个 数据仓库工具,可以将结构化的数据文件映射 成一张表,并提供类SQL查询功能: 构建在Ha ...

  10. zookeepeer ID生成器 (一)

    目录 写在前面 1.1. ZK 的分布式命名服务 1.1.1. 分布式 ID 生成器的类型 UUID方案 1.1.2. ZK生成分布式ID 写在最后 疯狂创客圈 亿级流量 高并发IM 实战 系列 疯狂 ...