Linux commands-Adding and deleting changes

Source: Internet
Author: User
Tags parent directory

Increase:

mkdir [选项] DirName
mkdir -p aa/bb;//Create a BB directory under the AA directory. If the AA does not exist, create the
mkdir -m 777 bb.txt;//Create a Bb.txt file, add permissions 777

Option to consider
-P: The parent directory that created the path does not exist, and the parent directory is created
-M: Create files to set permissions at the same time

By deleting:

1) Delete the document:
rm file;//delete the file, the system asks whether to delete
rm -f filename;//forced deletion of files, no queries

2) Delete the catalogue: rm -r directoryName ;

3) by deleting the catalogue and the catalogue everything:rm -rf dir

4) Delete the log file:rm -f *.LOG*

syntax : RM [Options] file, where options can be:
-for --force //Ignore nonexistent files, force Delete, no hint.
-ior --interactive ////Interactive Delete
-ror --recursive //recursive Delete (in this directory) all files and directories
-vor --verbose //detailed display of the steps used in the common parameters

Note : cannot be retrieved after deletion, do not shake hands

Change:

Change folder name: mv tomcat-7.0.2 tom7 ;
Change the contents of the file:vi a.txt

Check:

Check Linux version:lsb_release -a
To view the contents of a file:cat a.txt

Pressure:

. GZ Decompression/pressure:
tar zxvf filename.tar.gz
tar zcvf filename.tar.gz dirName

Linux commands-Adding and deleting changes

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.