Skip to content

Instantly share code, notes, and snippets.

@LaminSanneh
Created July 24, 2013 07:47
Show Gist options
  • Save LaminSanneh/6068733 to your computer and use it in GitHub Desktop.
Save LaminSanneh/6068733 to your computer and use it in GitHub Desktop.
Useful Command Line Commands
//***************** Useful Command Line Commands ***********//
MAC PC
Ctrl(Control) + a -------- Move to the beggining of the current command
Ctrl(Control) + e -------- Move to the end of the current command
echo ~ -------- print out our home directory
clear -------- cleans out your terminal of all previous commands
pwd -------- prints out the current directory you are in
ls -------- List all normal(non hidden) files in directory
ls -l -------- List all normal(non hidden) files in directory with details
ls -a -------- List all normal and hidden files in directory
ls -t -------- List all normal(non hidden) files in directory but sort them by their modified time
cd ../ or cd .. -------- Move up one directory
touch filename -------- Creates a file with the name specified
mkdir directoryname -------- Creates a directory with the name specified
cat filename -------- Writes out the contents of filename
ln -s originalFile newSymbolicLinkFile ---------- Creates a link from one file to another to act as a shortcut but with loose ties between
ln originalFile newSymbolicLinkFile ---------- Creates a link from one file to another to act as a shortcut but with strong ties between
chmod (u/g/o)(+{r/w/x}/-{r/w/x}) filename -------- CHanges permission of a file for different user types( u=>user, g=>group, o=>others, r=>read, w=>write, x=>execute, /=> combinable or can be used singularly singular)
Other Use: chmod (u)(+{r/w/x}/-{r/w/x}),(g/o)(+{r/w/x}/-{r/w/x})
chmod -R (u/g/o)(+{r/w/x}/-{r/w/x}) folder -------- CHanges permission of a folder for different user types( u=>user, g=>group, o=>others, r=>read, w=>write, x=>execute, /=> combinable or can be used singularly singular), the r means go deep into subdirectories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment