Megapipe Communications

Keyboard Shortcuts and Common Commands

Keyboard shortcuts can often save time, especially when editing documents or surfing the web.

Windows Keyboard Shortcuts

The following may help you navigate your computer and the Internet more easily. These are just a few of many Windows keyboard shortcuts.

  • Alt+F4 closes the current program
  • Ctrl+F4 closes a window within a program
  • [Windows Key] + R – opens up the Windows Run dialog
  • Alt+Tab lets you switch between programs on the taskbar with your keyboard. Hit it once to get a screen showing the icons on your start menu and hit it again to move to the next icon.
  • Ctrl+Esc opens the start menu (most recent keyboards have a button with a Windows icon on it that does this)
  • Simply hitting the "Alt" button will let you take you to menus at the top of the screen. Use the arrow keys to navigate those menus.
  • Highlighting text and hitting Ctrl+X will cut text. Highlighting text and hitting Ctrl+C will copy text. Ctrl+P will paste it where your mouse cursor is.

More are listed here.

Basic UNIX Commands & DOS/Windows Equivalents

The following is a skeleton list of basic UNIX shell commands and MSDOS or Windows equivalents.

UNIX Command Description DOS Equivalent(s)
cp Copy a file from one place to another.
Syntax: cp [source] [destination]
kill Kill a process.
How to use: Use the ps command to find a process. In BSD or Linux, try ps aux. Then, copy the process ID (pid) and type kill [pid]. If that doesn't work, try kill -9 [pid]. (The parameter -9 will force the process to die no matter what.)
(Slightly comparable to hitting Alt+Ctrl+Del)
cwd Get the current working directory. None; however, DOS shells after DOS 5.0 usually display this information on the command line
ls List the contents of the current directory dir
man man will call up a manual on a specified command.
Syntax: man [command]
mkdir Make a new directory. Syntax: mkdir [name] mkdir
mv Move a file or directory from one place to another.
Syntax: mv [source] [destination]
ps List processes. Can be used to view system processes and user processes. None in DOS; in Windows NT, 2000, and XP, hitting Alt+Ctrl+Del is comparable.
rm Remove a file. del
rmdir Remove an empty directory.
Note: use rm -r [directory] to remove a directory with files in it.
whois Get information on a domain.
Example: whois
ssh Log into a remote terminal. Syntax: ssh [username]@[host] Before Windows 10, no default Windows equivalent. plink.exe is a Windows command environment alternative; putty.exe is a Windows application that allows for remote shell access. See list of suggested Windows software for system and remote administration. SSH discussed here. Windows 10 includes ssh command.
ftp The ftp command allows you to send files from your local machine to a remote host. Windows 95, 98, NT, and XP all come with the same command built in. Starting with Windows Vista, it is possible that you will need to install the command explicitly.

PERL tricks

Command Explanation
perl -pi -e "s/^[ \t]+\n/\n/" file.txt Replace all lines with a blank space or tab with an endline character; basically, keep the line but get rid of any white space on it

find tricks

The find command is a common UNIX/Linux utility. Its parameters and features might vary across platforms.

Command Explanation
find /path/ -mtime +45 -exec rm -vf {} \; Delete all files in /path/ older than 45 days. Change +45 to any number of days you want, but keep the plus-sign (+). To use on the current working directory, replace /path/ with a single period (.).
chown -R mruser:mruser /usr/vhosts/ && find /usr/vhosts/ -type d -exec setfacl -m user:httpd:rwx {} \; && find /usr/vhosts/ -type f -exec setfacl -m user:httpd:rw- {} \; Gives user mruser (and the group associated this user, which has the same name) UNIX permissions on the directory /usr/vhosts/ But UNIX ACLs give similar access to user httpd, which might be a service account that needs access. Can also be useful for a backup script.
Home | Services | Destinations | HelpWeb |Terms of Service | Acceptable Use | Contact Us | WebMail