[Linux] Common commands __linux

Source: Internet
Author: User
1. Find the process

Command: Ps-ef |grep < find content >

such as: Etl-fw:[/ytxt/jboss/server/default/deploy] $ps-ef |grep java
Jyfx 6119 55252 0 11:33 pts/0 00:00:00 grep java
Jyfx 15300 1 0 Aug07? 00:00:00/bin/sh./run.sh


2. Shutdown process

Command: kill-9 < process number >

such as: Kill-9 15300


3, modify the file or directory of the user

Basic Syntax:Chown [-r] Account name file or directory Chown [-r] Account name: User group name file or directoryParameters:-r: Continuous changes to recursive (recursive), that is, all files and directories under the subdirectory are updated to this user group. Often used when changing a directory.Example 1: [Root@localhost home]# touch testfile//create file by root user [root@localhost home]# ls testfile–l-rw--w--w-1 root ro OT 0 June 7 19:35 testfile//File owner and owner level are root [root@localhost home]# chown Yangzongde testfile//modify file owner for Yangzongd e [root@localhost home]# ls testfile-l-rw--w--w-1 yangzongde root 0 June 7 19:35 testfile//view file owner as Yangzongde, but group is still root
4, modify the file or directory of the user group basic syntax: CHGRP [r] User group name Dirname/filename ...Parameters:-r: Continuous changes to recursive (recursive), that is, all files and directories under the subdirectory are updated to this user group. Often used when changing a directory.Example 3[root@localhost home]# ls testfile-l-rw--w--w-1 yangzongde root 0 June 7 19:35 testfile//view file owner is Yangzongde, but group is R  oot [root@localhost home]# chgrp yangzongde testfile//Modify owner Group Yangzongde [root@localhost home]# ls testfile-l -rw--w--w-1 Yangzongde Yangzongde 0 June 7 19:35 testfile [root@localhost home]# chown root:root testfile//Use Cho WN one-time modification owner and group [root@localhost home]# ls testfile-l-rw--w--w-1 root root 0 June 7 19:35 testfileExample 4[Root@linux ~]# chgrp users Install.log [root@linux ~]# ls-l-rw-r--r--1 root users 68495 June 08:53 Install.logExample 5Change to a user group that does not exist in a/etc/group [root@linux ~]# chgrp testing install.log group name ' chgrp:invalid ' testing error message ~ I can't find this user group name ~

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.