pavement

Commonly used commands

From FreeBSDwiki
Revision as of 16:31, 6 August 2012 by 173.88.199.104 (Talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Commonly Used Commands

'dmesg to display boot messages'
'dmesg -a to display boot messages plus start tasks'
ls -l to display long version of file names" ls cust* to display only file names prefixed with cust* ps ax to display running tasks ifconfig -a to display assigned IP address of Nic cards cat b >> a to append file b to end of file a halt to stop system before manual power off reboot to do clean shutdown and reboot the system vipw to edit contents of system user password DB rm -rf /custom/ to delete directory and all its sub-directories dig ipaddr to find who owns that ip address whois ipaddr to find who owns that ip address nslookup ipaddr to find who owns that ip address chmod 770 *.php to give rwx permission to all files ending with php chown www *.php to change owner of all files ending with php to www pkg_add -rv unix2dos to add a pkg pkg_info to list full names of all installed packages pkg_info | grep php* to list only matching names from packages list pkg_delete mc-4.6.1_4 to delete pkg use full name from pkg_info list touch /var/log/ppp.log to create empty file /etc/rc.d/netif restart to restart Nic card and get ISP IP address kill -HUP pid to re-read changes made to conf files ls -lh filename to display sparse file allocation size du -h filename to display sparse file used size systat -ifstat to display nic traffic amount man xxxxx | col -b > xxxxx.txt create text file of manual page last | grep boot to display list of dates system was booted sysctl kern.boottime to display date of last system boot

sort -k 13.1,13.30 -k 8.1,8.15 filein > sorted.file.out

 -k = the key fields to be sorted. A field is defined as any data
 surounded by blanks. so 13.1,13.30 means sort on the 13 field in the
 record starting at pos 1 of that field through pos 30
 

cut -d " " -f 1 file1 > file-results

diff -ruN original.file updated.fle > patch.file
See custom.PKG.delete.instructions for details on how to use
 

dd if=/dev/zero of=/dev/da0 count=2 to zero out Master Boot Record dd if=/dev/da0 count=1 | od -c to display Master Boot Record diskinfo -v /dev/da0 to display firmware head/cyl/sector sizes

Personal tools