Linux Preliminary Learning---commands

Source: Internet
Author: User
Tags file info parent directory disk usage

Ll-alinux command
LS View all document names
Ls-l View All Catalogs
LS/ETC display the files in the ETC directory
ll view the document permissions information, the last three bits are: file capacity, file date Modified, file info
ll/View Document root directory
Ll-a See if there is a hidden directory in the directory
Ll-d/View the root directory itself permissions
Exit immediately Linux
Poweroff shut down the machine
Date view current time or format output time
Date +%y/%m/%d output format time, as of 2016/09/22
Su-Switch account, identity
Date month + date + hour + minute + year
PWD Displays the directory where you are currently
Pwd-p show exactly where the directory path is
mkdir + directory name create new directory
Mkdir-p + directory name Create multiple directories
RmDir + directory Name Delete empty directory (there is no way to delete content)
Rmdir-p + directory Name Delete multiple empty directories

CP Copy files or directories
Options and Parameters:
-A: As-pdr means, please refer to the following instructions for PDR. (common)
-D: If the source file is the attribute of the link file, the link file property is copied instead of the file itself;
-F: For force, if the target file already exists and cannot be opened, then try again after removing it;
-I: If the target file (destination) already exists, the action will be asked (commonly used) when overwriting
-L: Create a link file for a hard link, rather than copying the file itself;
-P: Copy the past along with the properties of the file, rather than using the default properties (backup is often used);
-R: Recursive continuous replication, used for the replication behavior of the directory; (Common)
-S: Copy becomes the symbolic link file (symbolic link), i.e. "shortcut" files;
-U: Upgrade destination If destination is older than source!
RM to remove files or directories
Options and Parameters:
-F: Is the meaning of force, ignoring the nonexistent file, no warning message appears;
-I: Interactive mode that asks the user whether or not to move before deleting
-R: Pass it back! Most commonly used in directories are deleted! This is a very dangerous option!!!


User and User group management
Useradd add a new user account
Options:
-C Comment Specifies an annotative description.
The-D directory specifies the home directory, and if this directory does not exist, the-m option can be used to create the master directory.
The-G user group specifies the user group to which the user belongs.
-G user Group, user group specifies the additional group to which the user belongs.
-S Shell file specifies the user's login shell.
-u user number specifies the user's user number, and if you have the-o option, you can reuse the other user's identification number
For example # useradd–d/usr/sam-m Sam
This command creates a user Sam, where the-D and-m options are used to generate a home directory for the login Sam/usr/sam
(/usr is the parent directory where the default user home directory resides)

Userdel Delete user account
The userdel-r common option is-r, which is to remove the user's home directory

passwd User Password Management
Options available for use:
-L locks the password, which disables the account.
-u password to unlock.
-D make the account no password.
-F forcing the user to change the password at next logon

Disk Management
DF: List The overall disk usage of the file system
Options and Parameters:
-A: Lists all file systems, including system-specific/proc, etc.
-K: Displays the file system in Kbytes capacity;
-M: Display the file system in MBytes capacity;
-H: GBytes, MBytes, Kbytes and other formats are displayed by people who are easier to read;
-H: Replace m=1024k with m=1000k;
-T: Displays the file system type, along with the filesystem name of the partition (for example, ext3);
-I: Do not use the hard disk capacity, but the number of inode to display


Du: Check Disk space usage
-A: Lists all files and directory capacity, because the default is only the number of files under the directory.
-H: Displayed in a more readable capacity format (g/m);
-S: Lists the total, not the capacity of each directory;
-S: does not include totals under subdirectories, and is somewhat different from-S.
-K: List capacity display in Kbytes;
-M: List capacity display with MBytes;


FDISK: For disk partitioning
-L: Outputs all the partition contents of the device after the output. If there is only fdisk-l, the system will list the partitions of the device that can be searched in the whole system.
Press Q When you leave Fdisk, then all actions will not take effect! Conversely, pressing w means that the action takes effect.

Touch Create File
Cat View File Contents
VI Edit file Contents esc+:wq Save Edit and Exit I go to edit
File type: the
-Representative documents
D Represents a Folder

This article is from the "12380959" blog, please be sure to keep this source http://12390959.blog.51cto.com/12380959/1881139

Linux Preliminary Learning---commands

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.