mirror of
				https://github.com/Stunkymonkey/dotfiles.git
				synced 2025-10-31 02:12:10 +01:00 
			
		
		
		
	shell/aliases: add io alias to use processname with iotop
This commit is contained in:
		
							parent
							
								
									78bbb4c3e7
								
							
						
					
					
						commit
						5dbd636062
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		|  | @ -41,9 +41,19 @@ alias fu='sudo "$BASH" -c "$(history -p !!)"' | ||||||
| # open any file wihtout the knowledge of what type it is | # open any file wihtout the knowledge of what type it is | ||||||
| alias of="xdg-open" | alias of="xdg-open" | ||||||
| 
 | 
 | ||||||
|  | # only list the IO of <processname> with iotop | ||||||
|  | # io <processname> | ||||||
|  | io(){ | ||||||
|  | 	local sudo_needed | ||||||
|  | 	[ ! -z "$(type sudo 2>/dev/null)" -a "$USER" != 'root' ] \ | ||||||
|  | 		&& sudo_needed="sudo" | ||||||
|  | 
 | ||||||
|  | 	${sudo_needed} iotop -p$(pidof "$1" | sed 's/ / -p/g') | ||||||
|  | } | ||||||
|  | 
 | ||||||
| if [ ! -z "$(type sudo 2>/dev/null)" -a "$USER" != 'root' ]; then | if [ ! -z "$(type sudo 2>/dev/null)" -a "$USER" != 'root' ]; then | ||||||
| 	#create sudo aliases WITHOUT leading s | 	#create sudo aliases WITHOUT leading s | ||||||
| 	for sudo in mount umount iftop fsadm lvchange lvconvert lvcreate lvdisplay lvextend lvm lvmchange lvmconf lvmconfig lvmdiskscan lvmdump lvmetad lvmsadc lvmsar lvreduce lvremove lvrename lvresize lvs lvscan pvchange pvck pvcreate pvdisplay pvmove pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend vgimport vgimportclone vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan vgsplit; | 	for sudo in mount umount iftop iotop fsadm lvchange lvconvert lvcreate lvdisplay lvextend lvm lvmchange lvmconf lvmconfig lvmdiskscan lvmdump lvmetad lvmsadc lvmsar lvreduce lvremove lvrename lvresize lvs lvscan pvchange pvck pvcreate pvdisplay pvmove pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend vgimport vgimportclone vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan vgsplit; | ||||||
| 	do | 	do | ||||||
| 		type $sudo > /dev/null 2>&1 && alias $sudo="sudo $sudo"; | 		type $sudo > /dev/null 2>&1 && alias $sudo="sudo $sudo"; | ||||||
| 	done | 	done | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Felix Buehler
						Felix Buehler