If you have a filename in a YYYYMMDD-<something>
format you can delete all the files
except (for example) Sunday:
for i in $(ls | sed 's/-.*//g'); do [[ $(date --date=$i +'%w') != 0 ]] && rm -fv ${i}*; done
sed -i -e ':a;N;$!ba;s/line1 match\nline2 match\n//' file
kill -TERM $(ps -u <username> -o "pid=")
find /usr/bin -type l ! -xtype f ! -xtype d -ok rm -f {} \;
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
Test TCP port with bash only (exit should be 0):
echo -e 'test' > /dev/tcp/<ip>/<port>