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

Linux commands for beginners-basic Operations

2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Linux commands for beginners-basic Operations

Text keywords: Linux, common commands, basic operations

Pwd: show the full path of the current working directory cd: switch the current working directory ls: display directory and file information touch: create or modify file time mkdir: create directory cp: copy files and directories rm: delete files or directories mv: move (rename) files or directories find: search for files or directories du: calculate the space occupied by files or directories 1, pwd

Displays the full path to the current working directory

II. Cd

Switch the current working directory

Usage: cd path cd.: switch to the current directory cd..: switch to the parent directory cd -: return to the previous directory (equivalent to backing) cd [~]: switch to the current user home directory, ~ omit cd / xxx/xxx: switch to a certain path (absolute path writing) cd xxx/xxx: switch to a certain path (relative path writing)

III. Ls

Display directory and file information

Usage: ls [option] [file / directory]-a: display all information, including hidden files and directories (starting with a dot)-d: display information about the directory itself, not information under the directory-h: humanized display (that is, easy to read) capacity information-l: long format display details-c: show the last modification time of the file or directory Use-u: with l to display the last access time of the file or directory, and with l to sort by modification time (sort by file name by default)

IV. Touch

When the file was created or modified

Usage: touch file / directory if the file does not exist, create if the file exists, update the file all time is the current system time

5. Mkdir

Create a directory

Usage: mkdir [options] [directory]-p: create a multi-level directory

VI. Cp

Copy files and directories

Usage: cp [option] Source destination-r: recursive, copy files and subdirectories, generally used when copying directories

7. Rm

Delete a file or directory

Usage: rm [option] file / directory-f: do not prompt, force deletion-I: prompt whether to delete before deletion-r: delete the directory and all the contents under the directory

VIII. Mv

Move a file or directory, or rename it if you move it in the same directory

Usage: mv source target

IX. Find

Search for a file or directory

Usage: find [command options] [path] [expression options]-empty: find blank files or directories-group: find by group-name: find by name-iname: find by name, case-insensitive-mtime: find by modification time-size: find by capacity size-type: find by file type (file: F, directory: d, device: Bambic Link: l)-user: find by user-exec: execute the command on the found file-a: and-o: or

10. Du

Calculate the space occupied by a file or directory

Usage: du [option] [file / directory]-h: humanized (easy to read) display space information-s: display only the total occupied space

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

Servers

Wechat

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

12
Report