Troubleshooting of command line: Suggestions for linux beginners)

Source: Internet
Author: User
From 1991 to now, linux has been born for more than 20 years. although he is only one year younger than me, he has gone a long way. Moreover, he is more reliable and stable than before. However, linux is still faulty. I believe you can judge and fix any problems. What should I do if my desktop is frozen? Since 1991, linux has been born for more than 20 years. although he is only one year younger than me, he has gone a long way. Moreover, he is more reliable and stable than before. However, linux is still faulty. I believe you can judge and fix any problems.
What should I do if my desktop is frozen?In the process of making the graphic environment more stable, the composite window manager is a huge improvement. However, what do you do if your beautiful linux graphical desktop is locked? All you need to do is enter the console through ctrl + alt + f2. The console and your graphic environment are independent of each other. Next you do this. If you know what locks your desktop, you can find its process number and kill it. For example, when I connect to a remote network share in my dolphin graphics file manager, the network connection is interrupted and the dolphin graphics file manager locks my entire desktop. So in console mode, run the following command to find its process number:
$ ps aux | grep dolphin carla 9218 ?  Sl  0:00 /usr/bin/dolphin         --icon system-file-manager -caption Dolphin
This indicates that carla owns the process. she can use the following command to kill the process:
$ kill 9218
If root or different users have this process, run the command: sudo kill 9218. now, press the up arrow on your keyboard to return to the previous command, press Enter to run the command again to check whether the killing command is valid and whether the process is killed. If it is not killed, use the more aggressive command:
$ kill -9 9218
-9 send the SIGKILL signal, which cannot be ignored and is directly sent to the kernel (for personal understanding, nuclear option ). If you find that a runaway process has almost gave birth to a child process. To prevent the child process that you killed from being generated by it again, you need to kill the parent process because it generates child processes, which can prevent it from producing child processes again. (If you are not familiar with these terms, then you have companions, and I am not familiar with these terms (from the original author's point of view )). Add the-f option to view the relationship between the parent process and the child process in the tree chart, just like the example of the plex Media server:
root 1776 /bin/sh -e /proc/self/fd/9 plex 1803   \_ /bin/sh /usr/sbin/start_pms plex 1804     \_ ./Plex Media Server plex 1970     \_Plex Plug-in [com.plexapp.system] plex 2645     \_ /usr/lib/plexmediaserver plex 2690     \_ Plex Plug-in 
Therefore, you can use sudo kill 1776 to kill all the above processes. Most linux distributions have six consoles: tty1 ~ Tty6.tty7 is usually your x session (x window graphical interface), so you can press ctrl + alt + f7 to return to your GUI.
Who is the culprit?If you are not sure which process causes this problem, try the old and useful top command:
$ top  top - 12:07:33 up 4:13, 7 users, load average: 0.56, 0.38, 0.34 [...] PID USER  VIRT  RES   %CPU %MEM  COMMAND 6399 carla  493m 27m 94.2 0.2 konsole4386 carla 1937m 819m  2.0  5.1 firefox1511 root   613m 189m  1.3  1.2  Xorg
The above results indicate that Konsole is a troublesome manufacturer because it occupies 94.2% of the cpu. You can clearly see the idnumber of the process: 6399. come on, and kill the process.
Record saved for one dayMost servers record their activities. If you view/var/log, you will find a series of log files, such as CPUS, boot, dmesg, and kern. log, syslog, and udev. when you install the service, they usually have configurable log records, so you can choose the location where the log files are stored and the details of the log files from the degree of urgency of debugging information. Below is the debugging information level:
  • Debug
  • Info
  • Notice
  • Warning
  • Error
  • Critical
  • Alert
  • Emergency outputs a minimum amount of information. The most information output by debug. Info is a good daily record level that records daily activities as well as warnings and errors. Debugging can be overwhelming, so when you are studying a problem, a good strategy is to enable debugging and write the problem to info when the problem is resolved. Where will you do this? Check the/etc directory. Personal services all have their own configuration files, such as/etc/cups/cupsd. conf. If your linux is an ancient syslogd, configure this syslog in/etc/syslog. conf. If you have a new rsyslogd, configure your syslog in/etc/rsyslog. conf. People do not like to read log files very much. But they have to read it to solve the problem. A good way is to use the grep command to make the error message appear automatically.
    $ grep -i error /var/log/syslog
    Any text string will help you quickly find the information you need. the following example is often done by network management:
    $ grep -i networkmanager /var/log/syslog Dec 10 14:54:50 studio NetworkManager[1402]:     (eth1): DHCPv4 state changed bound -> renew Dec 10 14:54:50 studio NetworkManager[1402]:         address 192.168.10.182 Dec 10 14:54:50 studio NetworkManager[1402]:   prefix 24 (255.255.255.0)                
    Once you find useful information, you can refer to your document to see what is going on, and search for more information through Google.
    However, graphics applications do not have logsMost graphic applications generate log files, which is sadly and not helpful. However, you can run the application from the command line to view some command output, such as my favorite game: Super TuxKart:
    $ supertuxkart  Irrlicht Engine version 1.8.0 Linux 3.8.0-19-generic   #30-Ubuntu SMP Wed May 1 1   6:35:23 UTC 2013 x86_64 [FileManager] Data files will be fetched from:    '/usr/share/games/supertuxkart' [FileManager] Addons files will be stored in       '/home/carla/.local/share/supertuxkart/addons'.
    Debian requires that all programs have a man manual, so if you are using Debian, Ubuntu or their derivative systems, you can use man manual. If there is no man manual or other files, try the-h parameter (such as superuxkart-h) To view the Help menu. Of course, I can't cover everything, so I gave an example. But what causes the graphic interface to crash. You may have lost a database or system Conflict. the command line will tell you. Original Author: Carla Schroder original address: http://www.linux.com/learn/tutorials/752708-linux-commands-for-troubleshooting-linux-graphical-apps-for-beginners although I have passed six levels of English, but the level is still limited, please correct the translation error! Thank you!

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.