Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common programming commands in Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "what are the common programming commands in Linux". The editor shows you the operation process through actual cases, the operation method is simple and fast, and it is practical. I hope this article "what are the common programming commands in Linux" can help you solve the problem.

The help command man provides online help with permissions for all users.

The command name 1 for which man needs help has a function to automatically complete the code in the terminal, enter a character sufficient to determine a unique file, and then press Tab

Help is used to display some help for using the command. If the display information exceeds a screen, you can use the more program to display the help information in different screens through the pipeline.

Command that needs help-- help | more 1info browses all documents online

Info commands to help 11.2 File system commands File types the most common file type in Linux, including plain text files (ASCII), binary files (binary), and files in data format (data)

A directory file is a directory.

The device file is the interface device that stores data for system access, which is simply the hard disk. Character device file: the interface device of the serial port, such as keyboard, mouse, and so on.

The pipe file FIFO is also a special file type, and its main purpose is to solve the errors caused by multiple programs accessing a file at the same time. FIFO is the abbreviation of first-in-first-out (first in first out).

The linked file is similar to the shortcut under Windows.

Linux file directory structure Linux file directory structure belongs to a hierarchical tree structure, is an upside down tree, the file system starts from the root directory (/) to grow down.

Linux mounts different file systems in different subdirectories under the root file system, and users can easily find files that store different file systems from the root (/).

The Linux file common directory / (root directory) contains all directories and files

/ bin stores executables of important Linux commands for use by administrators and ordinary users.

/ boot stores all the files that boot the Linux operating system, including the binary image of the Linux kernel.

/ dev device directory, which stores the corresponding files for the devices on the linked computer.

/ etc stores files and directories related to a specific host.

/ home stores the home directory of the average user.

/ lib stores various programming language libraries.

/ mnt is used to mount the file system temporarily, and the system administrator executes the mount command to complete the mount.

/ opt is used to install additional software packages.

/ proc current process and system information, only memory exists in this directory.

The home directory of the / root root user. The other users' home directories are located in the / home directory.

The / sbin directory / sbin,/user/sbin and / user/local/sbin both store system management tools, applications, and general root commands.

/ tmp stores temporary files, which are used by some commands and applications.

/ usr stores information such as system commands and applications used by users.

/ var is used to store variable data, which is constantly changing during operation.

Home directory and current directory home directory: user default login directory current directory: user's current directory. Represents the parent employment of the current directory. Express

Ls: used to display the contents of the directory, and its permissions are for all users. Command uses format

Ls [Parameter] [File name] / / Parameter:-a lists all files-l displays information about the specified destination in a long format-F adds a character at the end of each file to describe the type of file-s displays the size of the file-t sorts the files by time-A lists except "." And ".." Files other than-R lists the files of all subdirectories under the directory, which is equivalent to the "recursive" implementation in programming-L lists the link names of files-S sorts by file size 1234567891011

Hiding files under Linux is based on "." The file name at the beginning.

Mkdir: create subdirectories with permissions for all users

Mkdir [parameters] [directory name] parameter:-m set permissions-v returns information every time a new directory is created, user permissions rwx read and write modify rw- 1106 rwx 1117rmuri-1004777 represents rwx permissions 123456789

Rmdir: deleting a directory

Rmdir directory name 1

Cd: switching directories

Cd directory name 1vi: text editor

Gedit: text editor

Mv: used to rename a file or directory, or to move a file from one directory to another. Permissions for all users

Mv a.txt aa.txt mv source filename destination filename 12cp: copy a file or directory to another directory with permissions for all users.

Cp source file name destination file name 1rm delete file or directory

Rm [parameters] file parameter:-r indicates that all directories and subdirectories listed in the parameter are recursively deleted-f ignores files that do not exist, does not prompt 1234grep to search for specific content in the specified file, and outputs lines containing these contents standard.

Grep [parameter] [file name] parameter:-v displays all lines that do not contain matching text-n displays matching lines and line numbers 1234find searches for files in the directory, permitting all users.

Find [path] [Parameter] [File name] Parameter:-name search by document name-user finds 1234head by document attribute Master: view the contents of the file

Head [parameter] file name parameter:-c N displays the first N bytes of the file-N displays the first N line 1234

Tail: used to display the tail of one or more files

Tail [parameter] filename parameter: + /-n if it is worth being preceded by a plus sign, write the file to standard output from the number of cells specified at the beginning of the file, and if the value is preceded by Jianhao, write the file to the standard output from the number of cells specified at the end of the file by default-- after f shows the last line of the file, if the file is being appended, it will continue to show the additional line. Type + C 12345.

Wc: count the number of lines, words, and bytes of a file

Wc [parameter] file name parameter:-c statistics file bytes-m statistics file characters-l statistics file lines-L statistics file maximum line length-w statistics file words 1234567

One of the commands for file compression and decompression in gzip:Linux system

Gzip [parameter] [file name] parameter:-d decompress files-r find the specified directory and compress or extract all files in it-t check whether compressed files are intact one of the commands for file compression and decompression in the 12345bzip2:Linux system

Bzip2 [parameters] [File name] Parameter:-d decompress the file-k compressed file and retain the original file-z force compression-t check whether the compressed file is complete or not. A more reliable method of packaging, compression, and decompression of backup files in the 123456tar:Linux system.

Tar [parameter] [file name] parameter:-c create a parameter instruction for a compressed file-x uncover a parameter instruction for a compressed file-z specifies that the file also has the properties of gzip-v generates text messages for detailed reports on tar processing during compression-j calls the bzip2 command to compress or extract files-f use archives or devices This option is a required 123456781.3 system management common command useradd: used to create a user account and create a user's starting directory, using permissions super directory.

Useradd new user name 1passwd modifies the login password of the account. The permission is for all users.

Passwd account name 1kill: used to terminate a process

Kill [parameter] process number 9-9-1 means to kill all processes 12date: display and set the current date and time

Calculation of date time 1bc: bc

Echo "scale=7;355/113" | bc 1

Scale specifies the number of decimal places to keep, ibase specifies the carry system for data identification, and obase specifies the carry system for data output

1.4 Network operation common commands ifconfig view and change the address and parameters of the network interface, including IP address, network mask, broadcast address. Use privilege superuser

Ifconfig [ip netmask subnet mask] Network adapter name: specify the network interface name netmask subnet mask broadcast address set the broadcast address of the interface 1234ifup: activate a network adapter card

Ifdown closes a network adapter card

Ping detects the status of host network interface

Netstat checks the status of the entire network

Arp is used to determine the physical address of the network card corresponding to the IP address and to view the current content in the arp cache of the local computer or another computer.

This is the end of the content about "what are the common programming commands in Linux?" Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report