Linux common commands the basis of summing

1. Command Help

1.-help parameters (for simple command parameters to help queries)

frank@ubuntu:~$ ls --help
Usage: ls [OPTION]… [FILE]…
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and …
–author with -l, print the author of each file
-b, --escape print C-style escapes for nongraphic characters
–block-size=SIZE with -l, scale sizes by SIZE when printing them;
e.g., ‘–block-size=M’; see SIZE format below
-B, --ignore-backups do not list implied entries ending with ~
-c with -lt: sort by, and show,

2. Query Online Help

(1)man page

It forms a very specific help to give
Frank Ubuntu @: ~ $ man CAL
the CAL (. 1) the BSD the Commands Manual General the CAL (. 1)

NAME
cal, ncal — displays a calendar and the date of Easter

The SYNOPSIS
CAL [-31jy] [-d-YYYY mm] [-A Number] [-B Number] [[month The] year]
CAL [-31j] [-A Number] [-B Number] [-d-YYYY mm ] -m month The [year]
The ncal [-C] [-31jy] [-A Number] [-B Number] [-d-YYYY mm] [[month The] year]
The ncal [-C] [-31j] [- Number A] [-B Number] [-d-YYYY mm] -m month The [year]
The ncal [-31bhjJpwySM] [-A Number] [-B Number] [mm-dd-YYYY -H] [-d YYYY- mm]
[-s COUNTRY_CODE] [[month the] year]
the ncal [-31bhJeoSM] [-A number] [-B number] [-d-YYYY mm] [year]
it may be inside a number of search commands and vim Close, q e.g. left / search down, page up, etc. page

(2)info page

This command is similar to the use of man, but the info in the form of hypertext links to each paragraph with its own page to write
** q between nodes move away from Tab Enter to return to the previous node u **
Options :: .

‘-d’
‘–dir’
Remove the listed directories if they are empty.

‘-f’
‘–force’
Ignore nonexistent files and missing operands, and never prompt the
user. Ignore any previous ‘–interactive’ (‘-i’) option.
Next: Block size, Prev: Exit status, Up: Common options

This is one of the subdirectories

Some GNU programs (at least ‘cp’, ‘install’, ‘ln’, and ‘mv’) optionally
make backups of files before writing new versions. These options
control the details of these backups. The options are also briefly
mentioned in the descriptions of the particular programs.

‘-b’
‘–backup[=METHOD]’

2. file permissions and management

Linux is a multi-user system, so there is a file for it (user groups, users, others) three permission

The x permission does not mean that it is capable of being executed
Frank @ Ubuntu: / $ LS the -l
Total 970 048
lrwxrwxrwx 1 root root 7 Aug 12 20:09 bin -> usr / bin
drwxr-XR-x 3 root root 4096 Jan Boot 21:57 24
drwxrwxr the root 2 X-12 is the root-Aug 4096 20:12 CDROM
drwxr X-18 is the root XR-4280 Jan 24 21:45 dev the root
drwxr XR-129-X the root the root 12288 Jan 24 21:56 etc
drwxr- the root the root-X. 3 XR-Aug 4096 20:31 12 is Home
lrwxrwxrwx the root the root. 1 16 18:04 32 Jan the initrd.img -> Boot / Generic the initrd.img-5.0.0-38-
lrwxrwxrwx. 1 the root 18 is the root 32 Jan 16: initrd.img.old 04 -> Boot / Generic the initrd.img-5.0.0-37-
lrwxrwxrwx. 1 the root 12 is the root-Aug. 7 lib 20:09 -> usr / lib
lrwxrwxrwx the root. 9-Aug. 1 the root 12 is the lib32 20:09 -> usr / lib32
lrwxrwxrwx 1 root root 9 Aug 12 20:09 lib64 -> usr/lib64
lrwxrwxrwx 1 root root 10 Aug 12 20:09 libx32 -> usr/libx32
drwx------ 2 root root 16384 Aug 13 04:09 lost+found
drwxr-xr-x 3 root root 4096 Apr 16 2019 media
drwxr-xr-x 2 root root 4096 Apr 16 2019 mnt
drwxr-xr-x 2 root root 4096 Aug 12 20:46 opt
dr-xr-xr-x 299 root root 0 Jan 24 21:43 proc
drwx------ 3 root root 4096 Jan 20 04:24 root
drwxr-xr-x 34 root root 1040 Jan 24 21:57 run
lrwxrwxrwx 1 root root 8 Aug 12 20:09 sbin -> usr/sbin
drwxr-xr-x 11 root root 4096 Aug 12 20:44 snap
drwxr-xr-x 2 root root 4096 Apr 16 2019 srv
-rw------- 1 root root 993244160 Aug 12 20:09 swapfile
XR-XR--DR X the root 13 is the root 0 Jan 24 21:44 SYS
drwxrwxrwt the root 18 is the root Jan 24 4096 22:10 tmp
drwxr X-14 XR-4096 On Apr 16 2019 the root the root usr
drwxr X-14 XR-4096 the root the root var 2019 16 On Apr
lrwxrwxrwx the root. 1 vmlinuz the root 29 Jan 16 18:04 -> Boot / Generic vmlinuz-5.0.0-38-
lrwxrwxrwx the root. 1 vmlinuz.old the root 29 Jan 16 18:04 -> Boot / vmlinuz-5.0.0 -37-generic
first 10 characters of the file for each user authority, the first character is a file type, a set of nine after every three corresponding (user group, user, others) three permission
file type

"-" represents a regular file (with plain ASCII text files, binary binary file, data file data)
"D" directory
"l" for the linked file
"s" is a file data interface

1. Rights Management Command

chgrp modified user group

charp user group filename

-R modified recursion

chown modify their user

chown username (: user group name) The file name
-R modified recursion

chmod modify their user

u g represents the user group name o behalf of someone else
chmod u = rwx, g = r filename
can be + - decrease to increase permissions
may be calculated binary permissions
chmod 774 filename

A directory on the representative on behalf of the catalog ...

umask modify the default permissions

-S output to ugo

2. file management commands

1.cd Change directory

2. ls displays files in a directory

-a All file
details display -l

3. pwd displays the current directory

4. mkdir create a new directory

-m set file permissions

5. rmdir remove directory

-p upper delete empty directories

6. cp copy files

cp source file destination
-a equivalent -dr --preserve-all file attributes and copy the link recursive copy
-r recursively copy is equivalent to
-p together with the equivalent file attribute copy (backup commonly used)
-i asking to overwrite the
-f to force an override the file does not exist, prompt does not appear

7. rm delete files

file or directory rm
-f to force an override file does not exist, the prompt does not appear
-i to ask whether such operations
-r recursive delete

8. mv move files

mv source destination file may be a number of source files
-f Force file if it already exists, covering direct prompt does not appear
-i If the file already exists, asking to overwrite

9.touch New File

3. Check the contents of the file command

1.cat directly View

cat file
-n prints the line number
** tac reverse displays the first show back **

2.more can view the page

4. File Find

1.whereis in certain directories to find, usually faster

whereis file or directory name

2.locate

locate keywords
-i to ignore case

3.find

the PATH Option Action Find
-mtime (n + n days before to several days before modified to contain within a few days days n -n)
can also restrict the user id account by the uid gid

Released two original articles · won praise 0 · Views 87

Guess you like

Origin blog.csdn.net/weixin_44780878/article/details/104083188