In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
1. Change the permissions of a file or directory
Q: create the file a.txt, change the user master of the file to read-write execution, the user group to read-write, and the rest to read-only
A:
Create: files can be created with vim.
Modify permissions: the default permission after creation is-rw-r--r--, adds the execution permission of the user head and the write permission of the user group according to the requirements of the problem. The command is as follows:
Chmod upright x a.txt
Chmod Grouw a.txt
A:touch a.txt
Chmod 764 a.txt
two。 Copy command
Q: copy the a.txt file to a b.txt file while preserving the properties of the source file
A:cp-p a.txt b.txt
3. Cut a file
Q: displays the 2nd to 8th characters of each line of the file
A:cut-c 2-8 a.txt
4. Generate difference information
Q: compare the differences between the two files and generate the difference information
A:diff filename1 filename2
5. Identify the file type
Q: show the file types under the / var/log folder
A:ls-l / var/log
A:file / var/log
6. Find a directory or file
Q: find the file name under / usr/bin is openssl file
A:find / usr/bin-name "openssl"
Q: find files that have been modified within 24 hours under the home directory
A:find / home-mtime-1
Q: find files that have been modified within 30 minutes under the home directory
A:find / home-mmin-30
7. Link a file or directory
Q: establish a symbolic link to the file a.txt la.txt
A:ln-s a.txt la.txt
8. Merge the columns of a file
Q: a.txt b.txt is merged column by column and output to standard output.
A:paste a.txt b.txt
9. Package and compress and extract files at the same time
Q: package a.txt and b.txt to c.tar.gz
A:tar zcvf c.tar.gz a.txt b.txt
10. Read data from standard input to standard output and save it as a file
Q: export the file a.txt to standard output and save it as d.txt
A:cat a.txtwitcp a.txt d.txt
A:cat a.txt | tee d.txt
11. Sorting of text content
Q: sort the output of the file a.txt in reverse order
A:tac a.txt
A: sort-r a.txt
twelve。 Show working directory A:pwd
13. Display or configure network devices
Q: displays the working status of the current network device
A: ifconfig
14. Show network status
Q: displays the network status in the listening state of the system
A:netstat-anp | grep LISTEN
15. Encrypted remote login
Q: log in to 172.17.0.20 remotely with quwenqing user
A:ssh quwenqing@172.17.0.20
16. Kill the process in progress
Q: find out the processes in the system that contain the php keyword and kill one of them
A:ps-auxww | grep php
Kill-9 xxx
17. Execute an order in another capacity
Q: display disk usage as root
A:sudo df-h
18. Set or display environment variables
Q: set the environment variable A=ttt to display the environment variable
A:export A = "ttt"
Echo $A
19. Awk displays the matching line containing ab in the file a.txt
A:awk'/ ab/ {print} 'a.txt
20. Awk displays the current record number of the file a.txt, the number of fields, and the first and last fields of each line.
A:awk'{print NR,NF,$1,$NF} 'a.txt
21. Use awk filtering to check the number of connections in netstat
A: netstat-an | awk'/ ^ tcp/ {A [$NF] + +} END {for (an in A) print a, A [a]}'
twenty-two。 Delete 3-5 lines from the a.txt with sed, replace all a with A, and output to the monitor
A:sed '3pm 5d incense a.txt an Accord A Universe
A: sed-e '3mai 5d'-e's Unip. A Unique Amax g 'a.txt
F.A.H ^ _ ^ Amber
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Cat / etc/motd configuration file ^ [1m ^ [31m. = "=. / _ _\ | d b |\ / /, /'- =\ / = -'\
© 2024 shulou.com SLNews company. All rights reserved.