A simple example of LinuxShell programming-Linux general technology-Linux programming and kernel information. The following is a detailed description. Introduction: I have been learning shell for some time. I feel that learning shell is a multi-practice program like other languages. A lot of online shell beginners are worried that they will not be able to find the practice program. I have integrated some basic exercises I encountered during shell learning, hoping to inspire shell beginners. (Maybe it shouldn't be integration. I'm used to this word)
There is no order in the example: Each example may have multiple methods
1.
Search for all files containing codfei in/home/codfei and its subdirectories.
Method 2:
[Root @ localhost Unix_c] # find/home/codfei/-type f | while read I; do grep-n codfei $ I & echo -----; done
1: codfei ::::::::::::::::::::::
/Home/codfei/c/Unix_c/2
-----
1: codfei ::::::::::::::::::::::
/Home/codfei/c/Unix_c/1
-----
Binary file/home/codfei/c/. charset. c. swp matches
/Home/codfei/c/. charset. c. swp
-----
2. Design a Shell program and create 50 directories under the/userdata directory, that is, user1 ~ User50, and set the permission for each directory to rwxr-xr --
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.