pwd- user
whami- shows the user
ls- list
ls -a (all)(shows hidden files)
ls -alh (details in the files)
man ls (shows all commands)
press “q” to exit
cd (change directory)
cd ~ (takes you to your user’s root directory)
cd .. (takes you up one directory)
mkdir (make directory)
cmd + k (to clear the screen)
cat (shows the content at terminal) example cat abc.txt
less (shows content in terminal) type “q” to exit
touch (creates file ore modifies the date if the file already exists)
tail (shows the end of the file “last 10 lines of the code)
tails -f (it will continue to look for new line in the code)(shows the live feed)
grep (search the content in a specific file) grep Hello abc.txt “Hello CodeCore" grep -i (makes the case insensitive) grep -i —color (gives the matching words colour) grep -n (gives the line number)
find .-name abc.txt find .-name ab* (will look for anything containing ab to display) find ~-name abc.txt
man-(shows all the commands manual) clear -(puts the cursor at the top)
cp abc.txt abc1.txt (copies the file and makes a new file) cp -r (reclusive lets copy directories)
mv (moves a file) mv abc.txt ~/codecore/ mv -r (moves directories) mv abc.txt abc1.txt (renames the file) mv -i (gives warning if the file already exists)
kill (kills the process) kill 5152 kill -9 51515(-9 force kills the process)(only use it when it isn’t responding)
sudo (runs the program as an admin) sudo touch abc.txt
chmod (changes the permission) chmod +w abc.txt (adds writing permission to the designated file to the current user) +x (execute) chmod 777 abc.txt (gives read write and execute permission to all) chown (change owner)
git remote -v
git push -u origin master
git clone git@github.com:dohoonk/git_practice.git (to download the code)
git push and git pull
nano abc.txt (opens up an editor within the terminal) vim abc.txt (more complicated version)
.bash_profile (able to create shortcuts for terminal
rm(removes the file) rm abc.txt
SSH Secure Shell
ssh-keygen -t
Git Basics
git status -shows the status
git init - initializes the git
rm -rf .git (if you want to remove git)
git commit -m “Message"
git log (will list all the commits)
git remote add origin git@github.com:dohoonk/git_practice.git
Git
version control system