No more processes linux

No more processes linux

а может всетки по пиву?:beer: :kar: :gman:

ну а терь выдай ка мне то что у тебя выводица при комманде chkconfig —list
если савсем не грузица — грузись с диска в recovery console

а теперь напишу повесть как грамотно грузица.
скажем у тебя т-ка монтирования / находица на /dev/hda2
загружаемся с любова livecd. потом монтируем скажем в /mnt/hda2 /-раздел
потом монтируем proc коммандой вида:
mount -t proc none /mnt/hda2/proc (ну или куда там раньше proc монтировались. =) )
потом chroot /mnt/hda2

и вот оно. ты пачти в своей родной системе с правами root. =)

делаешь chkconfig —list и выкладываешь рез-тат сюда. smoke:

ЗЫ: А может все таки по пиву? :gman:

Можно и по пиву;)
Результат chkconfig —list:

microcode_ctl 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
gpm 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
kudzu 0:выкл 1:выкл 2:выкл 3:вкл 4:вкл 5:вкл 6:выкл
syslog 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
netfs 0:выкл 1:выкл 2:выкл 3:вкл 4:вкл 5:вкл 6:выкл
network 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
random 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
rawdevices 0:выкл 1:выкл 2:выкл 3:вкл 4:вкл 5:вкл 6:выкл
saslauthd 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
keytable 0:выкл 1:вкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
mdmonitor 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
atd 0:выкл 1:выкл 2:выкл 3:вкл 4:вкл 5:вкл 6:выкл
irda 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
psacct 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
apmd 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
isdn 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
iptables 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
ip6tables 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
pcmcia 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
irqbalance 0:выкл 1:выкл 2:выкл 3:вкл 4:вкл 5:вкл 6:выкл
sendmail 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
smartd 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
autofs 0:выкл 1:выкл 2:выкл 3:вкл 4:вкл 5:вкл 6:выкл
netdump 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
sshd 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
portmap 0:выкл 1:выкл 2:выкл 3:вкл 4:вкл 5:вкл 6:выкл
nfs 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
nfslock 0:выкл 1:выкл 2:выкл 3:вкл 4:вкл 5:вкл 6:выкл
snmptrapd 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:вкл 6:выкл
rhnsd 0:выкл 1:выкл 2:выкл 3:вкл 4:вкл 5:вкл 6:выкл
crond 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
cups 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
snmpd 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:вкл 6:выкл
hpoj 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
xfs 0:выкл 1:выкл 2:вкл 3:вкл 4:вкл 5:вкл 6:выкл
ntpd 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
winbind 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
smb 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:вкл 6:выкл
dc_client 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
dc_server 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
httpd 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:вкл 6:выкл
aep1000 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
bcm5820 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл
named 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:вкл 6:выкл
tux 0:выкл 1:выкл 2:выкл 3:выкл 4:выкл 5:выкл 6:выкл

Читайте также:  Что делать если компьютер не видит вай фай windows 10

Загружается нормально, просто не вырубается.:(

текс. это сразу меняет дело.
это все не с проста.
тут нада скрипты выключения смотреть.
какой коммандой выклюцаешься?

где сервера стоят. т.е. в каком городе живешь?

Источник

How to List Running Processes in Linux: A Beginner’s Guide

Need to view all running processes on your Linux server and discover which consumes your resources the most? Look no further, because, in this article, we’ll explain how to list Linux processes by using several common commands.

Introduction to Linux Processes

A process is the execution of a program. They can be launched when opening an application or when issuing a command through the command-line terminal.

A command can only generate a process. However, an application can run multiple processes for different tasks. For instance, Google Chrome will start a different process each time a new tab is opened.

Each Linux process is assigned a unique PID (process identification number). If there are no possible combinations left, the system can reuse old PIDs for newer processes.

A process can be initiated as a foreground or background process.

By default, all commands that run in the shell will start as foreground processes. As the process occupies the shell, you have to wait until it is finished before executing other commands.

If a command takes too long to complete, you can run it as a background process by adding an ampersand (&) at the end of the command so you can use the shell for other tasks.

Occasionally, processes may consume a lot of resources and need to be killed. Alternatively, times when you may want to change the priority level of a process, so the system will allocate more resources to it. Regardless of the case, all these tasks require you to do the same thing: listing the running processes on Linux.

How to List Running Processes in Linux?

There are several commands that you can use to list running processes: ps, top, and htop.

Utilizing the “ps” Command

The ps (process statuses) command produces a snapshot of all running processes. Therefore, unlike the Windows task manager, the results are static.

When this command is used without any additional argument or option, it will return a list of running processes along with four crucial columns: the PID, terminal name (TTY), running time (TIME), and the name of the command that launches the process (CMD). You can use ps aux to get more in-depth information about your running processes. Here’s a breakdown of each argument:

  • a option outputs all running processes of all users in the system.
  • u option provides additional information like memory and CPU usage percentage, the process state code, and the owner of the processes.
  • x option lists all processes not executed from the terminal. A perfect example of this are daemons, which are system-related processes that run in the background when the system is booted up.

If you want to list Linux processes in a hierarchical view, use the ps -axjf command. In this format, the shell will put child processes under their parent processes. Aside from those two options, here are some other common examples of the ps command that list running processes in Linux:

  • ps -u [username] lists all running processes of a certain user.
  • ps -e or ps -A displays active Linux processes in the generic UNIX format.
  • ps -T prints active processes that are executed from the terminal.
  • Ps -C process_name will filter the list by the process name. In addition, this command also shows all child processes of the specified process.
Читайте также:  Как отключить брандмауэр windows server 2016

Using the “top” Command

The top command is used to discover resource-hungry processes. This Linux command will sort the list by CPU usage, so the process which consumes the most resources will be placed at the top.

Unlike the ps command, the output of the top command is updated periodically. That means you’ll see real-time updates for CPU usage and running time. Once the shell returns the list, you can press the following keys to interact with it:

Keys Functions
k Kills a process
M Sorts the list by memory usage.
N Sorts the list by PID.
r Changes the priority of a process.
h Displays the help window.
z Displays running processes in colors.
d Changes the refresh time interval.
c Displays the absolute path of a process.
CTRL+C or q Stops the top command.

Keep in mind that the keys above are case sensitive, so be sure not to enable the caps lock.

Running “htop” Command

Both the htop and top command display the same information when listing your Linux processes, but the former offers user-friendly features that are great for everyday process management.

First thing first, the htop command allows you to scroll vertically and horizontally. As such, you can see the complete list of your Linux processes along with their full command lines.

What’s more, the command allows you to use a mouse to select items, kill processes without inserting their PIDs, change the priority of multiple processes easily, and so on.

Unfortunately, most Linux distributions don’t have this command right out of the box, so you need to install it manually.

If you use Ubuntu, you can install htop by running the following command:

Once installed, type htop, and you’ll get a list of all your Linux processes. Just like the previous command, htop also has several keyboard shortcuts:

Keys Functions
F9 To kill a process.
F8 Increase the priority of a process.
F7 Decrease the priority of a process.
F6 Sort processes by any column.
F5 Display processes in a tree view.
F4 Filter the processes by name.
F3 Search for a process.
F2 Open htop setup.
F1 Display the help menu.

Conclusion

It is important to know how to list all running processes in your Linux operating system. The knowledge will be useful when you need to manage processes.

Let’s take a look once more at the three commands that you can use to list Linux processes:

  • ps command — outputs a static view of all processes.
  • top command — displays the real-time list of all running processes.
  • htop command — shows the real-time result and is equipped with user-friendly features.

Which command do you prefer? Share your thoughts in the comment section below!

Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.

Источник

How do I count how many processes are running in Linux?

Viewing running processes in Linux

The ps command used to list the currently running processes and their PIDs in Linux and Unix-like systems. At a bare minimum, two processes displayed on the screen. For example, bash and ps might default on Linux when you just type ps command ps
Sample outputs:

Читайте также:  Live cd не запускает установку windows

Counts for each file in Linux

The wc is an acronym for word count. By default, wc command counts the number of lines, words, and characters in the text. For examples, show the newline counts
echo «line 1» | wc -l
To print the byte counts
echo «Hello» | wc -c
One can print the word counts as follows:
echo «Hello world» | wc -w

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Find how many processes are running in Linux

One can use the ps command along with with the wc command to count the number of processes running on your Linux based system by any user. It is best to run the following commands as root user using the sudo command.

Command to count the number of processes running in Linux

The Linux syntax is as follows:
# ps -e | wc -l
To see and count every process on the system using BSD syntax:
# ps axu | wc -l
Want to see and count every process running as vivek (real and effective ID) in user format, run:
$ ps -U vivek -u vivek u | wc -l
Another example for www-data user:
$ ps -U www-data -u www-data u | wc -l
In short to see and count only processes by a certain user naned root, you can use the following command:
sudo ps -U root | wc -l
sudo ps -U root -u root u | wc -l
Next we are going count process IDs of nginx using the following syntax:
ps -C nginx | wc -l
ps -C nginx -o pid= | wc -l

Pass the —no-headers or —no-heading to print no header line at all to get processes count correctly on Linux:
# ps -e —no-headers | wc -l
52
# ps -e | wc -l
53
When count real number of nginx it is a good idea to remove grep command while grepping using ps command:
ps -e —no-headers | grep [n]ginx
ps -e —no-headers | grep [n]ginx | wc -l

Understanding the wc command options

wc option description
-c Print the byte counts
-m Print the character counts
-l Print the newline counts
-w print the word counts
—help Display the wc command help and exit

Understanding the ps command options

ps option description
-e Select all processes (GNU/Linux syntax)
aux Select all processes using BSD syntax
-U user Select by real user ID (RUID) or name
-u user Select by effective user ID (EUID) or name
-C cmdlist Select by command name. This selects the processes whose executable name is given in cmdlist
—no-headers Print no header line at all. —no-heading is an alias for this option

Conclusion

You learned how to list the number of processes running on the Linux or Unix like system using various command-line options. See the gnu ps help page here.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

Оцените статью