Unix Toolbox. Unix Toolbox.This document is a collection of UnixLinuxBSD commands and tasks which are useful for IT work or for advanced users.This is a practical guide with concise explanations, however the reader is supposed to know what she is doing.TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/54/33/metablogapi/2821.image_thumb_7DAA8DD1.png' alt='Microsoft Generic Text Only Printer Commands In Linux' title='Microsoft Generic Text Only Printer Commands In Linux' />Hardware Statistics Users Limits Runlevels root password Compile kernel Repair grub Misc.Running kernel and system information.Get the kernel version and BSD version.Full release info of any LSB distribution.Su. SE release Get Su.SE version. cat etcdebianversion Get Debian version.Use etcDISTR release with DISTR lsb Ubuntu, redhat, gentoo, mandrake, sun Solaris, and so on.See also etcissue.Show how long the system has been running load.Display the IP address of the host.Linux only. man hier Description of the file system hierarchy.Microsoft Generic Text Only Printer Commands In Linux' title='Microsoft Generic Text Only Printer Commands In Linux' />Show system reboot history.Hardware Informations.Kernel detected hardware.Detected hardware and boot messages.Read BIOSLinux cat proccpuinfo CPU model.Common problems. The different newline conventions often cause text files that have been transferred between systems of different types to be displayed incorrectly.Linux networking commands, network monitoring tools, configuration examples and administration are covered in this tutorial.The YoLinux portal covers topics from.MS Paint, the first app you used for editing images, will probably be killed off in future updates of Windows 10, replaced by the new app Paint 3D.Microsoft lists. Hardware memory.Mem. Total procmeminfo Display the physical memory.Watch changeable interrupts continuously.Used and free memory m for MB.Configured devices.Show PCI devices.Show USB devices.Show a list of all devices with their properties.Show DMISMBIOS hw info from the BIOSFree.BSD sysctl hw. model CPU model.Gives a lot of hardware information.CPUs installed. sysctl vm Memory usage.Hardware memory. sysctl a grep mem Kernel memory settings and info.Configured devices.Show PCI devices.Show USB devices.Show ATA devices.Show SCSI devices.Load, statistics and messages.The following commands are useful to find out what is going on on the system.IO statistics 2 s intervals.BSD summary of system statistics 1 s intervals.BSD tcp connections try also ip.BSD active network connections.BSD network traffic through active interfaces.BSD CPU and and disk throughput.System V interprocess.Last 5. 00 kernelsyslog messages.System warnings messages see syslog.Users id Show the active user id with login and group.Show last logins on the system.Show who is logged on the system.Add group admin and user colin LinuxSolaris.Colin Barschel g admin m colin.G lt group lt user Add existing user to group Debian.A lt user lt group Add existing user to group Su.SE. userdel colin Delete user colin LinuxSolaris.Free. BSD add user joe interactive.Free. BSD delete user joe interactive.Use pw on Free. BSD.Add a new member to a group.Colin Barschel g admin m s bintcsh.Encrypted passwords are stored in etcshadow for Linux and Solaris and etcmaster.Free. BSD. If the master.To temporarily prevent logins system wide for all users but root use nologin.The message in nologin will be displayed might not work with ssh pre shared keys.Sorry no login now etcnologin Linux.Sorry no login now varrunnologin Free.BSDLimits. Some application require higher limits on open files and sockets like a proxy.The default limits are usually too low.Linux. Per shellscript.The shell limits are governed by ulimit.The status is checked.For example to change the open files limit from.This is only valid within the shell.The ulimit command can be used in a script to change the limits for the script only.Per userprocess. Login users and applications can be configured in etcsecuritylimits.For example. cat etcsecuritylimits.Limit user processes.Limit application open files.System wide. Kernel limits are set with sysctl.Permanent limits are set in etcsysctl.View all system limits.View max open files limit.Change max open files limit.Permanent entry in sysctl.How many file descriptors are in use.Free. BSDPer shellscript.Use the command limits in csh or tcsh or as in Linux, use ulimit in an sh or bash shell.Per userprocess. The default limits on login are set in etclogin.An unlimited value is still limited by the system maximal value.Kernel limits are also set with sysctl.Permanent limits are set in etcsysctl.The syntax is the same as Linux but the keys are different.View all system limits.XXXX maximum number of file descriptors.Permanent entry in etcsysctl.Typical values for Squid.TCP queue. Better for apachesendmail.How many file descriptors are in use.How many open sockets are in use.Default is 1. 02.See The Free. BSD handbook Chapter 1.And also Free. BSD performance tuninghttp serverfault.Solaris. The following values in etcsystem will increase the maximum file descriptors per proc.Hard limit on file descriptors for a single proc.Soft limit on file descriptors for a single proc.Runlevels. Linux.Once booted, the kernel starts init which then starts rc which starts all scripts belonging to a runlevel.The scripts are stored in etcinit.N. d with N the runlevel number.The default runlevel is configured in etcinittab.It is usually 3 or 5.The actual runlevel can be changed with init.For example to go from 3 to 5.Enters runlevel 5.Shutdown and halt.Single User mode also S2 Multi user without network.Multi user with network.Multi user with X6 Reboot.Use chkconfig to configure the programs that will be started at boot in a runlevel.List all init scripts.Report the status of sshd.Configure sshd for levels 3 and 5.Disable sshd for all runlevels.Debian and Debian based distributions like Ubuntu or Knoppix use the command update rc.Default is to start in 2,3,4 and 5 and shutdown in 0,1 and 6.Activate sshd with the default runlevels.With explicit arguments.Disable sshd for all runlevels.Shutdown and halt the system.Free. BSD. The BSD boot approach is different from the Sys.V, there are no runlevels.The final boot state single user, with or without X is configured in etcttys.All OS scripts are located in etcrc.The activation of the service is configured in etcrc.The default behavior is configured in etcdefaultsrc.The scripts responds at least to startstopstatus.Go into single user mode.Go back to multi user mode.Shutdown and halt the system.Reboot. The process init can also be used to reach one of the following states level.For example init 6 for reboot.Halt and turn the power off signal USR21 Go to single user mode signal TERM6 Reboot the machine signal INTc Block further logins signal TSTPq Rescan the ttys5 file signal HUPWindows.Start and stop a service with either the service name or service description shown in the Services Control Panel as follows.WSearch. net start WSearch start search service.Windows Search. net start Windows Search same as above using descr.Reset root password.Linux method 1. At the boot loader lilo or grub, enter the following boot option.The kernel will mount the root partition and init will start the bourne shell.Use the command passwd at the prompt to change the password and then reboot.Forget the single user mode as you need the password for that.If, after booting, the root partition is mounted read only, remount it rw.Free. BSD method 1.On Free. BSD, boot in single user mode, remount rw and use passwd.You can select the single user mode on the boot menu option 4 which is displayed for 1.The single user mode will give you a root shell on the partition.Unixes and Free. BSD and Linux method 2.Other Unixes might not let you go away with the simple init trick.The solution is to mount the root partition from an other OS like a rescue CD and change the password on the disk.Boot a live CD or installation CD into a rescue mode which will give you a shell. 36 Ford 3 Window Coupe For Sale . Find the root partition with fdisk e.Mount it and use chroot mount o rw devad.Kernel modules. Linux lsmod List all modules loaded in the kernel.To load a module here isdnFree.BSD kldstat List all modules loaded in the kernel.To load a module here cryptoCompile Kernel.Linux cd usrsrclinux.Clean everything, including config files.Reuse the old. config if existent.Qt or gconfig GTK.Create a compressed kernel image.Compile the modules.Install the modules.Install the kernel.Optionally update the source tree in usrsrc with csup as of Free.BSD 6. 2 or later.I use the following supfile.Free. BSD. org www.CVSUP MIRRORS. default prefixusr.Check hardware information on Linux with hwinfo command.Hwinfo. The hwinfo command is a very handy command line tool that can be used to probe for details about hardware components.It reports information about most hardware units like cpu, hdd controllers, usb controllers, network card, graphics cards, multimedia, printers etc.Hwinfo depends on the libhd library to gather hardware information which depends on libhal.Hwinfo is available in the repositories of Ubuntu and Debian.To install Hwinfo on Fedora or Cent.OS follow this post.How to install hwinfo on Fedora 1.Cent. OS 56. Using hwinfo.The help information explains how to use it hwinfo help.Usage hwinfo options.Probe for hardware.Note debug info is shown only in the log file.If you specify a.The options are few, just mention the hardware item for which you would like to see the information and it would display that only.Display all information.Running hwinfo without any options would display detailed information about all hardware units hwinfo.Display brief information.The short option will display brief information about the hardware and not the details hwinfo short.Here is the output from my systemcpu.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 00. 0 MHz.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 00. 0 MHz.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 66. 6 MHz.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 66. 6 MHz.AT Translated Set 2 keyboard.Microsoft Basic Optical Mouse v.Intel 9. 65. G 1.Intel 8. 2G3. 5 Express Integrated Graphics Controller.Intel 8. 28. 01. H ICH8 Family HD Audio Controller.Intel 8. 28. 01. H ICH8 Family 4 port SATA IDE Controller.Intel 8. 28. 01. H ICH8 Family 2 port SATA IDE Controller.JMicron JMB3. 68 IDE controller.Intel 8. 25. 66. DC Gigabit Network Connection.Ethernet network interface.Loopback network interface.ST3. 50. 04. 18. AS.Partition. devsda.Partition. devsda.Partition. devsda.Partition. devsda.Partition. devsda.Partition. devsr.SONY DVD RW DRU 1.A. usb controller.Intel 8. 28. 01. H ICH8 Family USB UHCI Controller 4.Intel 8. 28. 01. H ICH8 Family USB UHCI Controller 5.Intel 8. 28. 01. H ICH8 Family USB2 EHCI Controller 2.Intel 8. 28. 01. H ICH8 Family USB UHCI Controller 1.Intel 8. 28. 01. H ICH8 Family USB UHCI Controller 2.Intel 8. 28. 01. H ICH8 Family USB UHCI Controller 3.Intel 8. 28. 01. H ICH8 Family USB2 EHCI Controller 1.BIOS. Intel 8. 2G3.Express DRAM Controller.Intel 8. 28. 01. H ICH8 Family PCI Express Port 1.Intel 8. 28. 01. H ICH8 Family PCI Express Port 2.Intel 8. 28. 01. H ICH8 Family PCI Express Port 3.Intel 8. 28. 01 PCI Bridge.Intel 8. 28. 01. HBHR ICH8R LPC Interface Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.EHCI Host Controller.Linux 3. 1. 1. 0 1.EHCI Host Controller.Main Memory. firewire controller.Agere FW3. 23. FPU.DMA controller. PIC.Timer. Keyboard controller.Intel 8. 28. 01. H ICH8 Family SMBus Controller.Serial controller.Save it to a file hwinfo short hardwarebrief.View CPU details.With the cpu option, hwinfo would display only cpu information.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 00. 0 MHz.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 00. 0 MHz.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 66. 6 MHz.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 00. 0 MHz.Remove the short option to display detailed information, about the cpu.Display network card information sudo hwinfo short netcard.Intel 8. 25. 66. DC Gigabit Network Connection.Storage devices and partitionslt h.ST3. 50. 04. 18. AS.Partition. devsda.Partition. devsda.Partition. devsda.Partition. devsda.Partition. devsda.Partition. devsr.SONY DVD RW DRU 1.A6. Hard drive controllers sudo hwinfo short storage.Intel 8. 28. 01. H ICH8 Family 4 port SATA IDE Controller.Intel 8. 28. 01. H ICH8 Family 2 port SATA IDE Controller.JMicron JMB3. 68 IDE controller.USB devices and controllers sudo hwinfo short usb.Microsoft Basic Optical Mouse v.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.EHCI Host Controller.Linux 3. 1. 1. 0 1.EHCI Host Controller.Display multiple devices together.To display multiple hardware units together, just add all the options sudo hwinfo short usb cpu block.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 00. 0 MHz.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 66. 6 MHz.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 66. 6 MHz.IntelR CoreTM2 Quad CPU Q8.GHz, 2. 00. 0 MHz.Microsoft Basic Optical Mouse v.ST3. 50. 04. 18. AS.Partition. devsda.Partition. devsda.Partition. devsda.Partition. devsda.Partition. devsda.Partition. devsr.SONY DVD RW DRU 1.A. Linux 3. 1. 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.UHCI Host Controller.Linux 3. 1. 1. 0 1.EHCI Host Controller.Linux 3. 1. 1. 0 1.EHCI Host Controller.Log information to a file.The hwinfo has an option to log all data to a file.The following command will log detailed information about all hardware units to a text file.To log short information in addition to the detailed information, add the short option too.Not sure if it is supposed to work like that.Last Updated On 6th April 2.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |