Ubuntu Basics (i)

Source: Internet
Author: User
Tags system log

5th Linux Utility 5.2 Basic Utility ls: Lists all file or folder names under the current folder
Cat: Display the contents of the target text file
RM: Delete destination file
Less or more: split-screen display of text files (when the file content is more than one page)
Hostname: Display system name
5.3 File Operation CP: Copy the source file to the target path
MV: Change the file name
LPR: Printing files
grep: Finding a string (searching for a given string in one or more files, displaying a file line containing a lookup string, and not modifying the search file)
Head: Display the file header (the first 10 lines of the file are displayed by default, you can specify the number of lines)
Tail: Show file trailer
Sort: Display the contents of a file sequentially (sort the contents of a file by row)
Uniq: Deleting duplicate rows in a file
diff: Compare two files (shows the difference between the two, but does not change the contents of any one file)
File: Display property information for files
5.4 Pipelines (|): Enables interprocess communication redirect standard output from one process to standard input for another process
Cat months | Head # The result of cat months as input to head
5.5 4 Useful Utilities echo: Display text
Date: Displays dates and times
Script: Log a shell session
Unix2dos: Convert linux files to Macintosh format or Windows format
5.6 Compressing and archiving files bzip2: Compressed files (bzip2-v filename, suffix bz2)
BUNZIP2: Unzip the bzip2 compressed file
Bzcat: Show files compressed with bzip2
gzip, Gunzip, and Zcat: Compressed files (suffix. gz)
Compress: less efficient compression tool with. z as Extension
Tar: Package and Package archive files, package multiple files into one file, and suffix. Tar. -CVF is packaging,-TVF is decompression,-X can move the archive file to a new directory, and then unpack it.
5.7 Positioning Command which: Locate the path of the tool to find the first matching
Whereis: Locate the path of the tool to find all matching
Apropos: Search for commands that approximate match keywords
Whatis: Search for exactly matching commands
Locate: Searching for files in the local system
5.8 Getting user information and system Information who: List users on the system
W: List the users on the system
5.11 Creating and editing files with vim vim: Create or edit a file (after entering the interface, enter I or a to enter the input mode, after entering, press ESC, then: W or ZZ to save the file to disk, press: Q to exit)
6th. linux File System 6.3 path name Absolute path (~/in path represents home directory)
Relative path
6.4 Directory Command mkdir: Creating a Directory
CD: Change working directory
Important Standard directories and files:
/: Root directory
/bin: Binary files for basic commands--contains files required to start the system and first run in recovery mode
/boot: Static file of boot loader-all files containing boot system
/dev: Device File--contains all files representing peripheral devices
/etc: Local computer system configuration file--Contains management files, configuration files, and other system files
/ETC/PASSWD: Contains a list of all authorized users using the system
/etc/opt: Configuration file For additional packages placed in the/OPT directory
/ETC/X11: Local Computer Configuration for the X Window System
/home: Household Directory
/lib: Shared Library
/lib/modules: loadable Kernel module
/MNT: mount point for temporary Mount file system
/OPT: Additional Packages
/proc: Virtual file system for displaying kernel and process information
/root:root User's home directory
/sbin: Basic binary system files-tools for system administration stored in/sbin or/usr/sbin
/sys: Device pseudo file system
/tmp: Temp file
/usr: Second primary file hierarchy
/usr/bin: Most user commands--including standard Linux utility programs
/usr/games: Games and educational software
/usr/include:c the header file that the program contains
/usr/lib: library file
/usr/local: Local File Hierarchy result-contains files and directories that are important to the local (user-added, non-system-brought)
/usr/man: Online Manual
/usr/sbin: Non-critical binaries for system administration
/usr/share: Architecture-independent data
/usr/share/doc: Various documents
Main catalogue of/USR/SHARE:GNU info system
/USR/SRC: Source code files
/var: variable data--subdirectories contain files that change the contents of the system runtime, typically temporary files, system log files, spool files, and user mailbox files
/var/log: Log file
6.5 Directory Operations rmdir: Deleting a directory
MV: Moving files, directories
CP: Copying files
6.6 Access Rights Ubuntu Linux supports two ways to control who can access a file and how to access it: traditional Linux access rights and access control lists (ACLs). ACLs provide fine-grained access control.
There are 3 types of users who access files: The file owner (owner), the member User (group), and other users (other) of the groups in which the file owner resides. Users can try to access ordinary files in 3 different ways: Read, write, and execute.
Ls-l: Show access Permissions (file type + file access +acl flag + number of links + owner + Group user + size + Modify time + file name)
chmod: Change access permissions (file owner can execute, chmod a+rw filename, parameters: A For all users, O on behalf of other users, G for group users, U for file owner)
Setuid: When executing a file with the setuid (set user ID, setting the UserID) permission, the file's execution process will have the privileges of the file owner.
The Setgid:setgid (set group ID, setting groups ID) permission indicates that the process that is executing the file has the privileges of the group to which the file belongs.
Directory Access permissions: Directories are different from files: directories cannot be executed. However, the Execute permissions on the directory are defined as: You can use the CD to go to that directory, and you can also view files that have read permissions in that directory.
6.7 ACL: Access Control List
6.8 link link represents a pointer to a file for easy file sharing
7th shell7.1 Command Line command–help: View the help document for a command
7.2 standard input/output 7.3 Running program in the background 7.4 file name generation/Pathname expansion Regular expression application

Ubuntu Basics (i)

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.