| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The Terminal is a program included with all versions of Mac OS X and Linux. It manages the input/output for command line programs. When launched, it provides a command line interface (Unix shell) to control the underpinnings of the UNIX based operating system. You use the terminal to access the Unix shell.
Most developers are reluctant to use the command line at first and only do it because they have to but learn to love it quickly (relatively speaking).
A shell is simply a type of command line program, which contains a very simple, text-based user interface enabling us to access all of an operating system's services. It is, very simply, a program that accepts text as input and translates that text into the appropriate functions that you want your computer to run.
Bash (Bourne Again SHell) is a Unix shell and command language, it's the default shell on Linux and OS X. It's the primary interface users see when they log in.
Bash was written as a free software replacement to the Bourne shell (sh)
Taken from Just for fun: Type like a hacker
Go over the couple of options for opening Terminal
Create a shortcut to the terminal so it's easy to access going forward.
Every file or folder in a file system can be read, written, and deleted by referencing its position inside the filesystem. When we talk about the position of a file or a folder in a file system, we refer to its "path". There are a couple of different kinds of paths we can use to refer to a file – absolute paths and relative paths.
Directory is an important term that's used interchangeably with folder. Though they are not exactly the same thing, when we say "navigate to your project directory" think of this as "navigate to your project folder". Here's a little more information:
Strictly speaking, there is a difference between a directory which is a file system concept, and the graphical user interface metaphor that is used to represent it (a folder)...If one is referring to a container of documents, the term folder is more appropriate. The term directory refers to the way a structured list of document files and folders is stored on the computer. It is comparable to a telephone directory that contains lists of names, numbers and addresses and does not contain the actual documents themselves.
Taken from Close-To-Open Cache Consistency in the Linux NFS Client
An absolute path is defined as the specific location of a file or folder from the root directory, typically shown as /. The root directory is the starting point from which all other folders are defined and is not normally the same as your Home directory, which is normally found at /Users/[Your Username].
Typing cd - a command for "change directory" with no parameters takes us to our home directory.
cdIf we type in pwd - a command for "print working directory" from that folder, we can see where we are in relation to the root directory.
Some examples of absolute path:
/usr/local/bin/git
/etc/example.ext
/var/data/database.dbNotice, all these paths started from / directory which is a root directory for every Linux/Unix machines.
A relative path is a reference to a file or folder relative to the current position, or the present working directory(pwd). If we are in the folder /a/b/ and we want to open the file that has the absolute path /a/b/c/file.txt, we can just type:
open c/file.txtor
open ./c/file.txtAt any time, we can also use the absolute path, by adding a slash to the beginning of the path. The absolute path is the same for a file or a folder regardless of the current working directory, but relative paths are different, depending on what directory we are in. Directory structures are laid out like directory/subdirectory/subsubdirectory.
Below are some examples of using relative and absolute path for the same action:
pwd
cd
ls
mkdir
touch
man
cp
mv
rm
subl / atom
nano / vim
20 min
https://gist.github.com/mdang/7b025b4188aea93dbde2
When a user logs in to the terminal the shell checks .bash_profile for environment specific variables and startup programs to run.
Order that the shell checks to find additional settings. Once one is found it stops looking beyond that.
source
reload
Aliases allow us to create shortcuts without having to type longer commands and options everytime
alias alias_name="command_to_run"
unalias alias_name
The alias set is only active for the current session. Once the terminal is closed the alias is forgotten unless it's set again in .bash_profile
15 min
https://gist.github.com/mdang/75673af53ecdd168052ef2a064cb9e21
grep
grep foo /etc/passwd
sudo
Sudo is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user, by default the superuser. Sudo stands for "superuser do".
A symlink (symbolic link) is a special file containing a path to another file. This path can be absolute or relative. symlinks can work across file systems, and can even point to different files, if you for example unplug an external hard drive and replace it with another one, which has a different file at the same path. A symlink can point to either files or directories.
ln -s source_file myfile
export
export FOO="bar"
echo "$FOO"
20 min
https://gist.github.com/mdang/680f9a82378220ee54cee1fe80f0361c
| Back | FazBrowse Home | New Git URL |