- commands summary
- alias (set aliases)
- alias (show aliases)
- apropos
- basename
- cal
- cd
- clear
- date
- date -s
- df -k
- diff
- dirname
- du
- echo
- echo -n
- | egrep -i sql
- egrep -i
- egrep
- egrep -v
- env
- errpt
- export PS1=”$ “
- find
- for (start, stop, step)
- head
- history
- history | egrep -i ls
- hostname
- if-then-else
- if [ -f “$FileName” ]
- kill
- less
- locate
- ls
- ls -a
- ls -ltr
- lsusb
- mailx
- man
- more
- mv
- pg
- ps -ef
- ps -ef | grep oracle
- pwd
- read
- rm
- script
- sleep
- sort
- sort -uniq
- tail
- tail -f
- time
- touch - create an empty file
- touch - update the modified date
- wc -l
- whoami
- whence or type
- unalias
- uname -m
- uptime
- \ (line continuation)
commands summary
alias (set aliases)
1. set-alias
alias (show aliases)
1. get-alias
apropos
1. get-help
basename
1. dir | select name
cal
No equivalent, but see the script at <http://www.vistax64.com/powershell/17834-unix-cal-command.html>
cd
1. cd
clear
1. clear-host
date
1. get-date
date -s
1. set-date
df -k
1. Get-WMIObject Win32_LogicalDisk | ft -a
diff
1. Compare-Object -ReferenceObject (Get-Content file1) -DifferenceObject (Get-Content file2)
dirname
1. dir | select directory
du
No equivalent, but see the link
echo
1. write-output
echo -n
1. write-host -nonewline
| egrep -i sql
1. | where {[Regex]::Ismatch($\_.name.tolower(), "sql") }
egrep -i
1. select-string
egrep
1. select-string -casesensitive
egrep -v
1. select-string -notmatch
env
1. Get-ChildItem Env: | fl
or
1. get-variable
errpt
1. get-eventlog
export PS1=”$ “
1. function prompt {"$ " }
find
1. dir *whatever* -recurse
for (start, stop, step)
1. for ($i = 1; $i -le 5; $i++) {whatever}
head
1. gc file.txt | select-object -first 10
history
1. get-history
history | egrep -i ls
1. history | select commandline | where commandline -like '*ls*' | fl
hostname
1. hostname
if-then-else
1. if ( condition ) { do-this } elseif { do-that } else {do-theother}
if [ -f “$FileName” ]
1. if (test-path $FileName)
kill
1. stop-process
less
1. more
locate
1. no equivalent but see link
ls
1. get-childitem OR gci OR dir OR ls
ls -a
1. ls -force
ls -ltr
1. dir c:\ | sort-object -property lastwritetime
lsusb
1. gwmi Win32_USBControllerDevice
mailx
1. send-mailmessage
man
1. get-help
more
1. more
mv
1. rename-item
pg
1. more
ps -ef
1. get-process
ps -ef | grep oracle
1. get-process oracle
pwd
1. get-location
read
1. read-host
rm
1. remove-item
script
1. start-transcript
sleep
1. start-sleep
sort
1. sort-object
sort -uniq
1. get-unique
tail
1. gc file.txt | select-object -last 10
tail -f
1. gc -tail 10 -wait file.txt
time
1. measure-command
touch - create an empty file
1. set-content -Path ./file.txt -Value $null
touch - update the modified date
1. set-itemproperty -path ./file.txt -name LastWriteTime -value $(get-date)
wc -l
1. gc ./file.txt | measure-object | select count
whoami
1. [Security.Principal.WindowsIdentity]::GetCurrent() | select name
whence or type
1. No direct equivalent, but see link
unalias
1. remove-item -path alias:aliasname
uname -m
1. Get-WmiObject -Class Win32_ComputerSystem | select manufacturer, model
uptime
1. get-wmiobject -class win32_operatingsystem | select LastBootUpTime`
\ (line continuation)
1. ` (a backtick)
