Tips-Useful commands
Author: admin Posted in November 12, 20071. Creating a tar.gz file:
tar -czpf folder_name.tar.gz folder_name
this command create folder_name to folder_name.tar.gz 。
2. Seaching a specific word/string from a file
find ./ -name ‘*.html’ -exec grep “breadcrumbs.inc.php” ‘{}’ \; -print
This command searchs all html files which contains “breadcrombs.inc.php”string.
3. Find & replace
sed -i ’s/b/strong/g’ index.html
This command searchss “b” from “index.html” and then replace it with “strong” .
4. Checking a folder’s space status
du -h –max-depth=1 | sort -n -r