Friday, June 16, 2023

Unix

Unix Boot Process

1. BIOS - Basic Input/Output System execute MBR 
2. MBR - Master Boot Record executes GRUB
3. GRUB - Grand Unified Bootloader Execute Kernel 
4. KERNEL - Kernel execuites /sbin/init
5. INIT - Executes runlevel programs
6. RUNLEVEL - Runlevel programes are executed from /etc/rc.d/rc*.d/


du -sk /var/* 2> /dev/null | sort -rn
du -sk *|sort -n      Search for large files in directory


Files larger than 100000 

/var/log/tmp/list_of_files.txt

find / -type f -size +100000 -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }' | sort -nk 2,2 &> /var/log/tmp/list_of_files.txt


Find large files in Unix

1. du -sk *|sort -n
2. du -a /var | sort -n -r | head -n 10
3. find -type f -exec du -Sh {} + | sort -rh | head -n 5

[root@tes01vr usr1]#  find -type f -exec du -Sh {} + | sort -rh | head -n 5

 28G      
14G      
12G      
3.6G     
3.6G    

Use zgrep to search word in .gz file
root@Boston# zgrep myfile *.gz |grep  down | more
$ zcat file.gz | grep word-to-search
zgrep myfile *.gz |grep  up | more


Create a TAR  file
tar -zcvf axway.bkp.tar.gz axway


Untar file 
tar -zxvf share.tar.gz 


Where does win10 stores profile pictures

C:\Users\username\AppData\Roaming\Microsoft\Windows\AccountPictures
C:\Users\myname\AppData\Roaming\Microsoft\Windows\AccountPictures

The Default Account Pictures are stored here:
C:\ProgramData\Microsoft\User Account Pictures

C:\Users\mydesk >shutdown -r -f -t 00 -m 10.200.159.250