HomeToolsAbout a20k

Unix

What is Unix

Stands for UNiplexed Information Computing System

All MacOS derivatives are Unix certified

  • Compliance required to use the UNIX trademark

List

List contents of current directory

ls

List ALL contents of current directory

# in default ls-style ls -a # in vertical list style ls -la ## OR la

Search

Command line utility for searching plain-text data sets for lines that match a regex

grep

Rename OR Move

Rename

Change file's old_file_name to new_file_name in current directory

  • Also works for directory names
    • You should use gmv when you are inside of a git repository or Git will lose track of the changes (especially in directory with submodules)
mv old_file_name new_file_name

Move

When moving a directory, mv command also works

mv dir_name new_location/dir_name

Name with Spaces

Escape out the spaces with the \ escape character before the special character

# Moving "Learning Python Programming - Working Files" mv Learning\ Python\ Programming\ -\ Working\ Files

Copy

Copy the contents of a file or the output of a command to the system clipboard

# copying the contents of a file pbcopy < file.txt # copying the output of a command ls -l | pbcopy

Dot Command

Every directory in Unix-like OS contains (as a minimum), an object represented by a single dot and another represented by a double dot.

Single dot (.) represents the directory itself and the double dot (..) refers to its parent directory.

These dots are created in every directory.

© VincentVanKoh