Basic questions about Linux interview-Part 1

Source: Internet
Author: User
Tags dmesg

Continuing with our interview series, we have provided 10 questions in this article. These questions or questions in future articles may not be asked during the interview. However, through these articles, we present an interactive learning platform, which will certainly be of great help to you.

Since 11 basic Linux interview questions in the previous article in this series, we have analyzed the comments made by different forums, this is important for us to provide better articles to our readers. After we have paid time and money, what do we desire to return from you? The answer is no. If you cannot praise our work, please do not slander our work in comments.

If you haven't found anything new in the article, please do not forget that it is very useful to some people, and he or she will be very grateful for our work. We cannot make every article happy. But I hope readers can understand it as much as possible.

Series of articles:

11 basic Linux interview questions

Basic questions about Linux interview-Part 1

Basic questions about Linux interview-Part 1

Q.1: Which command is used to record a user logon session in a file?
  • Macro
  • Read
  • Script
  • Record
  • Sessionrecord

A: The 'script' Command records user logon session information in the file. This command can be used in shell scripts or directly on a terminal. The following is an example, which records everything that starts from the script to the end of the input exit.

The following command records a user logon session to a file:

[root@tecmint ~]# script my-session-record.txtScript started, file is my-session-record.txt

The recorded file named my-session-record.txt can be viewed in the following ways:

[root@tecmint ~]# nano my-session-record.txtscript started on Friday 22 November 2013 08:19:01 PM IST[root@tecmint ~]# ls^[[0m^[[01;34mBinary^[[0m ^[[01;34mDocuments^[[0m ^[[01;34mMusic^[[0m $^[[01;34mDesktop^[[0m ^[[01;34mDownloads^[[0m my-session-record.txt ^[[01;34$
Q.2: The following command can be used to view the kernel log information.
  • Dmesg
  • Kernel
  • Ls-I
  • Uname
  • None of the above

A: run the 'dmesg' command to view the logs of the kernel. In the preceding command, kernel is not a valid command. 'LS-I 'is used to list the index nodes of files in the working directory, while 'uname' is used to display the operating system information.

-

[root@tecmint ~]# dmesgInitializing cgroup subsys cpusetInitializing cgroup subsys cpuLinux version 2.6.32-279.el6.i686 (mockbuild@c6b9.bsys.dev.CentOS.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Fri Jun 22 10:59:55 UTC 2012KERNEL supported cpus:  Intel GenuineIntel  AMD AuthenticAMD  NSC Geode by NSC  Cyrix CyrixInstead  Centaur CentaurHauls  Transmeta GenuineTMx86  Transmeta TransmetaCPU  UMC UMC UMC UMCDisabled fast string operationsBIOS-provided physical RAM map:...
Q.3: Which command is used to display the Linux kernel release information?
  • Uname-v
  • Uname-r
  • Uname-m
  • Uname-n
  • Uname-o

A: 'uname-R' is used to display the distribution information of the kernel. Other parameters '-V','-m', '-n', and 'O' display the kernel version, hardware name, network node, host name, and operating system respectively.

-

[root@tecmint ~]# uname -r2.6.32-279.el6.i686
Q.4: Which command is used to identify the file type?
  • Type
  • Info
  • File
  • Which
  • Ls

A: the 'file' command is used to identify the file type. The syntax is 'file [Option] file name '.

-

[root@tecmint ~]# file wtopwtop: POSIX shell script text executable
Q.5: Which command is used to find the path of the binary file, source, and manual of a command?

A: 'whereis 'is driving! The 'whereis 'command is used to find the path of the binary file, source, and manual of a command.

-

[root@tecmint ~]# whereis /usr/bin/ftpftp: /usr/bin/ftp /usr/share/man/man1/ftp.1.gz
  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.