GithubHelp home page GithubHelp logo

linuxcommands's Introduction

BASIC NAVIGATION

cd : Change Directory

Example use cases

cd .. : Change to parent directory

cd ~ or cd : return to root directory

cd ../example/example : navigating multiple levels of a file tree

ls : List segments; List files in a directory

Example use cases

ls -l : long detailed listing includes detailed read/write permissions, date file was created, date file was created, and name of the file

ls -a : list all (including hidden)

pwd : Present Working Directory; List current absolute directory

FILE MANIPULATION

touch : creates a file

less : read a text file

rm *file name* : remove a file

rm -r *directory name* : remove a directory

rmdir *directory name* : remove a directory

rm -rf *directory name* : force removes everything (files/directories, etc do not use unless you know what you’re doing)

cp : copy a file (within the same directory, if the second file does not exist, one will be created)

cp *file1* *file2* : copy file1 to file2

cp *file 1* ../*directory name* : Copy a file to a different directory

chmod : change the permissions of file to octal

mv *file1* *directory* : move a file to another directory

mv *file1* *newFileName* : rename a file

Create a Local Repository

git init : this initializes a repository

git status : Checks the status of the repository tracks any changes of the repository

git add : add files to git repository (use ‘.’ for all)

git clone : clone a repository

git push : this pushes the code to github

git push origin master : Send changes to the master branch of your remote repository.

git remote add : this adds the files to the repository

git pull : this pulls the files from a repository

git commit -m *details about your process* : this command commits the code to github and adds a message

git clone */path/to/repository* : Create a working copy of a local repository

git remote add origin <server> : If you haven't connected your local repository to a remote server, add the server to be able to push to it.

Branches

git checkout -b <branchname> : Create a new branch and switch to it.

git checkout <branchname> : Switch from one branch to another.

git branch : List all the branches in your repo, and also tell you what branch you're currently in.

git branch -d <branchname> : Delete the current branch.

git push origin <branchname> : Push the branch to your remote repository, so others can use it.

git push --all origin : Push all branches to your remote repository.

HELP

{command} --help : shows description and usage of a command.

man : search the manual for a command

linuxcommands's People

Contributors

mlosa001 avatar eddymark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.