Ngoc Tam Lam, PhD

Autonomy Engineer

Back

The command line crash course

Posted on Oct 10, 2019


Command line cheatsheet!!!

Setup

Mac OSX | Linux | Window — | — | — COMMAND + spacebar | Shell/Terminal | Powershell

Command

Mac OSX/Linux Window Definitions
pwd pwd print working directory
hostname hostname my computer’s network name
mkdir mkdir make directory
cd cd change directory
ls ls list directory
rmdir rmdir remove directory
pushd pushd push directory
popd popd pop directory
cp cp/robocopy copy a file or directory/robust copy
mv mv move a file or directory
less more page through a file
cat type print the whole file
xargs . execute arguments
find dir -r find files
grep select-string find things inside files
man help read a manual page
apropos helpctr find what man page is appropriate
env   look at your environment
echo echo print some arguments
export set export/set a new environment variable
exit exit exit the shell
sudo runas DANGER! become super user root DANGER!
chmod attrib change permission modifiers
chown iCACLS change ownership
. forfiles run a command on lots of files

Example: Paths, Folders, Directories (pwd)

Mac OSX/Linux Window Result
$ pwd PS C:\Users\tamlam> pwd path