Which of the following commands will display the current cpu(s) detected by a linux system?
There are many reasons you might need to find out details about your computer hardware. For example, if you need help fixing something and post a plea in an online forum, people will immediately ask you for specifics about your computer. Or, if you want to upgrade your computer, you'll need to know what you have and what you can have. You need to interrogate your computer to discover its specifications. Show
The easiest way is to do that is with one of the standard Linux GUI programs:
Alternatively, you could open up the box and read the labels on the disks, memory, and other devices. Or you could enter the boot-time panels—the so-called UEFI or BIOS panels. Just hit the proper program function key during the boot process to access them. These two methods give you hardware details but omit software information. Or, you could issue a Linux line command. Wait a minute… that sounds difficult. Why would you do this? Sometimes it's easy to find a specific bit of information through a well-targeted line command. Perhaps you don't have a GUI program available or don't want to install one. Probably the main reason to use line commands is for writing scripts. Whether you employ the Linux shell or another programming language, scripting typically requires coding line commands. Many line commands for detecting hardware must be issued under root authority. So either switch to the root user ID, or issue the command under your regular user ID preceded by sudo: sudo <the_line_command>and respond to the prompt for the root password. This article introduces many of the most useful line commands for system discovery. The quick reference chart at the end summarizes them. Hardware overviewThere are several line commands that will give you a comprehensive overview of your computer's hardware. The inxi command lists details about your system, CPU, graphics, audio, networking, drives, partitions, sensors, and more. Forum participants often ask for its output when they're trying to help others solve problems. It's a standard diagnostic for problem-solving: inxi -FxzThe -F flag means you'll get full output, x adds details, and z masks out personally identifying information like MAC and IP addresses. The hwinfo and lshw commands display much of the same information in different formats: hwinfo --shortor lshw -shortThe long forms of these two commands spew out exhaustive—but hard to read—output: hwinfoor lshwCPU detailsYou can learn everything about your CPU through line commands. View CPU details by issuing either the lscpu command or its close relative lshw: lscpuor lshw -C cpuIn both cases, the last few lines of output list all the CPU's capabilities. Here you can find out whether your processor supports specific features. With all these commands, you can reduce verbiage and narrow any answer down to a single detail by parsing the command output with the grep command. For example, to view only the CPU make and model: To view just the CPU's speed in megahertz: lscpu | grep -i mhzor its BogoMips power rating: lscpu | grep -i bogoThe -i flag on the grep command simply ensures your search ignores whether the output it searches is upper or lower case. MemoryLinux line commands enable you to gather all possible details about your computer's memory. You can even determine whether you can add extra memory to the computer without opening up the box. To list each memory stick and its capacity, issue the dmidecode command: dmidecode -t memory | grep -i sizeFor more specifics on system memory, including type, size, speed, and voltage of each RAM stick, try: lshw -short -C memoryOne thing you'll surely want to know is is the maximum memory you can install on your computer: dmidecode -t memory | grep -i maxNow find out whether there are any open slots to insert additional memory sticks. You can do this without opening your computer by issuing this command: lshw -short -C memory | grep -i emptyA null response means all the memory slots are already in use. Determining how much video memory you have requires a pair of commands. First, list all devices with the lspci command and limit the output displayed to the video device you're interested in: lspci | grep -i vgaThe output line that identifies the video controller will typically look something like this: 00:02.0 VGA compatible controller: Intel Corporation 82Q35 Express Integrated Graphics Controller (rev 02)Now reissue the lspci command, referencing the video device number as the selected device: lspci -v -s 00:02.0The output line identified as prefetchable is the amount of video RAM on your system: ... Finally, to show current memory use in megabytes, issue: free -mThis tells how much memory is free, how much is in use, the size of the swap area, and whether it's being used. For example, the output might look like this: total used free shared buff/cache available The top command gives you more detail on memory use. It shows current overall memory and CPU use and also breaks it down by process ID, user ID, and the commands being run. It displays full-screen text output: Disks, filesystems, and devicesYou can easily determine whatever you wish to know about disks, partitions, filesystems, and other devices. To display a single line describing each disk device: lshw -short -C diskGet details on any specific SATA disk, such as its model and serial numbers, supported modes, sector count, and more with: hdparm -i /dev/sdaOf course, you should replace sda with sdb or another device mnemonic if necessary. To list all disks with all their defined partitions, along with the size of each, issue: lsblkFor more detail, including the number of sectors, size, filesystem ID and type, and partition starting and ending sectors: fdisk -lTo start up Linux, you need to identify mountable partitions to the GRUB bootloader. You can find this information with the blkid command. It lists each partition's unique identifier (UUID) and its filesystem type (e.g., ext3 or ext4): blkidTo list the mounted filesystems, their mount points, and the space used and available for each (in megabytes): df -mFinally, you can list details for all USB and PCI buses and devices with these commands: lsusbor lspciNetworkLinux offers tons of networking line commands. Here are just a few. To see hardware details about your network card, issue: lshw -C networkTraditionally, the command to show network interfaces was ifconfig: ifconfig -aBut many people now use: ip link showor netstat -iIn reading the output, it helps to know common network abbreviations:
The asterisks in this table are wildcard characters, serving as a placeholder for whatever series of characters appear from system to system. To show your default gateway and routing tables, issue either of these commands: ip route | column -tor netstat -rSoftwareLet's conclude with two commands that display low-level software details. For example, what if you want to know whether you have the latest firmware installed? This command shows the UEFI or BIOS date and version: What is the kernel version, and is it 64-bit? And what is the network hostname? To find out, issue: uname -aQuick reference chartThis chart summarizes all the commands covered in this article:
Do you have a favorite command that I overlooked? Please add a comment and share it. This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Which of the following is a type of software that allows a piece of hardware to host multiple operating system?Virtualization software — programs that allow you to run multiple operating systems simultaneously on a single computer — allows you to do just that. Using virtualization software, you can run multiple operating systems on one physical machine.
What command can be used to check different kinds of filesystems on Linux for errors?What command can be used to check different kinds of filesystems on Linux for errors? - chkdsk.
What file under the proc directory contains information regarding what modules are currently loaded into the Linux kernel?/proc/mdstat: This file contains the current information for multiple-disk, RAID configurations. /proc/meminfo: This file reports a large amount of valuable information about the system's RAM usage. /proc/modules: This file displays a list of all modules loaded into the kernel.
Which of the following will the Split command do on a file when no other options are specified?Which of the following will the split command do on a file when no other options are specified? It will split a file into new equally sized files that are 1/10th of the original file size.
|