Linux VPS Basic Commands

Source: Internet
Author: User
Tags locale tar extract vps

We have a Linux VPS command to manage him, let's list some basic and simple Linux commands

1.ls
LS/view root directory
Ls-a/View the files you want in the root directory, including hidden files
Ls-l/Detailed information about the permissions of files in the directory, owner file size, etc., can be simply entered | |
Ls-f/list file name and its directory type; * indicates executable file, @ denotes symbolic link,/end indicates directory name
Ls–t list file names according to last modified file time
Ls–r lists the file names of the current directory and its subdirectories
Ls–color=never not displayed in color
Ls–color=always are displayed in a color fashion
Ls–color=auto System automatic Judgment

2.cd
Switch User's current directory
Cd/etc use absolute path to enter "/etc" Directory
Cd.. /dev uses a relative path to enter the "/dev" directory
CD ~ Return to user host Directory
Cd. User's current directory
Cd.. Return to the top level directory

3.pwd
See where the user is currently located

4.mkdir
Create a Directory
mkdir Dir1 Creating a single directory
mkdir dir1 dir2 dir3 Create multiple directories

5.rmdir
Delete directory, deleted directory must be empty
rmdir dir1 Delete directory Dir1
rmdir dir1 dir2 Delete directory Dir1, Dir2

6.touch Create File command
If the file does not exist, create an empty file directly if it exists just change the time attribute

7.file
View File types
The file command recognizes the majority of files in a Linux system and recognizes text files. binary executable files, compressed files, etc.

8.cp
Copying files
CP Source file target Location
CP Dir1/test/test/home

9.rm
deleting files
RM is a command to delete files, and file deletion in Linux is not recoverable.
Rm–r Loop Delete until deleted (can be used to delete directories)
Rm–f Force Delete
RM–RF forcibly deleting directories and files

10.mv
Move or rename a file
Mv/etc/test/etc/test2

11.vi
Opens or creates a new file and places the cursor at the beginning of the first
: W Save current file
: E filename Opens file filename for editing
: x Save current file and exit
: Q Exit VI
: q! Do not save the file and Exit VI

12. View the contents of a file
More 3.txt
Cat 3.txt
TAC 3.txt
Head-3 3.txt
Tail-3 3.txt

Find
Find/ect-name *local

Whereis.
Environment variables for Find commands
Whereis ls
Whereis Find

. ln
Create a linked file
Hard link
Symbol link related to desktop shortcuts
ln 3.txt 4
Ln-s 3.txt 5

. Users and Groups
Useradd
passwd
Userdel
Groupadd
Groupdel

. WC
Statistics specifies the number of lines, words, and characters of a text file

. grep
Finds the specified string in the specified text file

19. Unzip
Tar, you can compress folders with the TAR command, and you can unzip them as well.
TAR-CZVF Name.tar/etc/name Compress a folder
TAR-ZXVF Name.tar Extract Files
Zip method requires installation of the zip and unzip tools, command: Yum install zip unzip
Zip-r Name.zip/etc/name Compression
Unzip Name.zip Decompression

20.wget
wget http://storyday.com/index.php (will http download this page and save to index.php)
Wget-o wordpress.tar.gz http://wordpress.org/latest.tar.gz Save the downloaded results wordpress.tar.gz
Wget-r ftp://10.8.8.8/movie/directory structure and website title are all recorded
Wget-r-nd ftp://10.8.8.8/movie/No directory structure
Wget-r-nh ftp://10.8.8.8/movie/has a movie catalog

21. Other Commands
date--display and set date time
uptime--shows the current time, system uptime, how many users are currently logged in, the average load of the system in the last 1 minutes, 5 minutes, and 15 minutes
stat--displaying information about a specified file
Who, w--show online login user
whoami--show the user's own identity
id--Display ID information for the current user
hostname--Display host Name
uname--Displaying operating system Information
dmesg--Display System Boot information
du--Displays the total amount of disk space that is used by the specified file (directory)
df--display of file system disk space usage
free--display current memory and swap space usage
fdisk-l--displaying disk information
locale--Display the current locale

Linux VPS 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.