Tag: hdparm
useful commands that can be used when backing up
by admin on Aug.06, 2009, under linux
Currently, starting from the working directory, to find and delete empty sub-folders;
to find. -Type d-empty-exec rmdir {} \;
Contents to find changed files;
find /-mmin 30-type f (changed in the last 30 minutes)
find /-mtime -1-type f (changed in the last 24 hours)
All MySQL databases to back up their own names;
for I in `echo" show databases "| mysql | grep-v Database`; do mysqldump $ I> "$ I.sql"; done
To delete a folder, the files in the folder B (accidentally opened archive files);
for file in / *; do rm / `basename $ file`; done
The remote web server to check the file exists;
wget-spider-v http://www.google.com/robots.txt
To get the hard disk model and serial number;
hdparm-i / dev/sda1
GB, MB, KB and Bytes, the tree structure of folders to be listed;
du-b-max-depth 1 | sort-nr | perl-pe 's {([0-9 ]+)}{ sprintf "% .1 f% s", $ 1> = 2 ** 30? ($ 1 / 2 ** 30, "G"): $ 1> = 2 ** 20? ($ 1 / 2 ** 20, "M"): $ 1> = 2 ** 10? ($ 1 / 2 ** 10, "M"): ($ 1, "")} e '
Up to 10 process and to see the details of memory (top and htop results are better with);
ps aux | sort-nk +4 | tail
[Commandlinefu'ya thanks]
