Brief introduction to linuxshell features

Source: Internet
Author: User
Shell Features 1. explain the commands entered by the user and return the results to the user. 2. shell is the interface program Tip between the user and the system: similar to command.com for batch processing in windows. 1. view the types of shell stored in shell/etc/shells files supported by linux. ech... shell Features 1. explain the commands entered by the user and return the results to the user. 2. shell is the interface program Tip between the user and the system: similar to command.com for batch processing in windows. 1. view the shell/etc/shells file supported by linux. Save the shell type. echo $ SHELL is used to view the currently used shell type and can enter other shells. operations, for example,/bin/csh can enter csh for operation and control 2. features www.2cto.com 1. support for shortcut keys to view historical commands 2. support for auto-complementing functions 3. help functions, help allows you to view bash shell's built-in command 3 access permissions and Security 1. file and directory permissions---- the information in the first column of the ls-l command drwxr-xr -x 2 root 4096 Jun 2. drwxr-xr-x 4 volcanol 4096 Jun 2 .. -rw-r -- 1 root 113 Jun 2 0:13 hello. c-rwxr-xr-x 1 root 4683 Jun 2 hello.exe the first column of information interprets the owner permission, owner permission, other group permissions-rwx r-x project type read/write execution read execution read execution project type: FILE-directory d block device B connection file-named pipe file psocket file s read: readable/writable: the number in the second column of the executable file indicates the number of hard connections of the file. The third column indicates the size of the file in the fifth column of the user's fourth column. The sixth column indicates the size of the file. The third column indicates the last modification time of the file in the eighth column.
2. change the file permission. chmod changes the permission attribute of the first column in the user's ls. rwx and s and t File t indicate that only the owner can delete the file, if the directory has the t attribute, the user group has the same permissions in the directory. if the executable file has the t attribute, indicates that the file will be executed in the swap partition to change the file, and the Directory group chown will change the file owner (which can be used to change the user group)-R: Directory option, recursive change, including all subdirectories 3, SUID, GUID, sticky bitSUID = set uid. The S permission is used to grant the object owner permissions when a common user executes a file. Www.2cto.com SUID is only valid for binary files, and cannot be set for other files. GUID: if the S permission of SUID is in the user group, the Sticky Bit attribute of GUID is only valid for the directory. if the directory has the sticky bit attribute, it indicates that only root and has the delete permission. 4. default umask permission for creating files or directories, umask 0000 sets the umask value of the current user. the configuration file of umask under/etc/profile is in the root user's home directory. bashrc file content #. bashrc # User specific aliases and functionsalias rm = 'rm-I 'alias cp = 'CP-I' alias mv = 'MV-I '# Source global definitionsif [-f/etc/ bashrc]; then. /etc/bashrcfi 5. file Viewing file type 6. which searching for executable files 7. soft connections and hard links are equivalent to having two names for the same hard disk address in the file system; soft connection is similar to the shortcut in windows. for example, use the shell script in section 1 and section 3 "usage reason": Save time and realize automatic configuration. Powerful configuration file [Basic Element]: line 1 :#! /Bin/bash [note]: There are two annotations in the configuration file starting with #: # and; [first instance] vi hello. sh [root @ localhost ~] # Cat hello. sh #! /Bin/bash www.2cto.com # this is a demo shell scriptprintchar = "hello world! "Echo $ printchar: The script can be executed after editing and modifying the execution permission.
1. 4 shell features [alias] alias is used to set the alias for the command. alias can be used to view the configured alias [root @ localhost ~] # Aliasalias cp = 'CP-I '# cp is actually the cp-I command alias l. = 'ls-d. * -- color = tty 'Alias ll = 'ls-l -- color = tty 'Alias ls = 'ls -- color = tty 'Alias mv = 'MV-I 'alias rm =' rm-I 'Alias which = 'Alias |/usr/bin/which -- tty-only -- read-alias -- show-dot -- show-tilde'
Alias setting method: alias = 'original command 'for example: alias ll = 'ls-l -- color = tty' the current user's configuration file is in $ HOME /. define the alias in the bashrc file. [replace the command] use the ''to cause the command to change the execution mode of the string in the command. for example: [root @ localhost ~] # Cat myfileparmfindfile [root @ localhost ~] # Mkdir parm findfile [root @ localhost ~] # Ls 'cat myfile'-alfindfile: total 16drwxr-xr-x 2 root 4096 Jun 2 05:38. drwxr-x --- 5 root 4096 Jun 2 05:38 .. parm: total 16drwxr-xr-x 2 root 4096 Jun 2 05:38. drwxr-x --- 5 root 4096 Jun 2 05:38 ..
[Background running] function: A terminal can run multiple commands at the same time and add the & symbol to the end of the command to move the command to the background. you can run the jobs-l command to view the variable [variable] that is running in the background. process storage information pipeline redirects the output of a command as the input of another command to change the input and output sources during command execution.
[Root @ localhost ~] # Ls> ls.txt [root @ localhost ~] # Ls
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.