Linux Common commands

Source: Internet
Author: User

Use the skill to install the software: in Redhat, the installation program suffix is mostly *.rpm, in Ubuntu, the installation program suffix is mostly *.deb, in fact, in the general use of Ubuntu Software Center, or sudo apt-get install xxx The suffix of the executable file is typically. bin

Tip: In Linux, the port number under 10,241 can only be used by an administrator user

Directory structure:/ root directory
/bin storing binary executables (ls,cat,mkdir, etc.)
/Home Stores all user files in the root directory, after the system is started in this directory, each user has a corresponding user, such as:
/home/gaoyuan/home/admin
for the root user, his home directory is special, that is:/root
/
boot stores various files used for system boot
/
dev for storing device files
/
etc Store System configuration file
/lib the shared libraries and kernel modules required to run the program in the file system/proc the virtual file system, the mapping of the current memory/USR for storing system applications, the more important directory/usr/local local Administrator software installation directory/var for storing the runtime needs Change the data of the file/opt used to install some software, I put ADT here, Chrome.deb also automatically installed in this directory./temp Temporary files

For my own software, I usually install in/home/gaoyuan/software How to create a shortcut icon in dash: After referencing the Xxx.desktop file under/usr/share/applications using Putty to connect to the terminal, If you press Ctrl+s, you lock the screen, and when you press nothing, you must press Ctrl+q to unlock common command 1. File directory Operations/represents the root directory, ~ represents the home directory of the current user.
CD into directory such as Cd/home/huiyuanai/note, CD/go to root directory ls display directory contents-a Show All files (clips), including hidden,-l display file details mkdir Create a directory mkdir AAACP copy file CP Doll.txt/home/itcast/familya/house/roomb Copy folder: Cp-r AAA bbb/mv Mobile file MV SOFA.TXT/HOME/ITCAST/FAMILYA/HOUSE/ROOMBRM Delete File/directory Delete file: RM doll.txt, delete content directory Rm-rf AAA,-r means to delete all subdirectories and files recursively,-f means don't ask whether to delete every time. RmDir Delete empty directory rmdir bathroom
WC displays the number of lines, words, and characters of the document WC Book.txt
PWD Show current directory tree display directory

Background Run command: Add a & After command
----The following few few, with VIM can touch new empty file Touch Bed.txtecho "Your is the best boy." > Book.txt to create a file with simple content, the basic useless, cat book.txt See file Contents 2. Compress/Unzip the gzip command to compress all files in the Familya directory under the/home/itcast directory into a. gz file cd/home/itcasttar-cvf/home/itcast/familya.tar/home/itcast/ Familya is packaged first, because Gzip cannot compress the directory directly gzip Familya.tar compress gzip-l familyA.tar.gz View the ZIP package details
Uncompressed FAMILYA.TARGZIP-DV familya.tar.gzgzip-v-9 Familya.tar High compression ratio gzip-l familyA.tar.gz
GZIP-DV familya.tar.gzgizp-v-1 Familya.tar Low compression ratio gzip-l familyA.tar.gz
The tar command packages all files in the entire/home/itcast/familya directory into/home/itcast/familya.tar package only, not compressed
Tar-cvf/home/itcast/familya.tar/home/itcast/familya
After packaging, the Tar-zcvf/home/itcast/familya.tar.gz/home/itcast/familya is packaged with gzip compression to bzip2 compression tar-jcvf/home/itcast/ familya.tar.bz2/home/itcast/familya# Special Note that the file name after the parameter F is self-fetching, we are accustomed to use. Tar as the identification # if the z parameter is added, the. tar.gz or. tgz represents the gzip compressed tar file# If the J parameter is added, use. tar.bz2 as the document name

3. Find find finds the specified files find directory/-name "Book.txt" grep find the specified string grep best book.txt
To find a file in the current directory:ls|grep xxx







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.