Ls:
is to display the file in the current directory
ll
is to display the file details in the current directory.
Description of the file attributes:
The file attribute field has a total of 10 letters,
The first letter indicates the file type, if the letter is a minus sign "-", then the file is a normal file. The letter "D" means that the file is a directory, the letter "D", is an abbreviation for dirtectory (directory). Note that a directory or a folder is a special file, This special file holds information about other files and folders. If the letter is "L", it means that the file is a symbolic link. The concept of symbolic links is similar to shortcuts in Windows.
The 9 letters after the first field represent the permissions for the file.
The first three represent the permissions of the file owner, the middle three represents the group user rights, and the last three represent other user rights.
R table is read (read) w indicates write (write) x represents execute (EXECUTE)
Useradd
Useradd–g Sales jack–g company,employees//-g: Join the primary Group,-G: Join the secondary group
such as: Groupadd DBA
Download the file at the specified address
such as: wget http://download.redis.io/releases/redis-2.8.3.tar.gz
Tar
Extract
Syntax: tar [main option + Secondary options] file or directory
When using this command, the main option is required, and it tells Tar what to do, auxiliary options are auxiliary and can be used.
Main options:
C Create a new profile. Select this option if the user wants to back up a directory or some files. Equivalent to packaging.
X release the file from the archive file. Equivalent to unpacking.
T list the contents of the archive file and see which files have been backed up.
In particular, in the release of the parameters, c/x/t can only exist one! Cannot exist at the same time! Because it is not possible to compress and decompress simultaneously.
Accessibility Options:
-Z: Do you have the properties of gzip at the same time? i.e. do I need to compress or decompress with gzip? The general format is xx.tar.gz or XX. tgz
-j: Do you have bzip2 properties at the same time? i.e. do I need to compress or decompress with bzip2? The general format is xx.tar.bz2
-V: Files are displayed during compression! This common
-F: Use the file name, please note, after F to immediately answer the file name Oh! Don't add any more parameters!
-P: Use original file properties (attributes are not changed according to user)
--exclude file: In the process of compression, do not package file!
Such as:
TAR-XZF redis-2.8.3.tar.gz Decompression
TAR-CVF/TMP/ETC.TAR/ETC <== only packaged, not compressed!
Tar-czvf/tmp/etc.tar.gz/etc <== after packing, compress with gzip
TAR-CJVF/TMP/ETC.TAR.BZ2/ETC <== is packaged to bzip2 compressed
Make
Compile
Mkdir
Create a Directory
Chown
Use Chown command to modify the user to which the file or directory belongs:
Command: Chown user directory or file name
For example: Chown qq/home/qq (the owner of the QQ directory under the home directory is changed to QQ users)
Chgrp
Use chgrp command to modify the group to which the file or directory belongs:
Command: CHGRP group directory or file name
For example: Chgrp qq/home/qq (the home directory of the QQ directory belongs to the group to QQ Group)
How to execute the program:
1. If there is a directory of your program in path, execute filename directly 2. If there is no directory for the program in path, enter the directory./filename or Path/filename |
Telnet
[[Email protected] redis]$ telnet 127.0.0.1 6379
Trying 127.0.0.1 ...
Telnet:connect to address 127.0.0.1:connection refused– Connection failed
[[Email protected] redis]$ telnet 127.0.0.1 6379
Trying 127.0.0.1 ...
Connected to 127.0.0.1.
Escape character is ' ^] '.-This represents a successful connection.
quit-input quit quit
+ok
Connection closed by foreign host.
Cp
File copies such as:
CP redis.conf/etc/redis.conf
Ps
View process
Such as:
[Email protected] etc]$ Ps-ef | grep Redis
Root 4122 1854 0 09:57? 00:00:00 Sshd:redis [Priv]
Redis 4126 4122 0 09:57? 00:00:00 sshd: [Email protected]/0
Redis 4128 4126 0 09:57 pts/0 00:00:00-bash
Root 6138 6077 0 10:03 pts/0 00:00:00 su redis
Redis 6139 6138 0 10:03 pts/0 00:00:00 bash
Root 6293 6184 0 10:11 pts/0 00:00:00 su redis
Redis 6294 6293 0 10:11 pts/0 00:00:00 bash
Redis 6536 1 0 10:27? 00:00:00 Redis-server *:6379
Redis 6548 6294 0 10:28 pts/0 00:00:00 ps-ef
Redis 6549 6294 0 10:28 pts/0 00:00:00 grep--color=auto Redis
Netstat
View ports
Such as:
--6379 is the Redis port number
[Email protected] etc]$ Netstat-nap | grep 6379
(Not all processes could is identified, non-owned process info
Would is not being shown, you would has to be the root to see it all.)
TCP 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 6536/redis-server *
TCP6 0 0::: 6379:::* LISTEN 6536/redis-server *
--6536 is using PS to see the Redis process ID
[Email protected] etc]$ Netstat-nap | grep 6536
(Not all processes could is identified, non-owned process info
Would is not being shown, you would has to be the root to see it all.)
TCP 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 6536/redis-server *
TCP6 0 0::: 6379:::* LISTEN 6536/redis-server *
View All ports
[Email protected] etc]$ netstat-a
Common Commands under Linux