One, the difference between Linux and window
1. Linux is strictly case-sensitive
2. Everything in Linux exists in the form of a file
3. Linux does not rely on the suffix name as the file type, but has a conventional suffix name
. gz. bz2. tar.bz2. tgz compression Pack
. html. PHP Web page
. RPM Binary Packages
. sh Script File
. conf configuration file
4. Window programs cannot be installed and run directly on Linux systems.
Second, the command format (ctrl+l clear screen)
1. [Email protected] ~]#
Root current user, root is super Administrator
localhost Host name IP
~ Current Directory
# Super Admin logon prompt $ Normal user logon prompt
2. View the commands for the files in the directory
ls [options] [Parameters: File or directory]
Option:-A to show all files including hidden files
-L Show more information
-D Displays the directory properties instead of displaying all the files in the directory
-H humanized Display file size
-I display Inode
File permission plus type: represented by a 10-bit symbol
The first bit is file type:-file D directory L link
The latter nine bits are divided into three groups, each representing
3. Directory Processing commands
Show current directory pwd
New catalog Mkdir-p [params]
-P recursive creation of multilevel directories
Go to Catalog CD ~ Show back to home directory
CD does not pass parameters to the home directory
Cd.
Cd..
CD-Go back to the previous catalog
Delete directory rmdir can only delete empty directory
So it's usually used RM-RF [path]
-R Delete
-F Mandatory Force
Copy a directory cp-a the file or directory to be copied the newly copied file name or directory name
-R
-A
Cut or rename directory and file mv This command has no parameters
4. File processing commands
A. File Search command Locate
can only search file name, database location/var/lib/mlocate
Database updates once a day, forcing updates to use UpdateDB
Database configuration file/etc/updatedb.conf
B. Command search command which Whereis
View command location options have-m-b
-B Find only executable files
-M find only help documents
C. Echo $PATH
Display System Environment variables
D. File Search command find
Find search Location Options parameter
The search location can be an absolute path, or it can be the current path (.). Use a dot to represent
find/users-name [file] Search file name [file] can use *? [] Match
find/users-iname [file] iname means ignoring case
find/users-root [user] to find files with the file owner as [user]
Find/users-nouser find files with no owner
Find/users-atime +10 files that find file access time 10 days ago
Find/users-ctime 10 Find modified file properties date 10 days ago File
Find/users-mtime-10 Find files that modify the contents of a file within 10 days
Find. -size [Size] Search file size is equal to size of file, size can also contain symbol + representation greater than-indicates less than
Find. -inum [num] Search file i node equals num
Search criteria can use logical commands such as-a-o
-A represents the logic and
-O represents a logical OR
The results found can be used to execute subsequent commands.
-exec [command] {} \; Note {} \; This four character is a required format
Find. -size +20k-a-size-50k-exec Ls-lhi {} \;
E. grep command for searching strings
Searches for a string in the specified file that satisfies the matching criteria
grep option String file name
Grep-i-v [str] [file]
5. Help commands
The function is to view the Help document for the command
Syntax is man [command]
Mans LS
man-f [command] to see which level of a command has a help document equivalent to Whatis
man [level] [command] to view the command's appropriate levels of help document
man-k [command] to find all commands related to the specified command
Shell internal commands use help [command]
[Command]--help
info [command]
6. Compress file Commands
File compression format. zip. gz. bz2. tar.gz. tar.bz2 Five common formats
A. zip compression format
Zip destination filename Original file name
Zip-r target directory name original directory name
Unzip original file name
Unzip original directory name
B. GZ compression format
Gzip
Gzip-d
Gunzip
7. Restart and shutdown commands
Shutdown-r [TIME] &
Shutdown-h [TIME]
Shutdown-c
RunLevel
init [level]
Configuration file/etc/inittab
Logout
[Linux nurturance Program] About Linux