Archive: 2019

sed Commands

sed one linersInsert character at beginning of lineComment all nfs entries in fstabsed -i '/nfs/s/^/#/' /etc/fstab Uncomment all nfs entries in fstabsed -i '/nfs/s/^#//g' /etc/fstab Su

tar / gzip commands

Here, we are sending the tar file to -, which stands for tar’s standard output. This is piped to gzip, which compresses the incoming tar file, and the result is saved in backup.tar.gz. The -c option t

Top CPU & Memory Processes

Display top 10 processes eating up CPUDisplay by processps -eo pcpu,pid,user,args | sort -k 1 -r | head -10 Display by userps -U apache -u apache u Display top 10 processes eating up memoryps axo %mem

tcpdump commands

Capture DHCP requestsPXE pxedhcp01 ~ # tcpdump -i eth1 \(port 67 or port 68\)tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on eth1, link-type EN10MB (Ethernet), c

How to Add Swap Space

How To Add Swap Space to a Linux SystemThere are two ways to go about adding swap space to a linux system. Use of a hard disk partition Create a swap file on an existing file system To view current

Enable auto logoff

Enabling automatic logoffSystems can be set to automatically logoff a user after a period of activity by setting some parameters: Linux/Solaris /etc/profile AIX /etc/security/.profile Parameter decl

/boot/grub/stage1 not read correctly

After pxe booting a server and installing linux from a cpio archive, grub failed to load using the grub-install command. The error presented was as follows: root@pxe:~# mkdir /targetroot@pxe:~# mount

Create logical volume using lvm

This example uses a local hard disk to create a logical volume. partition the disk as normal using fdisk. I new the fdisk options ahead of time from having done this before. EDS etldev1 ~ # FDISK_C

Set static and default gateway in route-eth file

Define default gateway in route-eth file[root@linux01 ~]# cat /etc/sysconfig/network-scripts/route-eth1default via 10.195.30.1 dev eth1 Define default gateway in /etc/sysconfig/network:[root@linux01 ~