du,touch,cp,mv,rm,file,alias,echo,$

Source: Internet
Author: User
Tags aliases echo command touch command custom name
du command

Du-sh View folder size Du-sh/var: View the total size of the/var directory-a all displays the size of the file and folder, defaults to K, and the total size of the last statistic-h,–human-readable-s,–summarize,display O Nly a total for each argument date command

# date  View system current time
Wednesday, December 02, 2015 21:50:33 CST
the meaning of the touch command being ignored

When AAA this file already exists:

# Touch AAA  Modify Liupeng creation time is the current system time
# ll-d AAA  View time Modified
# Stat AAA   view file Liupneg status
Examples of Cp-r
The subfolders and folders under the-R recursive Replication folder are used only when copying folders. -
R, R,--recursive,copy directories recursively
# CP Jinanfu/daxuecheng/meichangsu langyabang/-R

(When copying multiple sources, the last one must be the destination folder ...). When there are directories in multiple sources, the last plus-R

# CP  /etc/hosts  ./hh
(copy/etc/hosts  to the current directory renamed HH)
# cp  /etc/hosts  HHH
replication/etc/hosts  to the current directory renamed HHH
copy, paste, rename one-step
# CP uu/tianlihong/-  R
which command
# which CP       
view the absolute path of the command CP (directory stored in the command)
# which shutdown  
view the path stored by the shutdown command
MV Command

MV Cut (destination must be a folder)
Mv-move (rename) files
1. When the following target file exists, it is moving-> equivalent to "cut"
2. When the following target file does not exist, it is renamed
Examples of MV:

# mv tianlihong/  Xiejie/honghong
will Tianlihong moved to Xiejie directory and renamed Honghong
File Command
# file Xiaobai.png   View the type of file
Xiaobai.png:PNG image data, 1024 x 768, 8-bit/color RGB, non-interlaced----> Real diagram Piece of paper

Example of file:

# file Lingliyang 
lingliyang:empty  ---> Empty files
# file Yupeng
yupeng:directory   ---> directory
#  Find/-name "*.png"   finds files at the end of. png in the root directory
* is a wildcard, you can pass any character (0 or more, any)
? is a wildcard and can only be used with one character
alias Command

Alias: viewing aliases defined in the system

# alias ccc= ' mkdir '

The definition of CCC is an alias for mkdir, and this method defines an alias that is temporarily valid. Failed after restarting the system.
Notice the alias, followed by the system commands, the previous custom name does not and the system commands duplicate.

# Unalias CCC  cancellation alias

# aliases  yyy= "Ls-l"
the difference between single and double quotes and the echo command"A special symbol is a symbol in single quotes and has a special effect in double quotes." “
# Rose=huangjinhui #
Jack=wuzhiyong
Echo ' $rose and $jack '
$rose and  $jack
# echo $rose and< c20/> $jack "
Huangjinhui and  Wuzhiyong
# echo $$  
The current process's PID number (process number)

In double quotes, some special symbols have special functions, and meta characters can have special functions.
Ps:
Metacharacters: does not represent its own meaning, has a special role in characters-meta characters
\ escape character: converting to original meaning

#echo "\ $meinv"
$MEINV

$ can reference the value of a variable
Single quotes inside the meta characters have no special meaning, just represent the characters themselves

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.