- Linux Shell Scripting Cookbook(Third Edition)
- Clif Flynt Sarath Lakshman Shantanu Tushar
- 96字
- 2021-07-09 19:46:30
How it works...
When using ls and grep to display symbolic links in the current folder, the grep ^l command filters the ls -l output to only display lines starting with l. The ^ specifies the start of the string. The following l specifies that the string must start with l, the identifier for a link.
When using find, we use the argument -typel, which instructs find to search for symbolic link files. The -print option prints the list of symbolic links to the standard output (stdout). The initial path is given as the current directory.