background preloader

Command line

Facebook Twitter

GNU/Linux Command-Line Tools Guide - Finding information about the system. Time If you are looking for how to change the time please refer to date here: Section 8.1. time is a utility to measure the amount of time it takes a program to execute.

GNU/Linux Command-Line Tools Guide - Finding information about the system

It also measures CPU usage and displays statistics. Use time -v (verbose mode) to display even more detailed statistics about the particular program. Example usage: /proc The files under the /proc (process information pseudo file-system) show various information about the system. For example: Displays information about the CPU. To view information on what kernel-modules are loaded on your system. dmesg dmesg can be used to print (or control) the " kernel ring buffer". dmesg is generally used to print the contents of your bootup messages displayed by the kernel. Simply type: df Displays information about the space on mounted file-systems. Command syntax: The latter part is optional, you can simply use df with or without options to list space on all file-systems. users. Linux: Find Number of CPU Cores Command. How do I find out the number of CPU cores available under HP x86_64 Linux serer running on RHEL / Debian Linux 6.x?

Linux: Find Number of CPU Cores Command

You can use the lscpu or nproc command to display the number of processing units available to the current process, which may be less than the number of online processors (please note that not all server supports hotplug a CPU on a running Linux system). The proc file system is a pseudo-file system which is used as an interface to kernel data structures. It is commonly mounted at /proc. The /proc/cpuinfo file is nothing but a collection of CPU and system architecture dependent items, for each supported architecture a different list. Two common entries are processor which gives CPU number and bogomips; a system constant that is calculated during kernel initialization. Nproc Example The nproc command shows the number of processing units available: # nproc Sample outputs: Linux Display CPU Information Number of CPUs and Their Speed. How do I display CPU information like number of CPUs, threads, cores, sockets, NUMA nodes, information about CPU caches, CPU family, model and stepping and their speed on Linux operating systems?

Linux Display CPU Information Number of CPUs and Their Speed

You need to use Proc (/proc) file system provides information about CPU and their speed which is a pseudo-filesystem. It is used as an interface to kernel data structures. It is commonly mounted at /proc. Most of it is read-only, but some files allow kernel variables to be changed. You can also use the command called lscpu to display information on CPU architecture on modern Linux distributions. Task: Display the number of processors in Linux You need to use the /proc/cpuinfo file. You can narrow down the output with the following commands, to display number of processors in the system: $ grep processor /proc/cpuinfo Say hello to lscpu Warning : lscput command has bug and sometimes in Xen Dom0 kernel reports wrong data. 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X. An alias is nothing but shortcut to commands.

30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X

The alias command allows user to launch any command or group of commands (including options and filenames) by entering a single word. Use alias command to display list of all defined aliases. You can add user defined aliases to ~/.bashrc file. You can cut down typing time with these aliases, work smartly, and increase productivity at the command prompt. More about aliases The general syntax for the alias command for the bash shell is as follows. Task: List aliases Type the following command: alias Sample outputs: alias .. By default alias command shows a list of aliases that are defined for the current user. Task: Define / create an alias (bash syntax) To create the alias use the following syntax: alias name=value alias name='command'alias name='command arg1 arg2'alias name='/path/to/script'alias name='/path/to/script.pl arg1' alias c='clear' c Task: Disable an alias temporarily (bash syntax)