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

Summary of common commands in Shell

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

author| Genius idiot dream source| Blog Park

1 ls command: list files

ls -la Lists all files and folders in the current directory

ls a* Lists all files in the current directory that begin with the letter a

ls -l *.txt Lists all files in the current directory with the suffix txt

2 cp Command: Copy

cp a.txt b.txt : copy the contents of file a to file b

cp a.txt ./ test : copy file a to text directory

cp -a test test2: recursively copy all files (including hidden files) under the directory test to the new directory test2

3 cat command: view combined files

cat a.txt: View the contents of the file

cat a.txt >> b.txt: Combine the contents of file a to the end of the contents of file b

cat-n a.txt: View files and label them with line numbers

4 touch command: create file

touch a.txt: Create a txt file named a

5 rm command: delete files

rm-rf a.txt: Force deletion of file a.txt

tm-i a.txt: there will be a prompt before deleting the file. Are you sure to delete the file?

6 mkdir command: Create directory

mkdir test: Create a directory named test

7 rmdir command: delete directory

tmdir test: Delete a directory

8 echo, cat commands: add content

echo "hello world! " >> a.txt: Add content to file a

cat a.txt : You can add multiple lines to the end of the file itself

cat

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

Network Security

Wechat

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

12
Report