To tail multiple files with multitail simply invoke the program followed by the two filenames you wish to follow. The nice thing about multitail is it creates two panes, one for each file. These panes can scroll independently and search works across both panes.
The tail command is fast and simple. But if you want more than just following a file (e.g., scrolling and searching), then less may be the command for you. Press Shift-F. This will take you to the end of the file, and continuously display new contents.
Use chmod -R 755 /opt/lampp/htdocs if you want to change permissions of all files and directories at once.
To log all the files inside a folder, you can go to the folder and write
tail -f *.log
To add the subfolders to the tailf command, use
tail -f **/*.log
Of course, the regular expression can be improved to match only specific file names.
This will recursively find all *.log files in current directory and its subfolders and tail them.
find . -type f \( -name "*.log" \) -exec tail -f "$file" {} +
Or shortly with xargs:
find . -name "*.log" | xargs tail -f
If all log files doesn't have same extension. You can use following command.
tail -f **/*
This way find files recursively, print lines starting on line 5 in the each file and save on concat.txt
find . -type f \( -name "*.dat" \) -exec tail -n+5 -q "$file" {} + |tee concat.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With