Find and Delete log files on a linux system. Think before you act.
1 |
find / -name '*bash_history*' -name '*.bash_logout' -name '*log*' -name '*ksh_history*' -name '*bash_logout*' -name '*utmp*' -name '*wtmp*' -name '*adm*' |
Find and Delete log files on a linux system. Think before you act.
1 |
find / -name '*bash_history*' -name '*.bash_logout' -name '*log*' -name '*ksh_history*' -name '*bash_logout*' -name '*utmp*' -name '*wtmp*' -name '*adm*' |
Delete all lines of a file containing a regex pattern using sed. For example you can delete all commented lines of a default configuration file. Take a look on my basic regex cheat sheet
1 |
sed -i '/regexPattern/d' path/to/file1.log |