Server and use common commands

Examples restart
restarting the svn
svnserve to -R & lt -d / mnt / the svn (restart SVN)

Check the port number
netstat -tunpl

Restart nginx
Service nginx restart

Restart PHP
Service restart PHP-FPM
Service PHP-FPM STOP

Restart MySQL
Service mysqld restart
sudo Service mysqld Start
search files
find / -name app

Reload the configuration, the server does not need to stop
. 1) -t Nginx; reload Nginx -s
2) -t Nginx; the kill -HUP

View the process
ps aux

Folder and file operations
modify the file permissions
chmod 777 / var / home / userid / cc

mkdir dir1 create a 'dir1' directory is called '
mkdir dir1 dir2 create two directories simultaneously
mkdir -p / tmp / dir1 / dir2 create a directory tree
rm -f file1 delete called' file1 'file'
rmdir dir1 delete called 'dir1' directory '
RM -rf dir1 delete called' dir1 'directory and delete its contents
rm -rf dir1 dir2 remove two directories at the same time and their contents
mv dir1 new_dir rename / move a directory
cp file1 file2 copy a file
. cp dir / * copy all files in a directory to the current working directory
cp -a / tmp / dir1 copy a directory to the current working directory.
cp -a dir1 dir2 copy a directory
file package
.tar
unpack: tar - xvf fileName.tar
Packing: tar -cvf filename.tar DirName
(Note: tar package is not compressed!)
.gz
extracting 1: gunzip fileName.gz
extracting 2: gzip -d fileName.gz
compression: the gzip FileName
.tar.gz
decompression: tar zxvf fileName.tar.gz
Compression: the tar zcvf filename.tar.gz DirName
the .bz2
extracting 1: bzip2 -d FileName.bz2
extracting 2: bunzip2 FileName.bz2
compression: bzip2 -z FileName

.tar.bz2
decompression: tar jxvf FileName.tar.bz2
compression: tar jcvf FileName.tar.bz2 DirName

.bz
extracting 1: bzip2 -d FileName.bz
extracting 2: bunzip2 FileName.bz
Compression: Unknown

.tar.bz
decompression: tar jxvf FileName.tar.bz
compression: Unknown

.Z
decompression: uncompress FileName.Z
compression: the compress FileName
.tar.Z
unpack: tar Zxvf FileName.tar.Z
compression: tar Zcvf FileName.tar.Z DirName

.tgz
unpack: tar zxvf FileName.tgz
compression: Unknown
.tar.tgzA
unpack: tar zxvf FileName.tar.tgz
compression: tar zcvf FileName.tar.tgz FileName

.zip
decompression: unzip FileName.zip
compression: zip FileName.zip DirName

.rar
解压:rar a FileName.rar

Modify permission
2: Modify the directory file permissions:
chmod 777 / ftp ftp directory permissions to change
chmod -R 777 / ftp ftp directory and subdirectories change

3: Modify file belongs to the user and group
drwxr XR-4096-X-Mar. 4 Gamer FTP gstore 16:56. 7
drwxrwxrwx 10 the root FTP On Dec 16 4096 01:30 Resin-DOC
red parts, the first is relevant to a user, the user is a group.

Modify your user
chown gamer gstore change gstore directory
chown -R user folder change gstore directory and subdirectories

Modify user group
chown: ftp gstore gstore change directory
chown -R: ftp gstore change directory and subdirectories gstore

Guess you like

Origin blog.51cto.com/14436237/2419416