在Linux命令行中,可以使用find
命令来搜索文件。以下是一些基本的用法:
find . -name "filename.txt"
find /home/user -name "filename.txt"
find . -name "*.txt"
find /home/user -name "*.txt"
find . -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f2-
find /home/user -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f2-
find . -type f -exec ls -lh {} \; | sort -rh -k5
find /home/user -type f -exec ls -lh {} \; | sort -rh -k5
这些只是find
命令的一些基本用法。find
命令非常强大,可以通过添加更多的选项和参数来实现更复杂的搜索需求。要了解更多关于find
命令的信息,请查阅Linux手册页(通过运行man find
命令)。