0 Simple commands for Basic Learning Linux (first week)

Source: Internet
Author: User
Tags aliases

The command is followed by a # indicating that it is a super administrator
The command is followed by a $ representation that is an ordinary user
TTY to see which terminal is located
[[email protected] ~]# cat/etc/shells View the shell installed on the current system
[[email protected] ~]# echo $SHELL See what SHELL is currently in use
A=123
$ variable
echo $A View the variable value of a
Useradd Creating a new user
su– Switching users
Exit exits
Hostname View full host name # hostname
CD switch Directory For example: CD/ETC is the switch to the ETC directory.
PWD View directory path
where the which command path is, such as: which LS
DF View mount Information table
CTRL + C is the exit key to display ^c, Stty–echoctl is de-displayed ^c recovery-remove it.
Type to see if the command is internal or external
such as: Type cd
CD is a shell builtin (internal command) Description CD is an internal command; If the display path description is an external command
Just tap enable to display internal commands that have been in effect
Enable–a Show All internal commands (both active and disabled)
Enable–n display of internal commands that are disabled
Enable |wc–l display of rows
The Enable command is the start of the specified internal command
Enable–n command to disable the specified internal command
Hash shows what commands are cached by me (hash cache is path)
Hash–d Add the command to delete the cache of this command
Hash–r empty the cache of all commands
Alias View aliases
Unalias plus alias name is cancel
Unalias–a Cancel All aliases
Car. BASHRC viewing files in Alias
Gedit. BASHRC Popup Shell graphical interface to edit changes
LS lists which files are in the current directory
CD Back home directory
ls/boot/list what files are in the boot directory
BC Calculator
Halt Poweroff shutdown
Init 0 shut down immediately
Init 6 Restart
Shutdown-h +1 shut down after one minute +2 two minutes after shutdown {: minutes} Specify time off
Shutdown-c canceling a scheduled shutdown
Reboot restart
WHOAMI display the current user name
Who am I displays the current user name of the terminal and logon time, source IP
WHO displays all login information for the current system
W VERBOSE Displays all login information for the current system
Screen–s creating a new session
Screen–x Join Screen Session
SCREEN–LS displays a screen session that has already been opened
RPM–IVH Pack
Nano Editor
Rm–f Deleting files
Make file Creation file
/var/cache/man/whatis
Whatis database-based lookup benefits: Find Fast drawbacks: not real-time
Makewhatis Creating Whatis
Help Internal Command Lookup method
--help all the Search
Cd
Man 7 Golb pre-defined character class
Inode node
Block blocks
Stat view file and Display properties

    • It's a regular file.
      D is the catalog file
      b is the device file
      C is a character file
      L is a soft link file
      P is a pipeline file
      s (socket) at the beginning of the socket file (can be connected by port)
      (local) Nc–ul plus name monitoring open socket file (remote) NC UL plus port number monitoring
      (local) nc–u plus name can join and call (remote) NC UL host IP port number join can call
      Command +--help is find help
      Ctrl+d is quitting
      DirName extracting directory names separately
      BaseName extract the base name separately
      mkdir Creating a Directory

GPASSWD-A User Name Group name add user as team member
Gpasswd-a User Name 1, user Name 2 group name add 1 and 2 for Group Admins
GPASSWD-D User name Group name Delete members within a group
Getnet Gshadow Group name View group information password and more
Getent Group group name View groups information

Create Group
NEWGRP GroupName

GROUPMENS-G Group name-L View Group list
-a group name User name join group
-D Remove from group
-P Clear All Members

   -l 列出列表

Group
Groupmems-Group name-L View Group under Members

Chown (only root can execute)
Chown space ABC.BCD or ABC:BCD space a modify the owner of the a file the ABC and the owning group name is BCD
-R ABC * modify files and subdirectories under All files for ABC (-R for recursive modification)
Chown Space ABC Space a modifies the owning ABC of a file. (The owner can modify the permissions of the file)
Chown–reference=a Space B refers to the dependency of a to modify the subordinate relationship of B file to a. Same as Copy

Normal user chgrp Space ABC space a modify file a belongs to group ABC (only root and file owner can be modified, and the file owner in the target group)
CHGRP Space ABC space b change the Group B to ABC

Chage–l User name view username password information (contains information such as minimum surviving maximum survival date expiration date)
Chage user name directly interactively modify the user name password date and other information

File permissions: Owner: Master, u group: Genus, G other: Others, O
rw-r--r--{R readable w writable, modifiable x Execute}
Owner group other
R when only one R function on file The user can read the contents of the file
W when only one W acts on the file, it means that the user can modify the contents of the file (cannot read the contents of the file, can only be modified, but they do not see it, can be added by the Echo >> add content, you do not see)
X When only one X acts on a file, the contents of the file cannot be read, and only the Execute permission is meaningless.
RW at the time of the file, indicating that the user can read and write files
Rx Simultaneously at the time of the file, indicating that the user can read and execute the file
WX simultaneously at the time of the file, the permissions and only W
rwx full permissions, You can read and write
Directory permissions:
R when only one r functions in the directory, it means that the user can view the file name under the directory and cannot view the contents of the file
W is meaningless when only one W function in the directory. (The metadata cannot be read, nor can it be created or deleted) (W function in the directory meaning is the right to create and delete directories)
*x when only one X acts on the directory, you can access the directory, but not the file name
Rw at the time of the directory, Permissions equal to only R permission
* Rx function in the directory, you can enter the directory, you can view the directory files, but not create and delete the
Wx at the same time in the directory, you can access the files can be accessed directory, can be created and deleted, cannot view the file name The
Rwx full permissions, which can be accessed to create and delete the
X function at the time of the directory to indicate that the directory can be entered, acting on the file when it can be executed. Batch to the directory to add x permissions, but not to file X permissions can be used x (uppercase) For example: chmod space A+x * indicates that only the directory is x permission.

RWX 7
Rw 6
Rx 5
R 4
Wx 3
Y |
X 1
Umask View Umask Direct input umask display.
Global Settings/ETC/BASHRC user Settings home directory ~/.BASHRC The umask settings can still be saved the next time you log in.
Umask-s can display permissions to create a directory. Show Example: u=rwx g= o=
Umask represents the default permission for a user to create a file with a directory of up to 777 and a maximum of 666 files

0 Simple commands for Basic Learning Linux (first week)

Related Article

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.