Linux basic commands

Source: Internet
Author: User
Tags file permissions

shell--command Interpreter
There are several different types of shells in the Linux environment, where the bash shell is the default installed and used shell
Clear the terminal screen: Clear, Ctrl+l and CLS (if first input: alias Cls=clear) effect is the same--not really clear the terminal screen
Command printf "\033c" or printf "\ec" to really empty the terminal screen. Reset is also really emptying the terminal screen. This command is a bit slow to execute, but its compatibility is obviously better than the previous one. The reset command is useful when your terminal controls the disorder.

First, browse the hard disk

$ cd /Go to the root directory
$ lsList files and directories (and one is dir except for less functionality, others are the same)
$ cd home/Access to the/home directory with all the home directories in the system
$ cdGo to User home directory
$ cd /etc/Enter the ETC directory (the configuration file that holds the system and most of the application software)
$ cat /etc/fstabView the contents of the Fstab file (defines the directory path to which each hard disk partition is mounted)
$ cat -n /etc/fstabView the contents of a file, preceded by a line number
$ more fstabPagination Displays the contents of a file (a space page down, the ENTER key scrolls down one line, and Q exits)

Second: Improve efficiency

$ ls *.cppList all C + + file names in a directory
$ ls text?Lists the file names that begin with text and followed by a character
$ ls text[1A]Lists filenames that begin with text and end with only 1 or a
$ ls text[1-3]Lists filenames that begin with text and end with one of the characters (including 1 and 3)
$ ls text[A~C]Lists filenames that begin with text and end with a character in a~c (including A and C)

Iii. Viewing directories and files

$ pwd show current location
By default LS out of file name:
Directory--Blue, normal file--black, executable--green, light blue--link file (similar to Windows shortcut keys)
$ Ls-f List files (after the directory Plus/, add * After the executable file, add @ After the connection file)
$ ls-a shows the implied file with "."
$ ls-af Federated use
$ ls-l to view the file properties (show: file's permission flag, number of links, user name of the file owner, user group group name, file size, The last time it was modified is the date and time, the file name) == v D i r ">vdir head-n 2 README ——— Displays the first two lines of the file contents (tail effect)
Better text reading tool: Less
$ less/boot/grub/grub.cfg display text (enter text) (blank next page, b key prev page, Q key Exit) (" /"+ want to find the content, continue to find the same content again"/", carriage return)
$ less-m/boot/grub/grub.cfg text message display more verbose
$ grep un file find rows containing UN in file files
$ grep un file1 file2 Specify multiple files to search for

    1. Find command:

    2. File deletion:
      Linux Delete directory, accustomed to use RmDir, but the directory is not empty, it is not, now use the rm -rf command can
      -R is recursive down, no matter how many levels of directory, delete
      -F is directly forcibly deleted, without any hint of meaning

    3. modify file permissions and give users file permissions
      To change file or folder permissions:
      Other users of the human group
      rwx rwx rwx binary: 4+2+1=7
      eg:755--"Rwx r-x r-x
      This permission
      Files: chmod 777 file name
      Folder: Chmod-r 777 folder name/
      Root user grants file permissions to other users: Chown-r User: User group file or folder

Four, installation method
    1. Source Installation Method
      Common source Packaging compression format:. tar.gz,. TAR.BAZ2, etc.
      Use the wget download link to go directly to the package
      Read the readme before installing the source code
      Compile and install: make, make install
      Example: Source Installation Apache
    2. RPM Installation Method
    3. Yum Installation Method
      Check if Yum is installed: Rpm-qa|grep Yum
      Not installed: Install, configure
    4. binary Software Installation method
      is actually the process of decompression
      . tar.gz decompression command: TAR-ZXVF . tar.gz
      . bz2 decompression command: TAR-JXVF . tar.gz
Five. Some resources about Linux

Linux Desktop

    • Linux Platform Seven desktop environment browse through
    • What are the best Linux distributions in the minds of Linux experts?
    • Online experience with Ubuntu desktop and CENTOS6/7 environments

Linux Knowledge related

    • Linux thought map finishing
    • Advanced Learning Resources finishing for Linux beginners
    • Getting Started with Linux basics
    • Understanding of the "translated" Linux conceptual architecture
    • How to start the Linux daemon
    • Memory mapping of Linux programming
    • Linux Knowledge points Summary
    • Share some information (Linux-focused)
    • 10 White hat Hacker-specific Linux operating system
    • Linux Games Complete Guide

Linux command-related

    • 28 Unix/linux Command-line artifact
    • The most useful tips for Linux command exercise
    • Ten bash techniques to improve Linux productivity
    • Linux Command Instance Practice
    • Nearly 100 Linux common command Daquan

Linux System Monitoring related

    • 20 command-line tools to monitor the performance of Linux systems
    • Most complete list: More than 80 Linux system administrator-required monitoring tools
    • Linux system Monitoring and combat

Linux software tools related

    • Awesome Linux Software
    • 9 Best Linux file comparison tools
    • 5 tools to improve Linux development efficiency
    • 16 online tools that are useful for linuxer
    • 11 Backup Tools under Linux

Link resource consolidation from: http://www.androidchina.net/5737.html

Subsequent updates ...

Linux basic commands

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.