Linux Command Execution monitoring and software installation, linux Command Software Installation

Source: Internet
Author: User
Tags virtual environment

Linux Command Execution monitoring and software installation, linux Command Software Installation
Monitoring command Run time command

Linux command operation monitoring and software installation, linux command software installation
Run time monitoring command

$ time sleep 5
real 0m5.003s # The time from the start to the end of the program, including the time slice and IO time occupied by other processes
user 0m0.001s # process real execution takes up CPU time
sys 0m0.002s # CPU time consumed by the process in the kernel
user + sys is the actual CPU time of the process. If multi-threaded execution, this time may be greater than Real. If IO is the bottleneck, real will be greater than user + sys (single thread). View the running command and its resource usage top Statistics area First line: task queue information, same as the execution result of uptime command
17:32:34: Current system time
up 3 days, 8:04: the running time of the host
5 users: the number of user connections (not the number of users, who command)
load average: 0.09, 0.12, 0.19: system average load, statistics of the system average load of the last 1, 5, 15 minutes
Supplement: uptime -V queryable version Second line: process information
Tasks: 287 total: the total number of processes
2 running: the number of running processes
285 sleeping: number of sleeping processes
0 stopped: number of stopped processes
0 zombie: number of zombie processes
Third line: CPU information (when there are multiple CPUs, these contents may exceed two lines)
1.5 us: percentage of user space in CPU
0.9 sy: percentage of CPU occupied by kernel space
0.0 ni: CPU percentage of processes whose priority has been changed in user process space
97.5 id: percentage of idle CPU
0.2 wa: percentage of CPU time waiting for input and output
0.0 hi: hardware CPU interrupt occupancy percentage
0.0 si: percentage of soft interrupt occupancy
0.0 st: virtual machine occupancy percentage
The fourth line: memory information (similar to the information in the fifth line and the free command)
8053444 total: Total physical memory
7779224 used: Total memory used
274220 free: total free memory (free + used = total)
359212 buffers: amount of memory used as kernel cache
Fifth line: swap information

8265724 total: total exchange partition
33840 used: the total number of swap partitions used
8231884 free: total free exchange area
4358088 cached Mem: the total amount of buffered swap area, the contents of the memory are swapped out to the swap area, and then swapped into the memory, but the used swap area is not overwritten, the contents of the swap area already exist in the memory The size of the swap area, when the corresponding memory is swapped out again, there is no need to write to the swap area.
Process Information Area
PID: process id
PPID: parent process id
RUSER: Real user name (read a lot, it is written in this way, do not know what is the difference with the user, welcome to add here)
UID: id of process owner
USER: the user name of the process owner
GROUP: process owner's group name
TTY: terminal name to start the process. Processes not started from the terminal are displayed as?
PR: Priority
NI: nice value. Negative values indicate high priority, positive values indicate low priority
P: The last CPU used only makes sense in a multi-CPU environment
% CPU: the percentage of CPU time taken from the last update to the present
TIME: Total CPU time used by the process, in seconds
TIME +: Total CPU time used by the process, in units of 1/100 second
% MEM: the percentage of physical memory used by the process
VIRT: The total amount of virtual memory used by the process, in kb. VIRT = SWAP + RES
SWAP: The amount of swapped out virtual memory used by the process
RES: the size of the physical memory used by the process that has not been swapped out
CODE: physical memory size occupied by executable code
DATA: physical memory occupied by the part other than executable code (data segment + stack)
SHR: shared memory size
nFLT: page fault count
nDRT: the number of pages that have been modified since the last writing to the present
S: process state (D = uninterruptible sleep state, R = running, S = sleep, T = track / stop, Z = zombie process)
COMMAND: Command name / line
WCHAN: If the process is sleeping, the name of the system function in sleep is displayed
Flags: Mission flags
By default, only the more important columns are displayed. File system and disk information monitoring View system hard disk size and allocation
df -h
du -sh *
Software installation Unlike windows, software installation in Linux is more diverse and some are more complicated. Each installation method has its own advantages and limitations, and may also encounter problems. After we understand the principle, with Google, we can better help solve problems. System package manager installation The most convenient software installation and generally not easy to go wrong is to use the package management tool that comes with the system, which can solve most of the dependency problems. But there are some shortcomings, mainly three points:
Root user permissions are required.
If the system version is older, the installed software version will be older. With the new version, conflicts sometimes occur.
Many software in bioinformatics are not in the source of the system installation.
To solve these problems, you need to go to the software's official website to find the latest distribution package. There are two possibilities. One is that the distribution package is directly compiled software. You can download and set the executable attributes and put them into environment variables to run. , Such as blast or bowtie. The other is the need to compile and install from the source code, the following mainly explains this. Source code compilation and installation Source code compilation classic trilogy configure, make, make install. If there is no problem, it will be installed step by step. But if something goes wrong, it is not easy to solve. If you know the mechanism behind this, it will be very helpful to solve the problem. configure is a tool to check whether the system's library files, class files, dependent software exist and whether their versions meet the requirements, and generate Makefiles based on the actual test results. Generally it is a combination of a bunch of bash commands. Usually also need to configure some parameters in this step. The most commonly used is to specify the software installation directory --prefix = / home / ct / soft / specific_name. make is the specific compilation process. The compiled statements are written in the Makefile. Make compiles the first target that appears in the Makefile by default. You can also specify the target to compile, and compile all dependent things in turn according to the setting of the Makefile. The usual format and layout of Makefile is as follows
# Assume that the contents of the Makefile in the current folder are as follows
# first: target name
# echo "compile first": the command corresponding to the target, any Linux command can be
$ cat Makefile
first:
    echo "compile first"
all: first second
    echo "compile all"
second:
    echo "compile second"
 
# Run make directly, it will make the first target
$ make
echo "compile first"
compile first
# make first is the same as direct make because it appears in the first
$ make first
echo "compile first"
compile first
# all depends on first, second, so make all will execute make first, make second
# Then is the command that he represents
$ make all
echo "compile first"
compile first
echo "compile second"
compile second
echo "compile all"
compile all
For some software installations, executable programs are obtained after make is executed. You can skip the make install process and just put in environment variables to run. But some software also needs some dependencies, so you need to execute make install to complete the installation.
Make install usually copies the executable files or dependent library files (if any) compiled by make to the directory specified by --prefix when configuring.
Put the installed software into the environment variables, you can run happily.
Two points to note:
The most difficult problem to solve from source compilation is the lack of dependent library files, header files, dependent software, or versions that do not match. There is no unified solution. The principle is to make up for what is missing. Anaconda, mentioned later, will provide a simple solution to the dependence of library files.
During each step of the trilogy, more information will be output on the screen. Be sure to carefully check whether there is ERROR in the end. It will be helpful to determine whether the software is successfully installed and how to solve the problem in the next step.
The general methods for installing Linux packages are mainly these, and two virtual installation methods will be mentioned later, which are proposed to simplify the installation. Installation of Python packages Before the emergence of Anaconda (or its predecessor canopy), Python packages were known for their chaotic management and difficult installation. With Anaconda, not only the installation of the python package is simple, but the installation of other software is also convenient (see the two benefits of Anaconda later).
First download the Anaconda installation package https://www.continuum.io/downloads.
Anaconda's installation package is very user-friendly, a bash script, just run bash Anacond * x86_64.sh, and then follow the prompts.
After installation, the environment variables can be used after setting or refreshing.
After that, you only need to execute pip install pakcage_name or conda install pakckage_name to install the python package.
The only thing to note here is to confirm that the python or pip used is indeed the python or pip installed by Anaconda.
which python view the python command used.
If you are using the system default python, you need to check the environment variable settings.
Two benefits of Anaconda 1. Header file and library file library This is the directory structure after Anaconda installation
bin envs Examples imports lib LICENSE.txt pkgs share var
conda-meta etc gcc include lib64 mkspecsplugins ssl
In the lib directory, part of it depends on the dynamic link library, .so file; this is also the most common roadblock when compiling the source code. Usually, just put this directory in the environment variable LD_LIBRARY_PATH such as export LD_LIBARY_PATH = $ {LD_LIBARY_PATH}: anaconda_path / lib to solve the problem.
cairo libitm.a libQtScript.so.4
cmake libitm.la libQtScript.so.4.8
engines libitm.so libQtScript.so.4.8.7
gcc libitm.so.1 libQtScriptTools.la
gcj-4.8.5-14 libitm.so.1.0.0 libQtScriptTools.prl
glib-2.0 libitm.spec libQtScriptTools.so
libargtable2.a libjpeg.a libQtScriptTools.so.4
libargtable2.la libjpeg.la libQtScriptTools.so.4.8
libargtable2.so libjpeg.so libQtScriptTools.so.4.8.7
libargtable2.so.0 libjpeg.so.8 libQtSql.la
libargtable2.so.0.1.8 libjpeg.so.8.4.0 libQtSql.prl
libasan.a libmkl_avx2.so libQtSql.so
libasan.la libmkl_avx512_mic.so libQtSql.so.4
libasan_preinit.o libmkl_avx512.so libQtSql.so.4.8
libasan.so libmkl_avx.so libQtSql.so.4.8.7
2. bioconda bioconda provides a virtual environment to facilitate software compilation and installation. The installation of R package needs to pay attention to the version of the dependent software or library file. The same lib library provided by Anaconda can also be used directly.

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.