Important directories and important commands in Linux __linux

Source: Internet
Author: User
Tags memory usage

Important directories under Linux/proc,/sys,/selinux,/bin,/usr/lib,/usr/local,/var,/tmp
(1)/proc: Special file directory. This directory uses a special file format (proc format), which the kernel supports. This includes all of the virtual files. They are not stored on disk or occupy disk space, and when viewed, they actually see information in memory that helps us understand the information inside the system.
(2)/sys: File system access to the Linux kernel
(3)/bin: A list of commands that ordinary users can use.
/usr/lib: A directory of function libraries used by the system, which requires the assistance of a function library in the process of executing a call for additional parameters
(4)/usr/local: Storage software upgrade Package
(5)/var: A catalogue of frequently changing content. The size of the files in this directory may change, such as buffer files, log files, cached files, and so on are typically placed here.
(6)/tmp: A general user or an executing program temporarily holds a file in a directory that is a temporary file that anyone can access, and important data cannot be placed in this directory
(7)/selinux:selinux is a domain-type model (DOMAIN-TYPE)-based mandatory access control (MAC) security system, which is written and designed by the NSA as a kernel module included in the kernel, and corresponding security related applications are also SElinux patches, Finally, there is a corresponding security policy.
(8)/etc/: Global configuration file storage directory. Systems and programs can generally be configured by modifying the corresponding configuration file.
(9)/root: The home directory of the system administrator root
The following important commands indicate what Du, DF, top, free, Pstack, Su, sudo (sudo-, sudo-s), AddUser,
dufunction is disk space usage, the function is to step into each subdirectory of the specified directory and show that the directory occupies the file system data block, if no directory is specified, the current directory statistics.
Main parameters:
A: Displays the disk space for each file in all directories and second directories
S: Show only the sum of each file size
B: Size is expressed in bytes.
X: Skipping directories on different file systems does not count
A: Recursively display the number of blocks used in each file in the specified directory and in the Descendants directory
TopBasic format DF [options]
Function: The command is used to display the program process in progress, using permissions that are available to all users
Main parameters:
D: Specifies the interval of the update, measured in seconds.
Q: No delayed updates. If the consumer has superuser, the top command executes with the highest precedence.
C: Displays the full path and name of the process.
S: Cumulative mode, which accumulates the CPU time of a completed or missing child stroke.
S: Safe mode.
I: Do not show any idle (Idle) or useless (Zombie) journeys.
N: Displays the number of updates, and will exit top when finished.
DFcommand is used to check the disk space footprint of the file system, and use permissions for all users.
Main parameters:
-S: Only the total number of blocks of data used for each names parameter is given.
-A: Recursively displays the number of blocks of data in each file and subdirectory in the specified directory. If-S is not specified or-A is specified, only the number of disk blocks per directory in names and each subdirectory in it is displayed.
-K: Lists disk space usage in 1024-byte units.
-X: Skipping directories on different file systems does not count.
-L: Calculates all file sizes and computes multiple times for hard linked files.
-I: Display inode information instead of block usage.
-H: File system sizes are printed in an Easy-to-understand format, such as 136KB, 254MB, 21GB.
-P: Use POSIX output format.
-T: Displays the file system type.
FreeFormat free [-b|-k|-m] [-O] [-s delay] [-t] [-v]
function: The free command is used to display memory usage, which is used by all users.
Main parameters:
-b-k-M: Displays memory usage in bytes (KB, MB), respectively.
-S delay: Displays the number of seconds per second to show memory usage.
-T: Displays the memory sum column.
-O: Buffer throttling columns are not displayed.
suFormat su [options] ... [-] [USER [ARG] ...]
The role is to change to another user's identity, except for Superuser, who needs to type the user's password.
Main parameters
-F, –fast: Do not need to read startup files (such as CSH.CSHRC, etc.), only for csh or tcsh two shell.
-L, –login: After adding this parameter, it is as if it were a login to the consumer, most environment variables (such as home, Shell, and USER) are based on that user (user), and the working directory changes. If user is not specified, the default is root.
-M,-P, –preserve-environment: Do not change the environment variables when performing su.
-C command: Change the account as user, and execute the Command (command) and then change back to the original user.
User: The user account you want to change, ARG passes in the new shell parameter.
sudo(sudo-, sudo-s)
The configuration of the command is in the/etc/sudoers file. When users use sudo, they need to enter a password to authenticate the user. A defined command can be used for a period of time, and there will be a record of the alert when the command that is not in the configuration file is used. Sudo is a program that system administrators use to allow some users to run part/all of the system commands as root. An obvious use is to enhance the security of the site, if you need to do some daily work as a superuser, often perform a number of fixed several only superuser identity to execute the command, then sudo is very appropriate.
* pstack* command to display stack traces for each process. The Pstack command must be run by the owner or root of the corresponding process. You can use Pstack to determine where the process hangs. The only option that this command allows to use is the PID of the process to be checked. (Man, you can be Manly)
AddUser
(1) Create user command two:
AddUser
Useradd
(2) User Delete command:
Userdel
The difference between two user-created commands
AddUser: The home directory, System shell version is automatically specified for the user created, and the user password is entered at the time of creation.
Useradd: You need to specify the basic settings above using parameter options, and if no arguments are used, the user created has no password, no home directory, and no shell version specified.

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.