Shell Command Collection

Source: Internet
Author: User
Tags touch command


C
Cat Zdd Browse the contents of a ZDD file
Cat Zdd1 Zdd2 Browsing the contents of multiple files
Cat-n ZDD Browse the contents of a file Zdd and display line numbers

CD back to the start directory, that is, just logged into the system directory, CD behind no parameters
CD/back to the root directory
Cd.. Return to the top level directory

CD-Return to the most recently used directory

D
Df-kh Viewing disk information

Du-sh FolderName View the folder size,-H indicates the size of the display in human readable format,-s means the size of each file is accumulated.

H
History Show Command Chronicle
Hostname Displays the host name of the current login

L

Ls-al lists complete information for all files, one file per line

Ls-tl sort by last modified time

Ls-ul sort by last access time

Ls-r files and folders in the recursive reality subdirectory, this command can be easily implemented with grep, such as locating files in the current directory and subdirectories Zdd,ls-r | grep ZDD

Ls-f | grep/List Directory only

Less split screen displays the file, press the space down, and use the up and down arrows to look back and forth. Press the Q key to exit.

M

More split screen display file, press space down to view, do not support back to see, press the Q key to exit.
Man ls to view the help of LS command if help has multiple pages
Space PAGE Down
b PAGE Up
Q Exit Help

O

OD View the ASCII encoding of the file.

P
PWD Displays the current directory
PS Lists the current user's processes
PS-EF list all processes with full information

R
RM-RF zdd Delete the directory Zdd and its subdirectories, even if the directory is not empty
RM-RF zdd/* Delete all content under directory ZDD, but do not delete zdd itself
RM-RF * Delete all the files in the current directory, including the sub-file plus the file,-R for recursion,-F for forced deletion, do not ask.
RmDir zdd Delete Empty directory Zdd
mkdir zdd Creating a directory Zdd

S
Set View defined variables
SSH hostname Login to hostname

T
tar [option] File or dir
TAR-XVF Zdd.tar will Zdd.tar decompression, extract will generate Zdd folder, which contains the extracted files X means decompression, v means the output decompression information, f means the operation of ordinary files
TAR-CVF Tmp.tar TMP Packages the folder TMP into Tmp.tar
TAR-RVF Tmp.tar zzz Appends the file zzz to the Tmp.tar

Type XXX to view the path where xxx is located. What's the difference from Which?

Touch command
Touch [ACM]-T time file
This command is used to modify the file time, a-access times, m-modification c-do not the Create if file not exists
If you do not specify a time, the current system time is used, and if the file does not exist and the-C is not specified, a new file is created. You can use this method to quickly create a file. The format of time is as follows
[[Cc]yy] mmddhhmm[. SS]
Touch ABC if file ABC exists, then update its time to the current time, otherwise create it
Touch Abc-a-T
TOUCH-M-T 201101230621 ABC

W
Who see who has logged into the system

Who am I view my account information

Which LS to see the path where the LS program is located.

Z
Zip compression
Zip [options] Dest_files source
ZIP-R9 ~/zdd/home/zdd/* compresses all files under directory/home/zdd and puts them in the current directory named ZDD. -R represents a recursive processing of files in a folder, and 9 represents the maximum compression rate.

Unzip decompression
unzip-d ~/zdd Zdd.zip extracts the zdd.zip into the ZDD directory under the current directory, and-D indicates the directory to be unzipped.

Gzip Compression/Decompression
Gzip-d error_log.gz will error_log.gz decompression,-D for decompression, after decompression error_log.gz will no longer exist.


Other
Turn the page on the Terminal (Putty window can also)
Page UP Shift+pageup
Page DOWN Shift+pagedown


Shell Command Collection

Related Article

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.