This post lists common commands used in Windows and Linux/Unix system administration, server support, and troubleshooting.
The first command indicates the command name (searchable with a man page). The parens indicate useful extensions
File Searching, Browsing
Common use of the ampersand ( & ) is at the end of commands that open their own windows like a web browser or an editor..
The amperand (
Useful Concepts for Linux/Unix
Logs, spoools, and file resources (mail, logs, temp, etc.): /var
Configuration Files: /etc, /etc/rc.init (startup scripts). /etc/sendmail.cf
Unix “blackhole”: /dev/null
Core Command locations if not in path: /usr/(s)bin, /usr/local/(s)bin, /usr/sfw/bin/ | Solaris: /usr/openwin
Devices (I/O): /dev
Mounted Systems: /mnt, /media
Code Libraries/Modules: /usr/lib, /usr/local/lib
Stored source: /usr/src
Services: /etc/services – example of entries in services file (ports and protocols associated with the ports.
netstat 15/tcp ftp 21/tcp # File Transfer ssh 22/tcp # Secure Shell telnet 23/tcp
User settings ~/.<user setting folder>
e.g. ~/.kde/share/apps stores KDE desktop settings and configurations.
Checking serviers and ports in netstat
less /etc/services | grep <service name>
netstat -a | grep <service name>| grep <keyword, e.g. LISTEN>
Check Total physical memory:
# prtdiag -v | grep Memory # prtconf | grep Memory
Check Free physical Memory:
# top (if available) # sar -r 5 10 Free Memory = freemen*8 (pagesize=8k) # vmstat 5 10 Free Memory = free
# swap -s # swap –l
|compmgmt.msc||Computer Management, central administration panel for Windows. Can also be used to access IIS administration console.|
|control mouse||Open control panel for mouse|
|defrag, dfrg.msc||Disk Defragmenter|
|lusrmgr.msc||Local Users and Groups|
|msconfig||Startup files and processes configuration|
|ntmsoprq.msc||Removable Storage Operator Requests|
|rsop.msc||Resultant Set of Policy|
|sc query||Find function. E.g. Find a Windows services called “WSearch”sc query | FINDSTR /i /r WSearch|
|secpol.msc||Local Security Settings|
|services.msc||Services and Process manager|
|wab||Windows address book|
|wmimgmt.msc||Windows Management Infrastructure (WMI)|
Remote Desktop Management related commands
ERROR The terminal server has exceeded the maximum number of allowed connections
If you encounter this error, you can either reboot the terminal server you are trying to remote desktop to or log into the machine as an administrator.
To log in as the administrator:
mstsc /v:<ip address e.g. 192.168.2.32) /console
By using /console at the end of the command you will be logging in as if you were at the server. Alternatively, if you are using Windows Server 2003, run this comment instead (replace /console with /admin)
mstsc /v:<ip address e.g. 192.168.2.32) /admin
If you can telnet or ssh to the server you can use the following command. This command will kill all active RDP sessions to free one so you can connect.
When you execute the commands above, log in as an administrator on the machine. That log in allow you to use the console on the server.
Remove any disconnected users via the Terminal Services Manager
Start > All Programs > Administrative Tools > Terminal Services Manager
Click on the name of your server and the right side should show a list of users. If the users are disconnected, reset the users to free up the two normal remote desktop connections. Right clicking the disconnected user and selecting “Reset.”
It is good practices to only use the console to disconnect inactive sessions and not for anything else. Make sure you disconnect inactive user sessions first with the instructions above, otherwise if you get disconnected again you will have to physically access the server.
Remote Desktop sessions should always be closed using the Windows <<Log Off>> function rather than disconnecting by closing the window as using the X to close will disconnect from the session but leave it active.
Despite carefully following installation and configuration procedures for various programs, they still tend not be smooth.