0
0
0
s2sdefault

Create Symbolic link:

ln -s <original> <link_name>

Find all .bak files in all subfolders and delete them:

find . -name "*.bak" -type f -delete

Move all *.zip files from the /home direcrory and all subdirectories to the /backup directory:

find /home -iname '*.zip' -exec mv '{}' /backup/ \;

Find a file, and 'cat' the contents:

find / -iname *file* -exec cat {} \;

Find the directory MySQL data is stored:

mysql -uUSER -p -e 'SHOW VARIABLES WHERE Variable_Name LIKE "%dir"'

rsync 1 dir to another:

rsync -vaP --remove-source-files ./source/ ./destination

NOTE: be sure to be exact with the trailing '/' (or lack) as shown

rsync "move" that will survive console exit:

nohup bash -c "rsync -vaP --ignore-existing --remove-source-files /source/dir/ /destination/dir ; rm -rf /source/dir" & tail -f nohup.out

 

Create a dummy log file that is 2048Kb in size:

while [ "$(du -k log.txt|cut -f1)" -lt 2048 ]; do echo "$(date +%s),$(shuf -i 000-999 -n 1).$(shuf -i 0-9 -n 1)" >> log.txt; done

 

 

Add comment


Security code
Refresh

0
0
0
s2sdefault