- Linux info command
- Description
- Syntax
- Options
- Examples
- Related commands
- 10 Commands to Collect System and Hardware Info in Linux
- 1. How to View Linux System Information
- 2. How to View Linux System Hardware Information
- 3. How to View Linux CPU Information
- 4. How to Collect Linux Block Device Information
- 5. How to Print USB Controllers Information
- 6. How to Print PCI Devices Information
- 7. How to Print SCSI Devices Information
- 8. How to Print Information about SATA Devices
- 9. How to Check Linux File System Information
- 10. How to Check Linux Hardware Components Info
- Summary
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- Get Information About a Command With Type Command in Linux
- Using type command in Linux
- 2. Type of an aliased command
- 3. Get the type of multiple commands
- 4. Force type to return the path of the commands
- 5. Get all information of the commands
- 6. Return only the type of command, not path
- Bonus: Why do you see “command is hashed”?
- List of Commands to get Linux system info using terminal
- Commands to View Linux System info using terminal
- 1. Check Linux system CPU info and Virtualization support
- 2. Know about Linux System RAM details
- 3. Find out BIOS Info on Linux using Dmidecode
- 4. Command to view hard disk and partition distribution
- 5. Check Network card information
- 6. View PCI Slots information on Linux system
- 6. USB controllers and attached devices
- 7. Command to get complete Linux OS information
- 8. Command to get Linux Kernel Information
- 9. View Real-time processes
- 9. Complete Linux System Hardware Information
Linux info command
On Unix-like operating systems, the info command reads documentation stored in the info format, developed by the Free Software Foundation.
Description
The info format is similar to that of man, the traditional Unix manual format. Info additionally provides a robust structure for linking pages together, similar to hyperlinks. Info pages are made using the texinfo tools, and can link with other pages, create menus and ease navigation in general.
The default location of info documentation is /usr/share/info.
Syntax
Options
-k, —apropos=STRING | Look up STRING in all indices of all manuals. |
-d, —directory=DIR | Add DIR to INFOPATH. |
—dribble=FILENAME | Remember user keystrokes in FILENAME. |
-f, —file=FILENAME | Specify Info file to visit. |
-h, —help | Display this help and exit. |
—index-search=STRING | Go to node pointed by index entry STRING. |
-n, —node=NODENAME | Specify nodes in first visited Info file. |
-o, —output=FILENAME | Output selected nodes to FILENAME. |
-R, —raw-escapes | Output «raw» ANSI escapes (default). |
—no-raw-escapes | Output escapes as literal text. |
—restore=FILENAME | Read initial keystrokes from FILENAME. |
-O, —show-options, —usage | Go to command-line options node. |
—subnodes | Recursively output menu items. |
—vi-keys | Use vi-like and less-like key bindings. |
—version | Display version information and exit. |
-w, —where, —location | Print physical location of Info file. |
MENU-OPTION, if present, is the menu entry to start from; it is searched for in all ‘dir’ files along INFOPATH. If it is not present, info merges all ‘dir’ files and shows the result. Any remaining arguments are treated as the names of menu items relative to the initial node visited.
For a summary of key bindings, type h within info.
Examples
Start at emacs node from top-level dir.
Start at node with emacs command line options.
Show file ./foo.info, not searching dir,
Shows the top-level info page.
Output all information on the vi command, with any subnodes of information, to the file all-vi-info.txt.
Related commands
man — Display the manual page of a given command.
whatis — Display short manual page descriptions.
Источник
10 Commands to Collect System and Hardware Info in Linux
It is always a good practice to know the hardware components of your Linux system is running on, this helps you to deal with compatibility issues when it comes to installing packages, drivers on your system using yum, dnf, or apt.
10 Commands to Check Hardware and System Information in Linux
Therefore in these tips and tricks series, we shall look at some useful commands that can help you to extract information about your Linux system and hardware components.
1. How to View Linux System Information
To know only the system name, you can use the uname command without any switch that will print system information or the uname -s command will print the kernel name of your system.
To view your network hostname, use the ‘-n’ switch with the uname command as shown.
To get information about kernel-version, use the ‘-v’ switch.
To get the information about your kernel release, use the ‘-r’ switch.
To print your machine hardware name, use the ‘-m’ switch:
All this information can be printed at once by running the ‘uname -a’ command as shown below.
2. How to View Linux System Hardware Information
Here you can use the lshw tool to gather vast information about your hardware components such as cpu, disks, memory, usb controllers, etc.
lshw is a relatively small tool and there are few options that you can use with it while extracting information. The information provided by lshw was gathered from different /proc files.
Note: Do remember that the lshw command is executed by the superuser (root) or sudo user.
To print information about your Linux system hardware, run this command.
You can print a summary of your hardware information by using the -short option.
If you wish to generate output as an html file, you can use the option -html.
Generate Linux Hardware Information in HTML
3. How to View Linux CPU Information
To view information about your CPU, use the lscpu command as it shows information about your CPU architecture such as a number of CPUs, cores, CPU family model, CPU caches, threads, etc from sysfs and /proc/cpuinfo.
4. How to Collect Linux Block Device Information
Block devices are storage devices such as hard disks, flash drives, etc. lsblk command is used to report information about block devices as follows.
If you want to view all block devices on your system then include the -a option.
5. How to Print USB Controllers Information
The lsusb command is used to report information about USB controllers and all the devices that are connected to them.
You can use the -v option to generate detailed information about each USB device.
6. How to Print PCI Devices Information
PCI devices may include usb ports, graphics cards, network adapters, etc. The lspci tool is used to generate information concerning all PCI controllers on your system plus the devices that are connected to them.
To print information about PCI devices run the following command.
Use the -t option to produce output in a tree format.
Use the -v option to produce detailed information about each connected device.
7. How to Print SCSI Devices Information
To view all your scsi/sata devices, use the lsscsi command as follows. If you do not have the lsscsi tool installed, run the following command to install it.
After installation, run the lsscsi command as shown:
Use the -s option to show device sizes.
8. How to Print Information about SATA Devices
You can find some information about sata devices on your system as follows using the hdparm utility. In the example below, I used the block device /dev/sda1 which is the hard disk on my system.
To print information about device geometry in terms of cylinders, heads, sectors, size, and the starting offset of the device, use the -g option.
9. How to Check Linux File System Information
To gather information about file system partitions, you can use the fdisk command. Although the main functionality of the fdisk command is to modify file system partitions, it can also be used to view information about the different partitions on your file system.
You can print partition information as follows. Remember to run the command as a superuser or else you may not see any output.
10. How to Check Linux Hardware Components Info
You can also use the dmidecode utility to extract hardware information by reading data from the DMI tables.
To print information about memory, run this command as a superuser.
To print information about the system, run this command.
To print information about BIOS, run this command.
To print information about the processor, run this command.
Summary
There are many other ways you can use to obtain information about your system hardware components. Most of these commands use files in the /proc directory to extract system information.
Hope you find these tips and tricks useful and remember to post a comment in case you want to add more information to this or if you face any difficulties in using any of the commands. Remember to always stay connected to Tecmint.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник
Get Information About a Command With Type Command in Linux
The type command is a built-in bash shell command that can provide the type of a specified command.
What does it mean by the “type of a command”? It means that you can get information like whether a Linux command is built-in shell command, where is its executable located and whether it is aliased to some other command.
It may seem like it’s not of much use but believe me it could come handy while investigating why a command is behaving in a certain way.
Using type command in Linux
The syntax for the type command is simple:
To get started, let’s use the type command without options on the well-known echo command:
It tells us that echo is a shell built-in command. This is the type of command that would run if the name echo is interpreted by the command line.
Let’s try something else:
In the above case, it locates the executable of the mkdir command. This is similar to the which command but type is faster because it is a built-in shell command.
If you use it with something that is not a command, it gives a not found error.
2. Type of an aliased command
You’re probably already familiar with aliases in Linux. To quickly recall, these are pseudo commands that work like shortcuts. They can be set in your shell profile.
Let’s see what kind of information type command finds when you use it on an aliased command:
As you can see, it shows the real command behind the aliased one.
3. Get the type of multiple commands
You can also use type with multiple commands and get the results echoed back to us.
On Ubuntu and some other distributions, ls is aliased to show you a colorful output. This helps you in distinguishing the symlinks, hard links, directories, executable and other different type of files.
4. Force type to return the path of the commands
If you want to locate the executable of a command and type keeps giving output like built-in shell and alias information, you can force to get the path with -P option.
This will return the path name even if it is an alias, built-in, or function.
5. Get all information of the commands
We can get the most complete information using option -a.
This shows us both the type information and every location on the system path with the file.
6. Return only the type of command, not path
Here’s different type you can get:
You can prompt for only the type with the -t option. Here are a few examples:
Bonus: Why do you see “command is hashed”?
Some times when you’ll see an output like command is hashed along with the path to the executable:
To avoid spending too much time on searching the path of an executable, the shell often keeps a list of program it has found in the past. This list is called ‘hash’.
When you see an output liked ‘command is hashed’, it means that the type command is returning the result from the already performed searches. You can use hash -r to force the shell to search from scratch.
Conclusion
I hope you learned something new today with this introduction of the type command in Linux. I find it similar to the file command which is used for getting information about files.
If you like this guide, please share it on social media. If you have any comments or questions, leave them below. If you have any suggestions for topics you’d like to see covered, feel free to leave those as well. Thanks for reading.
Источник
List of Commands to get Linux system info using terminal
In Linux, we can use the command terminal to check various system hardware configurations and information such as CPU, Memory, hard disk, etc., and here are those to use…
Although there are tools that can display Linux system info graphically, however, here we are going to use the inbuilt commands.
The question of how a system is equipped and how it performs in harsh everyday life is not only of theoretical interest. Lot’s of time to solve a problem we need to know hardware and its utilization to remove some bottleneck. Thus, if you are new to Linux systems or running any cloud server where you want to know about the system load, the network interface, and type of processor and chipset, or what hardware is actually in the system? Then here some top commands to follow…
Commands to View Linux System info using terminal
Here we are using Ubuntu 20.04 to display the results of the Linux system info commands, however, you can use them on older versions such as Ubuntu 18.04/16.04 including RPM-based distros like CentOS and RHEL. Apart from them, others are also supported such as Debian, Linux Mint, Kali, Elementary OS, Manjaro, and more.
1. Check Linux system CPU info and Virtualization support
To check out the full information of Linux system’s CPU such as Type of Architecture (i386, x86_64, etc.) (32-bit or 64-bit), Socket, Cores per socket, CPU speed, L cache, Virtualization type or support, etc. use the below given single command:
Furthermore, you can also check each CPU in detail (CPU model, frequency, etc.) of your computer, laptop, or server using:
Output:
2. Know about Linux System RAM details
Check out free Memory on your Linux system along with details of its size and hardware information.
To print free available RAM, type:
Those who are interested in full detail such as Total Memory, Free Memory, Buffers, Cache, Swap cached, Active, mapped, and more… can go for this one:
To identify each RAM used on each memory slot of your system’s motherboard, print the Memory Controller information using the dmidecode command:
3. Find out BIOS Info on Linux using Dmidecode
Dmidecode dumps the DMI (Desktop Management Interface) information of the machine in a readable way. This information includes hardware and BIOS.
You can get the current configuration and the maximum configuration supported by the system, such as the maximum amount of memory supported that we already have shown above…
Therefore, here are some uses of the dmidecode command to know further details of the system as well such as BIOS version, motherboard, and processor.
If you want to view all Linux useful system information use this one. However, it will give a lot of information.
4. Command to view hard disk and partition distribution
Do you want to know about each size of Hard disk and partition available? Then use-
OutPut:
Furthermore, those who want to dig more on hard disk and partitions, then to have each detail of the installed drives run fdisk -l with sudo rights:
Output
To get a clear view and all information along with the type of file system and partitions mounted points, we can also use:
Mount points can be further elaborated with:
5. Check Network card information
The network card installed on our Linux system is one of the important components to connect the internet and other local networks. However, to know its model, manufacturer, and other information without operating the system’s case, use the below-given commands.
Find out the IP address and available active ethernet interfaces:
Now, after using the above command you get the IP address and active ethernet interface, just use that with the below command. For example, ens33 is our interface.
The ethtool will show all information about the network card bandwidth such as what is the max speed, supported link modes, ports, and more…
To get network information we can also use Net-tools, however, we need to install it because by default it would not available on the system.
For Debian/Ubuntu: sudo ap tinstall net-tools
For RHEL/CentOS/Fedora– sudo yum install net-tools or sudo dnf install net-tools
To know Ipaddress:
For getting details of active connections, protocols, domain sockets, and more…
6. View PCI Slots information on Linux system
PCI slots, where we use graphic cards, network cards, and other third-party hardware directly on the Motherboard. To know about these PCI hardware slots run:
If you want more detailed information: lspci -v or lspci -vv
To see the device tree: lscpi -t
6. USB controllers and attached devices
View the details of USB slots and the devices plugged into them using lsusb command:
To have detailed info on USB slots and their active devices use :
7. Command to get complete Linux OS information
When we are running a Linux server and after upgrading or having installation, in case we want to know what version of Linux operating system we are using then, that is possible as well using the command terminal.
Get release info only:
8. Command to get Linux Kernel Information
A kernel, which is the core part of our Linux system, to check out which version we on before updating or after, run:
9. View Real-time processes
To go a bit further and know PID (Process ID, Unique number of the process) of the process executed on the system along with what is currently active we can use two commands:
To check out the PID (Process ID, Unique number of the process) of the process.
Real-time display of process status
A top is a text-based tool that gives complete information of currently active processes in real-time. To exit it, press Ctrl+C.
9. Complete Linux System Hardware Information
Here is the one final command that can give all the hardware information of your Linux system in a single shot. However, displaying all data in one place may feel clutter but if you don’t want to use multiple commands, then this one is for you.
Those who want to omit the slight unwanted information can use the same command with a short flag.
The good thing, if you want to print or save your Linux system hardware information in HTML format then that is also possible using lshw, simply run:
you will see the created file.
Now, open your browser and type or paste: file:///home/ubuntu/lshw-info.html
Closing thoughts:
So, these were some common commands we can use to find out Linux system info on CPU, Memory, OS, kernel, Network, and more. Although, these are not the only there are so many others, so keep searching this big world of Linux. If you know some commands to get a better view of the Linux system then the comment section is all yours…
Источник