97 commonly used Linux commands for beginners

1.ls [options] [directory name | list all directories and files in the related directory

-a Lists all files including hidden files beginning with .a -A pass -a, but does not list "." and ".." -l Lists file details -c sorts by ctime -t Modified time sorting --- color [= WHEN] Use color to identify the file type WHEN can be one of 'never', 'always' or 'auto' white: normal file blue: green directory: red executable file : indicates the compressed file is light blue: the link file flashes red: indicates a problem with the linked file yellow: indicates the device file is gray: indicates other files

2.mv [options] source file or directory directory or multiple source files | move or rename files

-b Do a backup before overwriting -f Force overwrite if no query is present -i If yes, then ask whether to overwrite -u Newer overwrites -t Moves multiple source files to a unified directory with directory parameters preceding and file parameters are After eg: mv a /tmp/ Move file a to /tmp directory mv ab Name a to b mv /home/zenghao test1.txt test2.txt test3.txt

3.cp [options] Source file or directory directory or multiple source files | Copy the source file to the destination file, or copy multiple source files to the destination directory.

-r -R Recursively copy the contents of this directory and its subdirectories -p Copy along with the file attributes -f Force copy without asking -s Generate shortcuts -a Copy all attributes of the file together

4.scp [parameter] [original path] [destination path] | Copy files and directories between Linux servers

-v Details the output in detail -r Recursively copy the entire directory (1) Copy the file: Syntax: scp local_file remote_username@remote_ip:remote_folder or scp local_file remote_username@remote_ip:remote_file or scp local_file remote_ip:remote_folder or scp local_file remote_ip:remote_file The first and second user names are specified. After the command is executed, the user password must be entered. The first one specifies only the remote directory, the file name does not change, and the second file name specifies the third and fourth user names. After the command is executed, the user name and password need to be entered. The third one specifies only the remote directory. The file name does not change, and the fourth specifies the file name. (2) Copy the directory: Syntax: scp -r local_folder remote_username@remote_ip:remote_folder or Scp -r local_folder remote_ip:remote_folder The first one specifies the user name, and the user password is required after the command is executed. The second one does not specify the user name. After the command is executed, the user name and password are required. eg: Copying from the local to the remote scp /home /daisy/full.tar.gz .2.75 :/home/root Remote Copy to Local scp root@/172.19.2.75:/home/root/full.tar.gz /home/daisy/full.tar.gz

5.rm [options] files | delete files

-r delete folder -f delete without prompt -i delete prompt -v detailed display steps

6.touch [options] file | Create empty or update file time

-a only modify the access time -m value modify the change time -r eg:touch -rab, make b the same time as a -t specify the specific time eg:touch -t 201211142234.50 log.log -t time [[CC] YY]MMDDhhmm[.SS],C: two years ago

7.pwd view the current path

8.cd change the current directory

- : Return to the upper directory.. : Return to the upper carriage return : Return to the home directory / : Root directory

9.mkdir [options] directory... | Create new directory

-p recursively creates a directory. If the parent directory does not exist, create -m in order to customize the permissions of the created directory. eg:mkdir -m 777 hehe-v Displays the details of creating a directory.

10.rmdir removes an empty directory

-v shows the execution process -p if the parent directory is empty after parent deletion

11.rm [options] file... | One or more files or directories

-f Ignore nonexistent files without prompting -i Interactive delete -r Recursively deletes the listed directories and their subdirectories -v List details

12.echo: display content

-n does not wrap after output -e encounters special handling of escape characters eg: echo "hehe" displays hehe ehco -e "hehe" displays he (line feeds)

13.cat [options] [file]..| display the entire file at once or create a file from the keyboard or combine several files into one file

-n number file content output -E prompt at end line $

14.tac | Reverse Display

15.more | Read content from page to page, reading files from front to back, so load entire file at startup

+n Displays from the nth line -n ​​Views n lines of data at a time ++String Searches for a position of a string, starting from the first two lines -c Clears the screen and then displays -p when the page changes

16.less | It is possible to view the contents of an article on a screen-by-screen basis before and after moving. The entire file will not be loaded before viewing.

-m Displays a percentage similar to the more command -N Display line number/character string: Function to search down "string"? String: Function to search up "string" n Repeat previous search (related to / or? )N Reverse the previous search (related to / or ?) b Scroll backwards d Back half pages

17.nl [Options]... [File]... | Automatically add the line number to the output

-b -ba Whether or not there is a blank line, list the line number (similar to cat -n) -bt Blank line does not list the line number (default) -n There are three parameters of ln rn rz, respectively, and then the leftmost display , the rightmost display does not add 0, the rightmost display plus 0

18.head [parameters]... [file]... | Displays the beginning of the file, defaults to the first 10 lines

-v Displays the file name -c number Displays the first number of characters. If number is negative, all contents except the last number of characters are displayed -number/n (+)number displays the contents of the preceding number line, -n number if number is negative , it shows everything except the last number of rows of data

19.tail [Required Parameters] [Select Parameters] [File] | Show End of File

-v Displays detailed processing information -q Does not display processing information -num/-n (-)num Displays the contents of the last num line -n ​​+num Displays the following data from the beginning of the num line -c Displays the last c characters -f Cycle Reading

20.vi Editing Files

:w filename Save the article with the specified file name: wq Save and exit: q! Force exit from command line mode without saving. Function key 1) Insert mode Press “i” to switch to insert mode “insert mode” and press “i "After entering the insertion mode, input the file from the cursor's current position; press "a" to enter the insertion mode, and input the text from the current position of the cursor at the next position; press "o" to enter the insertion mode and insert the new one. One line, enter text from the beginning of the line. 2) Switch from insert mode to command line mode Press "ESC". 3) Move the cursor vi directly with the cursor on the keyboard to move up and down, but the regular vi is lowercase letters "h", "j", "k", "l", respectively, control the cursor left, down, on Move one grid to the right. Press "ctrl" + "b": The screen moves to "back" by one page. Press ctrl + f: The screen moves one page forward. Press "ctrl" + "u": The screen moves half a page toward "back". Press "ctrl" + "d": The screen moves to "front" by half a page. Press the number "0": Move to the beginning of the article. Press "G": Move to the end of the article. Press "$": Move to the "end of line" of the line where the cursor is located. Press "^": Move to the "line head" of the line where the cursor is located. Press "w": The cursor jumps to the beginning of the next word Press "e": The cursor jumps to the end of the next word Press "b": The cursor returns Press "#l" at the beginning of the last character: the cursor moves to the # position of the line, eg: 5l, 56l. 4) Delete the text "x": Each time you press, delete the "behind" one character at the cursor position. "#x": For example, "6x" means to delete "after" 6 characters at the cursor position. "X": Uppercase X. Each time you press, delete the "before" character at the cursor position. "#X": For example, "20X" means to delete the "before" 20 characters at the cursor position. "dd": Delete the line where the cursor is. "#dd": Delete the # line from the line where the cursor is located. 5) Copy "yw": Copy the character from the cursor to the end of the character to the buffer. "#yw": Copy # words to buffer "yy": Copy the cursor to the buffer. "#yy": For example, "6yy" means copy "down" 6 lines from the line where the cursor is. "p": Pastes the character in the buffer to the cursor position. Note: All copy commands related to "y" must work with "p" to complete the copy and paste function. 6) Replace "r": Replace the character at the cursor. "R": Replaces the character where the cursor is to go until the "ESC" key is pressed. 7) Reply to the previous operation "u": If you mistakenly execute a command, you can immediately press "u" to return to the previous operation. Press "u" multiple times to perform multiple replies. 8) Change "cw": Change the word at the cursor to "c#w" at the suffix: For example, "c3w" means change 3 words 9) Jump to the specified line "ctrl" + "g" List cursor The line number of the line. "#G": For example, "15G" means move the cursor to the 15th line of the article.

21.which executable file name | View the location of the executable file, check the existence and location of system commands in the path specified by the PATH variable

22.whereis [-bmsu] [BMS directory name-f] file name | location of the executable file, source code file, help file in the file system

-b Locate executable file. -m Locates the help file. -s Locate source code files. -u Searches for files other than executables, source files, and help files in the default path. -B Specifies the path to the search executable. -M Specifies the path to the search help file. -S Specifies the path to the search source file.

23.locate | Search Files Quickly by Searching Databases

-r Use regular expressions to find conditions

24.find find [PATH] [option] [action] | Find files in the file tree, and make the appropriate processing

Options and Parameters: 1. Time-related options: -atime, -ctime and -mtime and -amin, -cmin, and -mmin, -mtime, -mtime, and -n, n: n are numbers, meaning that n days ago "In one day" files that have been changed over content; -mtime +n : list file names that were changed before n days (excluding n days themselves); -mtime -n : listed in n The file name of the content has been changed within days (including n days itself). -newer file :file is an existing file that lists file names that are newer than file. 2. Parameters related to the user or group name: -uid n: n is a number. This number is the user's account ID. That is, UID -gid n : n is a number. This number is the ID of the group name, that is, GID -user name :name is the user account name! For example dmtsai -group name:name is the group name, for example, users; -nouser : The person who finds the owner of the file does not have /etc/passwd! -nogroup : Finds files whose owning group does not exist in /etc/group's file! 3. Parameters related to file permissions and names: -name filename: Search for files named filename (wildcards can be used) -size [+-]SIZE: Searches are larger (+) or smaller (-) than SIZE file. The SIZE specifications are: c: represents byte k: represents 1024 bytes. Therefore, to find a file larger than 50 KB, that is "-size +50k" -type TYPE: The type of search file is TYPE, the main types are: General regular file (f) Device file (b, c) Directory ( d) link file (l) socket (s) FIFO (p) -perm mode: search file permissions "just equal to" mode file, this mode is similar to chmod attribute value, for example, -rwsr-xr-x The property is 4755! -perm -mode : Search for the file permissions "must include all mode permissions". For example, we need to search for -rwxr--r-- ie 0744 files, using -perm -0744, as a file The permissions are -rwsr-xr-x, ie, 4755, which is also listed because the properties of -rwsr-xr-x already include the properties of -rwxr--r--. -perm +mode : Search for file permissions "includes permission for any mode". For example, we search for -rwxr-xr-x, which is -perm +755, but a file attribute is -rw--- ---- Will also be listed because he has the -rw.... attribute! 4. Additional actions that can be performed: -exec command :command is another instruction, and -exec can be followed by additional instructions to process the searched result. -print : Prints the result to the screen. This action is a preset action! Eg: find / -perm +7000 -exec ls -l {} \; , extra instructions start with -exec, and \; end with {} instead of what was found previously | xargs -i The default front output uses {} instead of eg: Find . -name "*.log" | xargs -i mv {} test4

25.grep 'regular expression' file name | search for text using regular expressions and print out matching lines

-c Prints only the count of matching lines. -I is not case sensitive (only for single characters). -l Display only file name -v Displays all lines that do not contain matching text. -n Display matching line data and its line number

25.file | Judge file type

26.gzip [-cdtv#] file name | Compression, decompression, source files no longer exist

-d decompress -c output compressed data to the screen -v : display information such as the compression ratio of the original file/compressed file -# : compression level, -1 fastest, but the worst compression ratio, = 9 most Slow, but the best compression ratio

27.gunzip | Unzipping

28.bzip2 | Compression, decompression

-d : Uncompress -z : Compress -k : Preserve source files -c : Output data from the compressed process to the screen ! -v : You can display information such as the compression ratio of the original file/compressed file case; -# : The same as gzip is used to calculate the compression ratio. -9 is the best, -1 is the fastest!

29.bzcat read data without decompression

30.tar [main option + sub-options] file or directory | multiple directories or files packaged into a large file

Main options: -c create a package file, you can use -v to view the file name (filename) packaged in the process -t View the contents of the package file contains the file name, focus on the "file name" is it; -x solution Packaged or decompressed functions can be combined with -C (uppercase) to unlock auxiliary options in a specific directory: -j Compression/decompression via bzip2 support: The file name at this time is preferably *.tar.bz2 -z Compression/decompression supported by gzip: At this time, the file name is best *.tar.gz -v In the process of compression/decompression, the file name being processed is displayed! -f filename -f immediately after the file name to be processed! -C directory This option is used for decompression. To decompress it in a specific directory, use this option. --exclude FILE: Ignore a file during the packing process eg: tar --exclude /home/zenghao -zcvf myfile.tar.gz /home/* /etc -p Reserve the original permissions and attributes of the backup data, often used for backup (-c) Important configuration file - P (uppercase) Absolute path is reserved, ie the backup data is allowed to contain the root directory; eg: compression: tar -jcvf filename.tar.bz2 File or directory name to be compressed Query: tar -jtvf filename.tar.bz2 Extract: tar -jxvf filename.tar.bz2 -C directory to unzip

31.exit exit the current shell

32.logout exit the login shell

33.shutdown -h now

34.users shows the user currently logged in to the system

35.who login on the local user and source

-H or --heading Displays column header information for each field.

36.w users logged on this machine and their running programs

-s Uses a compact format list that does not show the user's login time, CPU time spent on terminal stage jobs and programs. -h Does not display column header information columns.

37.write to send a message to the currently online user

38.wall Sends a message to all users logging in again

39.last View User Login Logs

40.lastlog to see the last login time for each user

41.finger [options] [user] [user@host] | View user information

-s Displays the user's registered name, actual name, terminal name, write status, dead time, login time, and other information -l In addition to the information displayed with the -s option, it also displays information such as the user's home directory, login shell, and mail status. And the contents of the .plan, .project, and .forward files in the user's home directory. -p Same as the -l option, except that .plan files and .project files are not displayed

42.hostname View host name

43.alias ii = "ls -l" | Add an Alias

44.unalias ii | Clear Aliases

45.useradd [-u UID] [-g initial group] [-G minor group] [-c description column] [-d home directory absolute path] [-s shell] user account name | new user

-M does not create a user home directory! (system account default) -m create user home directory! (General account default value) -r Create a system account, the UID of this account will be limited -e account expiration date, the format is "YYYY-MM-DD" -D to see the default value of useradd

46.passwd | Change Password

-l disables the password -u Relative to -l, the user unlocks -S lists the relevant parameters in the login user passwd file -n followed by the number of days, the shadow of the fourth field, how long can not be modified password days -x followed by the number of days, shadow The fifth field, how long must change the password -w days after the number of days, the shadow of the sixth field, the number of warning days before the password expired -i followed by "date", shadow of the seventh field, the password expiration date using the pipeline Liu Set the password: echo "zeng" | passwd --stdin zenghao

47.userdel delete user

-r user file is deleted

48.chage [-ldEImMW] account name | modify the user password related attributes

-l List detailed password parameters of the account; -d followed by date, modify the shadow third field (date of last password change), format YYYY-MM-DD-E followed by date, modify shadow eighth field (account number Expiration date). Format YYYY-MM-DD-I followed by the number of days, modify the shadow seventh field (password expiration date) -m followed by the number of days, modify the shadow of the fourth field (password minimum retention days) -M followed by days, modify Shadow fifth field (how long the password needs to be changed) -W days after the day, modify the sixth shadow field (warning date before the password expires)

49.usermod [-cdegGlsuLU] username | Modifying user related attributes

-c Followed by the account description, that is, the description column in the fifth column of /etc/passwd, you can add some account description. -d followed by the home directory of the account, that is, modify the sixth column of /etc/passwd;-e followed by the date, the format is YYYY-MM-DD is the eighth field data in /etc/shadow! -f is followed by the seventh field of days shadow. -g followed by the initial group, modify the fourth field of /etc/passwd, which is the GID field! -G is followed by a secondary group. Modify the user-supportable group -l to follow the account name. That is to modify the account name, the first column of /etc/passwd! -s is followed by the actual shell file, such as /bin/bash or /bin/csh. -u is followed by the UID number! That is, the third column of /etc/passwd; -L freezes the password -U thaws the password

50.id [username] | View user related id information, can also be used to determine whether the user exists

51.groups View groups for login user support. The first group to output is a valid group.

52.newgrp switch effective group

53.groupadd [-g gid] Group Name | Add Group

-g sets the specific group id for adding groups

54.groupmod [-g gid] [-n group_name] group name | modify group information

-g modify existing GID numbers -n modify existing group names

55.groupdel [groupname] | Delete Group

56.gpasswd | Group Administrator Features

Root administrator action: -gpasswd groupname set password -gpasswd [-A user1,...] [-M user3,...] groupname -A Handle the mastership of groupname to the next user (the group Group Administrator) -M Add some accounts to this group -gpasswd [-r] groupname -r Remove the groupname password from the group manager action: - gpasswd [-ad] user groupname -a Users are added to the groupname group -d to remove a user from the groupname group

57.chfn modify personal information

58.mount [-t vfstype] [-o options] device dir

-ro mounts the device in read-only mode -rw mounts the device in read-write mode eg:mount /home/mydisk.iso /tmp/mnt Accesses the contents of mydisk through mnt

59.umount Unmounting

60.cut

-b : Split in bytes. These byte positions ignore multibyte character boundaries unless the -n flag is also specified. -c : Splits in characters. -d : Custom separator, defaults to tabs. -f : Used with -d to specify which area to display.

61.sort

-n Sort by the size of the value. -o<output file> Saves the sorted result to the specified file. -r sorts in the reverse order. -t<delimiter character> Specifies the field separator character to use when sorting. -k Select which range to sort by.

62.wc counts the number of bytes, words, and lines in the specified file, and outputs the statistical results

-l filename report lines -c filename report bytes -m filename report characters -w filename report words

63.uniq remove adjacent duplicate lines in the file

-c or - count: Displays the number of times the line repeats next to each column; -d or --repeated: displays only recurring rows and columns; -f <field> or --skip-fields=<field> : Ignore the comparison of the specified field; -s<character position> or --skip-chars=<character position>: Ignore comparison of the specified character; -u or -unique: only display one row; -w< character Location> or --check-chars=<character location>: Specifies the character to compare.

64.set display environment variables and ordinary variables

65.env show environment variables

66.export turns ordinary variables into environment variables

67.unset delete an environment variable

Aaa(){} defines the function

68.read

-p call prompt character -t wait seconds

69.declare, typeset

-i is declared as an integer -a is declared as an array -f is declared as a function -r is declared as read-only

70.ulimit limit user's certain system resources

-f The maximum file size that can be created by this shell (usually possibly set to 2GB) is in Kbytes. eg: ulimit -f 1024 Limit users to only create files with a capacity of 1MBytes or less

71.df [options] [file] | Displays the free space of the specified disk file. If no file name is specified, the free space of all currently mounted file systems will be displayed.

-a show all file system -h file size friendly display -l only show local file system -i show inode information -T show file system type

72.du [options] [files] | Display disk usage space for each file and directory

-h easy-to-read mode -s only shows the size of the sum

73.ln [Parameter] [Source file or directory] [Target file or directory] | A file creates a synchronized link in another location

-s create a soft connection -v show detailed processing

74.diff [Parameters] [File 1 or Directory 1] [File 2 or Directory 2] | Compare individual files or directory contents

-b Does not check for differences in whitespace characters. -B Does not check for blank lines. -i Does not check case -q Shows only differences without displaying detailed information eg: diff ab > parch.log Compares two files and creates a patch

75.date [parameter]... [+format] | Display or set the date and time of the system

%H hours (indicated by 00-23). %M minutes (in 00-59). %P AM or PM. %D Date (year, month, day) %U The number of weeks in the year. Date -s "2015-10-17 01:01:01" //Time setting date +%Y%m%d //Display the date of the previous day date +%Y%m%d --date="+1 Day/month/year" //Display the date of the previous day/month/year date+%Y%m%d --date="-1 day/month/year" //display the date of the day/month/year after the date -d '2 weeks' date after 2 weeks

76.cal [Parameter] Month] [Year] | View Calendar

-1 Display monthly calendar of the month -3 Display the calendar of the previous, next, and next month -m Display Monday as the first day of a week -s (Default) Sunday as the first day -j Display the current month as the year Days of Calendar -y Displays the current year's calendar

77.ps | List Snapshots of the Current Process

a shows all processes -a shows all programs under the same terminal e shows environment variables f shows relationships between processes -H shows tree structure r shows current terminal program T shows current terminal all programs -au shows more detailed information -aux Displays all schedules that contain other users -u Specifies all processes for the user

78.top [parameter] | Display information about the process currently executing in the system, including process ID, memory usage, CPU usage, etc.

79.kill [parameter] [process number] | Kill process

80.free [param] | Displays the free, used physical memory and swap memory of the linux system, and the buffer used by the kernel

81.vmstat | Monitoring Operating System Virtual Memory, Processes, CPU Activity

82.iostat [parameter] [time t] [time n] (refresh every t time, up to n times) | Monitor the disk operations of the system, report disk activity statistics, and report CPU usage Happening

-p [disk] shows the status of the disk and partition

83.watch [arguments] [command] | Repeat a command to observe changes

-n How many seconds refresh after -d highlights dynamic changes

84.at [parameter] [time] | Performs a specified task at a specified time, only once

HH:MM[am|pm] + number [minutes|hours|days|weeks] Forces the task to be performed at a certain time on a certain day of the month in a certain year. aq View tasks not performed by the system atrm n Delete the task number n -cn Displays the contents of task number n

85.crontab | Scheduled Task Scheduling

File to load crontab-e to edit the contents of a user's crontab file -l to display the contents of a user's crontab file -r to delete a user's crontab file

86.ifconfig [Network Devices] [Parameters] | Viewing and Configuring Network Devices

87.route | Displaying and Manipulating IP Routing Tables

88.ping [parameter] [host name or IP address] | Test connectivity to the target host

-q shows only the final result

89.netstat | Display Statistics Related to IP, TCP, UDP, and ICMP Protocols

90.telnet [parameter] [host] | Used for remote login, using clear text to send packets, security is not good

91.rcp [Parameter] [Source File] [Target File] | Remote File Copy

-r Recursive replication -p preserves the properties of the source file used: rcp -r remote_hostname:remote_dir local_dir

92.wget [parameter] [URL address] | Download files directly from the Internet

-o FILE Writes records to a FILE file eg : wget -O a.txt URLwget --limit-rate=300k URL Limit download

93.awk

-F delimiter Separates the content of the content of the script to be executed by delimiter {eg} cat /etc/passwd |awk -F ':' '{print $1""$7}'

94.sed Replace, delete, add, and select data rows

a new, in the new next line appears c replace, replace the line between n1, n2 eg: sed '1, 2c Hi' abd delete i insert, appears in the new line

95.paste merge files, you need to ensure that the number of merged two file lines is the same

-d Specifies a domain delimiter that is different from the space or tab key -s Combine by row, single file by one line

96.su [arguments] user | switch login

-l switch along with environment variables, working directory change -c command execute command to return to the original user

97.sudo | Execute Specific Commands with Specific User Permissions

-l Lists the current user-executable command -u username#uid to specify the user to execute the command

Thyristor Module

Thyristor module is one of the most commonly used semiconductor devices because of its small size, simple structure and strong function.This device has been widely applied in various kinds of electronic equipment and electronic products, used as a rectifier, inverter, frequency, voltage regulator, contactless control of motor speed, motor excitation, non-contact switch and the power control, etc.



Thyristor Module,High Current Thyristor Module,Air Cooling Thyristor Module,Standard Voltage Thyristor Module

YANGZHOU POSITIONING TECH CO., LTD. , https://www.cnchipmicro.com