29 Linux commands you must know

Release: 2023-08-02 17:24:19
forward
778 people have browsed it

# Commands are instructions for the computer to perform tasks. You can use commands to shut down the computer, or list the file list of the current directory, or the contents of the current text, or display a message on the screen.


29 Linux commands you must know


If you are a newbie and trying to use the command line interface, we have collected a variety of basic Linux commands for you to learn and help you complete various tasks in various Linux distributions. Although it is not very detailed, it is very useful for Linux beginners, ordinary users, or administrators.


##1.ls – List


ls will list the contents (files or folders) of the current working directory, just like you open a folder in the GUI to see the contents.


29 Linux commands you must know


2.mkdir – Make Directory


##mkdir Common one New directory


29 Linux commands you must know


3.pwd – Print Working Directory


pwd displays the current working directory


29 Linux commands you must know


##

4.cd – Change Directory


For the session currently running in the terminal, cd Sets the given folder (or directory) to the current working directory.


29 Linux commands you must know


5.rmdir – Remove Directory


rmdir Deletes the given directory.


29 Linux commands you must know


6.rm – Remove


##rm will remove the given For files or folders, you can use rm -r to recursively delete the folder


29 Linux commands you must know


7.cp – Copy


cp command copies files or folders. You can use the cp -r option to copy files recursively. folder. In addition, search the backend reply of the top architect on the public account for "algorithm" to get a surprise gift package.


29 Linux commands you must know


8.mv – MoVe


##mv command to file or folder to move. If the file or folder exists in the current working directory, you can also rename the file or folder.


29 Linux commands you must know


9.cat – concatenate and print files


cat is used to view the contents of a file on standard output (monitor or screen).


29 Linux commands you must know


10.tail – print TAIL (from last) >


##tail By default, the last 10 lines of a given file are displayed on the standard output. You can use tail -n N to specify that the last N lines of the file are displayed on the standard output.


29 Linux commands you must know


11.less – print LESS


less Print file contents by page or window. Very useful and efficient when viewing large files containing large amounts of text data. You can use Ctrl F to page forward and Ctrl B to page backward.


29 Linux commands you must know


12.grep


#grep "" at Searches the given file for the specified string. grep -i "" will ignore the case of strings when searching, while grep -r "" will search for files in the current working directory. Search recursively for the specified string.


29 Linux commands you must know


13.Find


This command will search for files matching the conditions in the given location. You can use the -name option of find -name to perform a case-sensitive search, and find -iname Perform a case-insensitive search.

##find -iname

29 Linux commands you must know


14.tar


##The tar command can create, view and extract tar compressed files. tar -cvf is to create the corresponding compressed file, tar -tvf to view the corresponding compression file, tar -xvf to extract the corresponding compressed file.


29 Linux commands you must know


15.gzip


The gzip command creates and extracts gzip compressed files. You can also use gzip -d to extract compressed files.


29 Linux commands you must know


16.unzip


#unzip for gzip documents Unzip. Before decompressing, you can use the unzip -l command to view the file contents.


牛逼啊!接私活必备的 N 个开源项目!赶快收藏吧
Copy after login


29 Linux commands you must know


17.help


--help will list all available commands in the terminal. You can use the -h or -help option of any command to view the command. Specific usage.


29 Linux commands you must know


18.whatis – What is this command


##whatis will be used A single line describing the given command.


29 Linux commands you must know


19.man – Manual


man displays a man page for the given command.


29 Linux commands you must know


20.exit


##exit is used to end the current terminal session.


29 Linux commands you must know


21.ping


ping Pings the remote host (server) by sending data packets, which is commonly used to detect network connections and server status.


29 Linux commands you must know


22.who – Who Is logged in


who can list the currently logged in user name .


29 Linux commands you must know


23.su – Switch User


su is used to switch between different users. Superusers can switch to other users even without using a password.


29 Linux commands you must know


24.uname


##uname will display important information about the system, such as kernel name, Host name, kernel version, processor type, etc., use uname -a to view all information.


29 Linux commands you must know


25.free – Free memory


free will display the system's free memory, occupied memory, available swap memory and other information. free -m will convert the units in the result into KB, while free -g will convert into GB.


29 Linux commands you must know


26.df – Disk space Free


df View disk usage in the file system – Used and available storage space on hard drives and other storage devices. You can use df -h to display the results in a human-readable format.


29 Linux commands you must know


27.ps – ProcesseS


ps displays the running process of the system.


29 Linux commands you must know


28.Top – TOP processes


The top command will display according to the CPU usage by default. For processes that occupy a large amount of space, you can use top -u to view a user's CPU usage ranking.


29 Linux commands you must know


29.shutdown


shutdown is used to shut down the computer, and shutdown -r is used to restart the computer.

The above is the detailed content of 29 Linux commands you must know. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:Linux中文社区
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!