An Interest In:
Web News this Week
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
July 13, 2020 07:59 am GMT
Original Link: https://dev.to/skorotkiewicz/the-linux-commands-that-help-me-work-2o99
The linux commands that help me work
Here are some commands to help me with my work.
And what are your useful commands that you use?
Searching for files and folders with the given name
grep -i -n -r 'Search string' /var/www/path/
Shows how many times is the search text in the text and returns the result in numbers.
cat access.log|grep 'Search string' | wc -l
Remove all .gz from /var/log/
find /var/log/ -name "*.gz" -type f -delete
Find and replace text in all files in a directory
find ./ -type f -exec sed -i 's/string1/string2/g' {} \;find /var/log/ -type f -exec sed -i 's/string1/string2/g' {} \;
Unpack tar files
tar -xJfv file.tar.xztar -xvf file.tar.bz2
while
while true; do COMMEND; done
Original Link: https://dev.to/skorotkiewicz/the-linux-commands-that-help-me-work-2o99
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To