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

转载于:https://www.cnblogs.com/zeushuang/p/3142889.html

linux FAQ(zz)相关推荐

  1. arm linux faq

    arm linux faq 早期的EDU用户,会遇到以太网能ping通,但无法telnet板子.板子无法mount LINUX PC的问题,这些都是因为以太网MAC地址非法所致,这个问题在2005年后 ...

  2. linux的zz命令,Linux top命令的使用

    本文件简单介绍一下Linux环境下top命令的使用. 1. top命令 top命令输出: # top top - 14:39:02 up 1 day, 2:46, 4 users, load aver ...

  3. verilog FAQ(zz)

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

  4. 学习Linux书籍大全

    第一部分:Linux基础应用  1.<Linux从入门到精通>  http://www.gouhuo.com/study/linuxbook.zip 2. Linux 系统安全与优化中文版 ...

  5. Linux电子书下载

    Linux电子书下载--第一部分: Linux基础应用 第一部分:Linux基础应用 1.<Linux从入门到精通> http://www.gouhuo.com/study/linuxbo ...

  6. linux xampp常见问题

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

  7. Oracle Linux 6.1 说明

    一.安装Oracle Linux 6.1 Oracle 搞自己的Linux 已经有几年的时间了,一致没怎么留意,今天特意关注了一下,从edelivery上下载了一个Oracle  Linux 6.1 ...

  8. js写的程序如何上线到linux,将 Node.js 应用发布到 Linux 应用服务 - Visual Studio | Microsoft Docs...

    将 Node.js 应用程序发布到 Azure(Linux 应用服务)Publish a Node.js application to Azure (Linux App Service) 11/22/ ...

  9. xampp for linux

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

最新文章

  1. 周末了,分享个休闲软件!你懂得!
  2. 线程间通信及虚假唤醒
  3. win7 asp虚拟服务器,win7怎么利用ASP获取服务器IP地址 win7利用ASP获取服务器IP地址教程...
  4. SP2010开发和VS2010专家食谱--第二章节--工作流
  5. 多线程学习笔记二 - 多线程与单例模式
  6. ubuntu-ln命令
  7. VMware 修复 Workstation、Fusion 和 ESXi中的多个漏洞
  8. 发送邮件 空格 java_java实现邮件发送功能
  9. 基于3DMM的三维人脸重建技术总结
  10. Unity基础到入门-导航系统(Navigation)
  11. 火车票查询软件测试自学,火车票订购系统的测试报告.doc
  12. 5行java关键代码实现excel转pdf代码实战教程
  13. python 小说爬虫_初次尝试python爬虫,爬取小说网站的小说。
  14. pwnable.kr第五题:passcode
  15. linux下qt打印功能如何实现,Qt Graphics-View的打印功能实现
  16. Mac M1芯片处理器能用的Bridge 2020/2019 for mac 解决M1版MAC安装BR无法安装问题 完美支持M1芯片处理器
  17. mac M1 安装navicat亲测有效
  18. idea安装及学生邮箱获取一年使用权
  19. 4_kicad 5.0_spice仿真器(AC,直流切换,失真,噪声,操作点,临界点,灵敏度,传递函数,瞬态,自定义)...
  20. 大数据可视化-绘制景点热力图

热门文章

  1. 表的基本查询(数据库篇)
  2. 关于longlong与位运算
  3. 【译】Google's AutoML: Cutting Through the Hype
  4. gRPC的那些事 - streaming
  5. Ransomware Locky Analysis
  6. Smalidea+IntelliJ IDEA/Android Studio动态调试安卓app教程
  7. 预言机、预言机网络、预测市场
  8. mysql查看系统运行日志文件_mysql自身运行日志文件详解
  9. linux进程卡住_鸿蒙系统,Linux? Android?
  10. linux连接到程序,Linux下C程序的链接过程