-
The command to view files and directories in Linux is: ls
The original English meaning of ls: list, the path where the command is located: bin ls, applies to all user permissions, and the main function is to display the directory file in the form of a list.
Its syntax: ls option [-ald] [file or directory].
where -a shows all files, including hidden files;
l Detailed information display;
d Only the directory name is displayed, not the list of contents under the directory;
h Hommization;
i view the i node of any file (similar to the unique information of the ID card);
t Sort by time of change of file and directory; You can use the first displayed file to determine the most recently modified file;
Note:The file at the beginning is a hidden file unless it is a directory.
Extended information: Create directory command: mkdir, original meaning: make directories, the path of the command: bin mkdir, applies to all user permissions, the function is to create a new directory.
Its syntax: mkdir [-p] [directory name].
p is created recursively.
Example: a) Create a single directory: mkdir tmp
b) Create multiple directories: mkdir tmp tmp
Precautions for use:
1. The created directory already exists, then Linux will prompt us that Linux cannot create it.
2. Running the mkdir command without any parameters will create a directory in the current directory.
3. Without -p, if the new file parent directory does not exist, it will not be executed successfully, which is wrong. With or without -p directories, directories that are not in front of them will be created sequentially.
4. The first condition for creating a directory is that you must have access rights under the destination path where you want to create a directory.
-
ls command. is an abbreviation for list, which indicates that the list of file directories is displayed. (Only the file names of non-hidden files are displayed).
Parameter: -a:--all, showing all files, including hidden files (with ..)at the beginning of the document).
l: List long data strings, display data information such as file size and time.
ls -la: Displays all the information included in the file.
-
1. su: user switch format: su [option] [user] When switching to the root user, it is recommended to use the -option, so that the environment variable of root and the working directory can be brought in at the same time.
2. User management: useradd user add usermod user attribute userdel user delete groupadd add group groupmod set group attribute groupdel group delete travel letter passwd set password id display user id group id display user all belong groups who display the user and wheel login to the system.
3. System management command: ps displays the process list of the user in the current system, dynamically displays the program running in the system, and kills to output a specific signal to the specified pid uname to display the system information shutdown or restart the system clear to clear the screen information.
4. Disk command: free to view the current system memory usage df to view the disk space occupation of the file system du to count the disk space occupied by the directory or file fdisk to view the disk partition and partition the hard disk.
5. File-related command cd change current working directory ls list directory and file information mkdir create a folder pwd to view the current directory cat link and display the information about the specified file. cp copy the target file or directory to another file or directory mv move a file or directory to another file or directory rm delete a directory or file chmod change access to a file grep [options] format [file path] search for specific content in the specified file find [path] [options] [description] search for a file in the specified directory.
-
The following are some commonly used Linux commands: ls: to list the files and directories in the current directory.
cd: changes the current directory. pwd:
Displays the path to the current directory. mkdir: creates a new directory.
rm: deletes a file or directory. cp:
Copy a file or directory. MV: Move a file or directory.
touch: Create a new file.
The following is a common command for Linux: Check the kernel version: uname-a.
Console->> GUI: init5 or startx. Graphical Interface->> Console:
su: User switching format: su[option][user] When switching to the root user, it is recommended to use the -option, so that the environment variable of root and the working directory can be brought in at the same time.
Enter the command name directly in the terminal and press enter, and the command syntax and brief description will be displayed. Typing the man command name into the terminal branch will display the man page of the corresponding command, which contains detailed descriptions, parameters, and examples.
-
We all know that Linux is an operating system, unlike the Windows system, Linux is formed by a variety of commands, so the mastery of commands can be said to be crucial, do you know what the relevant commands in the Linux system are to enter the directory? If you're not clear, see below:
The Linux CD command can be said to be the most basic command statement in Linux, and other command statements are based on the use of CD commands.
Therefore, to learn common Linux commands, you must first learn how to use CD commands.
The command format is: cd [dirname]dirname:the destination directory to switch.
The command function is to switch the current directory to dirname.
The dirname notation can be either an absolute path or a relative path, and if the directory name is omitted, it will be changed to the user's home directory (that is, the directory where the login was just started).
In addition, it is also expressed as the meaning of the home directoryIt indicates the directory ,.. where it is currently locatedindicates the directory one level above the current directory location.
The command usage is as follows:
1. When no parameters are added, it will be switched to the user's home directory by default;
2. Connect the absolute path or relative path and switch to the corresponding directory;
3. Connect the special symbol to enter the corresponding display directory.
The special symbols are:
Go to the user's home directory;
Return to the directory you were in before entering this directory;
: return to the parent directory;
Return to the upper two directories;
: Use the arguments of the previous command as cd arguments.
The command line generally refers to the command prompt, that is, a working prompt in the operating system that prompts for command input. The command prompt varies depending on the operating system. >>>More
Running, microsoft-edge:
Note the colon that follows. >>>More
MySQL exports the specified data table and data [command].
Add the path to the file you installed under the system path, and you're done.
In the Windows operating system, you can use the ping command to check the connectivity of the line. The following table describes how to use the ping command and its parameters: >>>More