Week 0
The basic Emacs commands: Searching forward and backward
C-s Incremental search forward; searches as you type C-r Incremental search backward
The basic Emacs commands: Cutting and pasting lines and regions
C-w Cut (after you Mark and move to other end) M-w Copy (after you Mark and move to other end) C-y Yank (paste) most recently killed (cut or copied); will also use text currently selected in another application.
The basic Emacs commands: Quitting
C-x C-c
Working With Commands: What are the different kinds of commands
Commands can be one of 4 different kinds: An executable program like all those files we saw in /usr/bin. Within this category, programs can be compiled binaries such as programs written in C and C++, or programs written in scripting languages such as the shell, Perl, Python, Ruby, etc. A command built into the shell itself. bash provides a number of commands internally called shell builtins. The cd command, for example, is a shell builtin. A shell function. These are miniature shell scripts incorporated into the environment. We will cover configuring the environment and writing shell functions in later lessons, but for now, just be aware that they exist. An alias. Commands that you can define yourselves, built from other commands. This will be covered in a later lesson. a kind of command that a user can define, built from other commands help - bash has a built-in help facility available for each of the shell builtins. To use it, type "help" followed by the name of the shell builtin. Optionally, you may add the -m option to change the format of the output.
A Guided Tour: What is the difference between a hard link and a symbolic link
Creating a hard link has the effect of giving one file multiple names (e.g. different names in different directories) all of which independently connect to the same data on the disc, none of which depends on any of the others.[1] This causes an alias effect: e.g. if the file is opened by any one of its names, and changes are made to its content, then these changes will also be visible when the file is opened by an alternative name. By contrast, a soft link or "shortcut" to a file is not a direct link to the data itself, but rather is a short file that contains the text of a file name, or a location that gives direct access to yet another file name within some directory. The name contained in or referred to by the soft link may either be a hard link or another soft link. This also creates aliasing, but in a different way. Every directory is itself a file, only special because it contains a list of file names maintained by the file system. Since directories themselves are files, multiple hard links to directories are possible which would create loops within the structure of the directories, rather than a branching structure like a tree. For that reason, the creation of hard links to directories is sometimes forbidden, even if possible.
Keyboard shortcuts for Bash: Common shortcuts for Bash
Ctrl + A Go to the beginning of the line you are currently typing on Ctrl + E Go to the end of the line you are currently typing on Ctrl + L Clears the Screen, similar to the clear command Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line. Ctrl + H Same as backspace Ctrl + R Let's you search through previously used commands Ctrl + C Kill whatever you are running Ctrl + D Exit the current shell Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it. Ctrl + W Delete the word before the cursor Ctrl + K Clear the line after the cursor Ctrl + T Swap the last two characters before the cursor Esc + T Swap the last two words before the cursor Alt + F Move cursor forward one word on the current line Alt + B Move cursor backward one word on the current line Tab Auto-complete files and folder names Note that some of these commands may not work if you are accessing bash through a telnet/ssh session, or depending on how you have your keys mapped.
Navigation: What are the . and .. directories
"." notation refers to the working directory itself ".." notation refers to the working directory's parent directory working directory refers to where you currently are in the hierarchical directory structure - if you think of the directory as a maze, working directory refers to where you are standing in that maze
The basic vi commands: Cutting and pasting lines
"yy copy (yank, cut) the current line into the buffer p put (paste) the line(s) in the buffer into the text after the current line"
(Manipulating Files) Wildcard * returns what output?
* All filenames
(Manipulating Files) Wildcard *[![:lower:]] returns what output?
*[![:lower:]] Any filename that does not end with a lowercase letter.
Working With Commands: When do you use the command help instead of man
--help Many executable programs support a "--help" option that displays a description of the command's supported syntax and options. Some programs don't support the "--help" option, but try it anyway. Often it results in an error message that will reveal similar usage information. man - Most executable programs intended for command line use provide a formal piece of documentation called a manual or man page. A special paging program called man is used to view them. It is used like this: man program where "program" is the name of the command to view.
The basic Emacs commands: Using the mark and the point to set the region
C-<space> and then use arrow keys to select area of text
The basic Emacs commands: Cancelling half-entered commands
C-g C-g
The basic vi commands: Searching forward and backward
/string search forward ?string search backward
A Guided Tour: What do you find in the most common/important directories
/usr/bin /bin /tmp
The basic vi commands: Quitting
:x<Return> quit vi, writing out modified file to file named in original invocation :wq<Return> quit vi, writing out modified file to file named in original invocation
Permissions: Why can't a normal user chown a file
A normal user cannot give away ownership of their files - superuser privileges are required to use this command
The basic Emacs commands: Invoking commands by name
C-h a type in a keyword and then emacs returns a list of commands containing that keyword along with the shortcuts
(Manipulating Files) Wildcard BACKUP[[:digit:]][[:digit:]] returns what output?
BACKUP.[[:digit:]][[:digit:]] Another example of character classes. This pattern matches any filename that begins with the characters "BACKUP." followed by exactly two numerals.
Manipulating Files: What are wildcards and how do they work
Before I begin with our commands, I want to talk about a shell feature that makes these commands so powerful. Since the shell uses filenames so much, it provides special characters to help you rapidly specify groups of filenames. These special characters are called wildcards. Wildcards allow you to select filenames based on patterns of characters. Wildcard - Meaning * - Matches any characters ? - Matches any single character [characters] - Matches any character that is a member of the set characters. The set of characters may also be expressed as a POSIX character class such as one of the following: POSIX Character Classes [:alnum:] Alphanumeric characters [:alpha:] Alphabetic characters [:digit:] Numerals [:upper:] Uppercase alphabetic characters [:lower:] Lowercase alphabetic characters [!characters] - Matches any character that is not a member of the set characters
(Manipulating Files) Wildcard Data??? returns what output?
Data??? Any filename that begins with the characters "Data" followed by exactly 3 more characters
Permissions: How to run a command with root privileges
Difference between su and sudo su switches you to the root user account and requires the root account's password sudo runs a single command with root privileges - it doesn't switch to the root user or require a separate root user password
What is a virtual machine
a machine you run on your computer that is separate from your physical computer originally defined by Popek and Goldberg as ""an efficient, isolated duplicate of a real machine
What is the difference between Git and GitHub
Git the tool, GitHub the service for projects that use git the shell is a program that takes commands from the keyboard and gives them to the operating system to perform
What is Emacs
a text editor
Looking Around: Understand the ls long format and how to display it
If you use the -l option with ls (ls -l), you will get a file listing that contains a wealth of information about the files being listed. -rw------- 1 bshotts bshotts 576 Apr 17 1998 weather.txt drwxr-xr-x 6 bshotts bshotts 1024 Oct 9 1999 web_page -rw-rw-r-- 1 bshotts bshotts 276480 Feb 11 20:41 web_site.tar -rw------- 1 bshotts bshotts 5743 Dec 16 1998 xmas_file.txt ---------- ------- ------- -------- ------------ ------------- | | | | | | | | | | | File Name | | | | | | | | | +--- Modification Time | | | | | | | +------------- Size (in bytes) | | | | | +----------------------- Group | | | +-------------------------------- Owner | +---------------------------------------------- File Permissions File Name: The name of the file or directory. Modification Time: The last time the file was modified. If the last modification occurred more than six months in the past, the date and year are displayed. Otherwise, the time of day is shown. Size The size of the file in bytes. Group The name of the group that has file permissions in addition to the file's owner. Owner The name of the user who owns the file. File Permissions a representation in ten characters that communicate the file's access permissions. The first character is the type of file. A "-" indicates a regular (ordinary) file. A "d" indicates a directory. The second set of three characters represent the read, write, and execution rights of the file's owner. The next three represent the rights of the file's group, and the final three represent the rights granted to everybody else. creates a symbolic link - a special type of file that points to another file - makes it possible for a single file to have multiple names
A Guided Tour: What is a hard link
In computing, a hard link is a directory entry that associates a name with a file on a file system. All directory-based file systems must have (at least) one hard link giving the original name for each file. The term "hard link" is usually only used in file systems that allow more than one hard link for the same file.
What is source code management
It allows a developer to organize code iterations chronologically, and version it for an application. The most powerful features of source code management systems are in how they allow teams of very diverse sizes to work together on the same application simultaneously.
LTS: What does LTS mean?
LTS is abbreviation for "long term support" https://wiki.ubuntu.com/LTS A new LTS version is released every 2 years.
What is Ubuntu
Linux based OS developed by Mark Shuttleworth, et. al with the aim of creating an easy-to-use Linux desktop
Reading Man Pages: What are the section numbers for User commands, System calls and Library functions
Man page sections are: (1) User Commands (2) System Calls (3) Library functions (4) Devices (5) File formats (6) Games and Amusements (7) Conventions and Miscellany (8) System Administration and Priveledged Commands (L) Local. Some programs install their man pages into this section instead of (1) (N) TCL commands (1) User Commands (2) System Calls (3) Library functions
Reading Man Pages: How to read a man page
Man pages, however, do not usually include examples, and are intended as a reference, not a tutorial.
Manipulating Files: How to use wildcard
Manipulating Files: How to use wildcardsUsing wildcards, it is possible to construct very sophisticated selection criteria for filenames. Here are some examples of patterns and what they match: Examples of wildcard matching * All filenames g* All filenames that begin with the character "g" b*.txt All filenames that begin with the character "b" and end with the characters ".txt" Data??? Any filename that begins with the characters "Data" followed by exactly 3 more characters [abc]* Any filename that begins with "a" or "b" or "c" followed by any other characters [[:upper:]]* Any filename that begins with an uppercase letter. This is an example of a character class. BACKUP.[[:digit:]][[:digit:]] Another example of character classes. This pattern matches any filename that begins with the characters "BACKUP." followed by exactly two numerals. *[![:lower:]] Any filename that does not end with a lowercase letter. You can use wildcards with any command that accepts filename arguments. Using Commands with wildcards: cp *.txt text_files Copy all files in the current working directory with names ending with the characters ".txt" to an existing directory named text_files. mv my_dir ../*.bak my_new_dir Move the subdirectory my_dir and all the files ending in ".bak" in the current working directory's parent directory to an existing directory named my_new_dir. rm *~ Delete all files in the current working directory that end with the character "~". Some applications create backup files using this naming scheme. Using this command will clean them out of a directory.
Who wrote Vagrant
Mitchell Hashimoto
Other man pages: How to print the groups a user is in
NAME groups - print the groups a user is in SYNOPSIS groups [OPTION]... [USERNAME]... DESCRIPTION Print group memberships for each USERNAME or, if no USERNAME is specified, for the current process (which may differ if the groups database has changed). --help display this help and exit --version output version information and exit
Other: What does RTFM mean?
Read the f*cking manual
What is vi
a text editor
Other man pages: How to print real and effective user and group IDs
NAME id - print real and effective user and group IDs SYNOPSIS id [OPTION]... [USERNAME] DESCRIPTION Print user and group information for the specified USERNAME, or (when USERNAME omitted) for the current user. -a ignore, for compatibility with other versions -Z, --context print only the security context of the current user -g, --group print only the effective group ID -G, --groups print all group IDs -n, --name print a name instead of a number, for -ugG -r, --real print the real ID instead of the effective ID, with -ugG -u, --user print only the effective user ID --help display this help and exit --version output version information and exit Without any OPTION, print some useful set of identified information.
Other man pages: How to print the effective userid
NAME whoami - print effective userid SYNOPSIS whoami [OPTION]... DESCRIPTION Print the user name associated with the current effective user ID. Same as id -un. --help display this help and exit --version output version information and exit
Permissions: Linux file permissions
On a Linux system, each file and directory is assigned access rights for the owner of the file, the members of a group of related users, and everybody else. Rights can be assigned to read a file, to write a file, and to execute a file (i.e., run the file as a program). To see the permission settings for a file, we can use the ls command. As an example, we will look at the bash program which is located in the /bin directory: [me@linuxbox me]$ ls -l /bin/bash -rwxr-xr-x 1 root root 316848 Feb 27 2000 /bin/bash Here we can see: The file "/bin/bash" is owned by user "root" The superuser has the right to read, write, and execute this file The file is owned by the group "root" Members of the group "root" can also read and execute this file Everybody else can read and execute this file
Reading Man Pages: What are man page sections
On most Linux systems, man uses less to display the manual page, so all of the familiar less commands work while displaying the page. README And Other Documentation Files Many software packages installed on your system have documentation files residing in the /usr/share/doc directory. Most of these are stored in plain text format and can be viewed with less. Some of the files are in HTML format and can be viewed with your web browser. You may encounter some files ending with a ".gz" extension. This indicates that they have been compressed with the gzip compression program. The gzip package includes a special version of less called zless that will display the contents of gzip-compressed text files. http://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/ man uses less to display the manual page so all familiar less commands work while displaying the page The "FSF" indicates this was written by the Free Software Foundation, Inc. (FSF). This position orginally contained the text "UNIX Programmers Manual". Various different UNIX systems put the name of the particular unix system (such as SOLARIS, AIX, HPUX, BSD, SGI, etc.) in this position. The "NAME" heading is the name of the command itself. If you were in a shell and typed this, you would execute or run the command itself. The other part of the "NAME" heading is a short description of what the command does - usually one sentence (or less). The "SYNOPSIS" or outline, describing how the command is supposed to be used. The synopsis is shown using the command followed by [OPTION]... [FILE]... The "OPTIONS" Brackets "[" and "]" indicate that this modifier is not needed, but can be used. Any one of the above can be followed by a "..." which tells you that they can be used one or more times. You should not take the examples literally. As mentioned, the "[" and "]" indicate there are options that are not required. The "..." means that you have one or more times you can use these options. You would not type ls [OPTION]... [FILE]... exactly or you would get an error ls: [OPTION]... No such file or directory and ls: [FILE]... No such file or directory". I will read it as a sentence; type the ls command, optionally followed by one or more options you may want, optionally followed by one or more file names you want. Since both the OPTIONs and FILEs are optional, you don't have to type any of them at all - just type ls and press enter! Go to your shell and type ls now. You should see a list of all files in your directory. If you don't have any files, this could be very boring! One of the concepts in Learning the Shell was absolute pathnames. If you type ls / you will see your root directory, which includes "bin, dev, home, lost_found, opt, root, tmp, var, etc", and other directories. In looking at the man page you typed, the ls command without [OPTIONS]... but with a specific [FILE]. Yes, "/" is a file! Don't let this to confuse you. Take a look a these examples; ls [OPTIONS]... [FILE]... could be re-written: Form Example Description ls ls Should list all your files in the directory you are currently in; who knows what files you may have? ls [OPTIONS][FILE] ls -a / Lists all files (including hidden files) in your / directory. ls [OPTIONS][FILE] ls -a /home Lists all files (including hidden files) in the /home directory ls [OPTIONS] [FILE] ls -a-l /home Lists all files in long format (including hidden files) in the /home directory ls [OPTIONS] [FILE] [FILE] ls -a-l / /home Lists all files in long format (including hidden files) in the / and in the /home directory DESCRIPTIONs gives a more detailed definition of the command, sometimes highlighting specific functions of the command mentioned, as well as providing the OPTIONs available for the command. OPTIONs are preceeded by hyphens, and you can either specify them individually if you leave a space inbetween ( ls -a -l /home) or altogether ( ls -al /home ) if you leave out any intervening spaces. And, as we have repeatedly seen, the "FILE" Brackets "[" and "]" indicate that the flag is optional. Sometimes a pipe "|" is used to separate options that are exclusive from one or the other. An example would be the mount command showing that you can specify either a device or directory; device | dir. The pipe is also used to indicate options that equate to each other. This can be seen in the man page for consolechars; a specific example would be [-V|--version]. You could either type -V *OR* --version to get the same effect. All of the above can be combined to indicate optional commands that can be used in an either/or scenario. Examples like tar shows you a man page that looks confusing. Don't worry too much about it right now. Take the time to start small. A look at clear might settle your nerves! You may have also noticed that the list of options available to you is in ALPHABETICAL ORDER. Most man pages list their options in alphabetical order - I believe to make it easier to reference a specific option if you know what that option is, but have forgotten exactly what it does. At any rate, it is important to note that because of the alphabetical order, you might first see options that are not frequently used. Sometimes sections are not consistantly ordered after the NAME, SYNOPSIS, and DESCRIPTION is given, but I have listed the most common man page Sections below: AUTHORS: the people who created or assisted in the creation of the command. BUGS: lists any know defects or shortcoming of the programs. Sometimes they aren't failures of the tool, but rather peculiarities of implementation. ENVIRONMENT: Describes any variables that might be needed or specific versions of the shell that may be needed for the command to operate. EXAMPLES or NOTES: An illustration of how to use the command including general notes. REPORTING BUGS: If you find any problems with the command, this tells you where you should report the defects or problems you are having with the command. COPYRIGHT: The person or organization that holds the copyright to this information; usually a disclaimer that this is free software without warranty. SEE ALSO: Other commands that are related to this command. This relationship is not always clear, but usually other commands mentioned here are used in conjunction with this command. This section also frequently mentions any other documentation related to this command.
Permissions: How to change permissions, owner and group of a file
The chmod command is used to change the permissions of a file or directory. To use it, you specify the desired permission settings and the file or files that you wish to modify. For example, if we wanted to set some_file to have read and write permission for the owner, but wanted to keep the file private from others, we would: [me@linuxbox me]$ chmod 600 some_file The following are common permissions settings - ones beginning with "7" are used with programs (since they enable execution) and the rest are for other kinds of files. Value Meaning 777 (rwxrwxrwx) No restrictions on permissions. Anybody may do anything. Generally not a desirable setting. 755 (rwxr-xr-x) The file's owner may read, write, and execute the file. All others may read and execute the file. This setting is common for programs that are used by all users. 700 (rwx------) The file's owner may read, write, and execute the file. Nobody else has any rights. This setting is useful for programs that only the owner may use and must be kept private from others. 666 (rw-rw-rw-) All users may read and write the file. 644 (rw-r--r--) The owner may read and write a file, while all others may only read the file. A common setting for data files that everybody may read, but only the owner may change. 600 (rw-------) The owner may read and write a file. All others have no rights. A common setting for data files that the owner wants to keep private. Directory permissions - chmod can be used to control the access permissions for directories and octal notation can be used to set permissions but the meaning of r, w, and x attributes are different: r - Allows the contents of the directory to be listed if the x attribute is also set. w - Allows files within the directory to be created, deleted, or renamed if the x attribute is also set. x - Allows a directory to be entered (i.e. cd dir). useful settings for directories: Value Meaning 777 (rwxrwxrwx) No restrictions on permissions. Anybody may list files, create new files in the directory and delete files in the directory. Generally not a good setting. 755 (rwxr-xr-x) The directory owner has full access. All others may list the directory, but cannot create files nor delete them. This setting is common for directories that you wish to share with other users. 700 (rwx------) The directory owner has full access. Nobody else has any rights. This setting is useful for directories that only the owner may use and must be kept private from others.
The basic Emacs commands: What is a buffer and how to switch from one to the other
a buffer is a window displaying text in emacs - to switch, type C-x b and select using arrow up and down keys multiple buffers can be open at a time, using C-x 2
Permissions: How to represent each of the three sets of permissions (owner, group, and other) as a single digit
The chmod command is used to change the permissions of a file or directory. To use it, you specify the desired permission settings and the file or files that you wish to modify. There are two ways to specify the permissions. In this lesson we will focus on one of these, called the octal notation method. It is easy to think of the permission settings as a series of bits (which is how the computer thinks about them). Here's how it works: rwx rwx rwx = 111 111 111 rw- rw- rw- = 110 110 110 rwx --- --- = 111 000 000 and so on... rwx = 111 in binary = 7 rw- = 110 in binary = 6 r-x = 101 in binary = 5 r-- = 100 in binary = 4 Now, if you represent each of the three sets of permissions (owner, group, and other) as a single digit, you have a pretty convenient way of expressing the possible permissions settings.
The basic vi commands: Edit text
The following commands allow you to insert and add text. Each of these commands puts the vi editor into insert mode; thus, the <Esc> key must be pressed to terminate the entry of text and to put the vi editor back into command mode. i insert text before cursor, until <Esc> hit I insert text at beginning of current line, until <Esc> hit a append text after cursor, until <Esc> hit A append text to end of current line, until <Esc> hit o open and put text in a new line below current line, until <Esc> hit O open and put text in a new line above current line, until <Esc> hit Changing Text The following commands allow you to modify text. r replace single character under cursor (no <Esc> needed) R replace characters, starting with current cursor position, until <Esc> hit cw change the current word with new text, starting with the character under cursor, until <Esc> hit cNw change N words beginning with character under cursor, until <Esc> hit; e.g., c5w changes 5 words C change (replace) the characters in the current line, until <Esc> hit cc change (replace) the entire current line, stopping when <Esc> is hit Ncc or cNc change (replace) the next N lines, starting with the current line, stopping when <Esc> is hit
(Manipulating Files) Wildcard [[:upper:]]* returns what output?
[[:upper:]]* Any filename that begins with an uppercase letter. This is an example of a character class.
(Manipulating Files) Wildcard [abc]* returns what output?
[abc]* Any filename that begins with "a" or "b" or "c" followed by any other characters
What Is "The Shell"?: How to use the history (the basics)
access command history by pressing up-arrow key - to escape press down-arrow
Other man pages: How to create a group
adduser, addgroup - add a user or group to the system
The basic Emacs commands: Undo
all commands work for undo: C-_ C-/ C-x u
What does Ubuntu mean
an ancient African word meaning "humanity to others" - it also means "I am what I am because of who we all are"
What is a zero-day
an undisclosed computer-software vulnerability that hackers can exploit to adversely affect computer programs, data, addtional computers or a network - basically it's a sudden attack
(Manipulating Files) Wildcard b*.txt returns what output?
b*.txt All filenames that begin with the character "b" and end with the characters ".txt"
Navigation: What does the command cd - do
cd - changes the working directory to the previous one
Permissions: What do the commands chmod, sudo, su, chown, chgrp do
chmod - modify file access rights su - temporarily become the superuser sudo - temporarily become the superuser chown - change file ownership chgrp - change a file's group ownership
Looking Around: How do you use options and arguments with commands
commands operate like this: command -options arguments command is the name of the command -options is one or more adjustments to the command's behavior arguments is one or more "things" upon which the command operates
Manipulating Files: What do the commands cp, mv, rm, mkdir do
cp - copy files and directories mv - move or rename files and directories rm - remove files and directories mkdir - create directories
How to work as collaborators on a project
easy way - through the website - click on the settings tab of your rep, then collaborators on the left sidebar - then add the username of people you want to collab with
Navigation: What are the characteristic of hidden files and how to list them
filenames that begin with a period character are hidden - do not appear unless command ls -a is used
(Shell, I/O Redirection) What does the command find do
find - search for files in a directory hierarchy http://linuxcommand.org/lc3_man_pages/find1.html
How to use VMs with Vagrant
first - install vagrant and virtual box open Vagrantfile in text editor and edit base to reflect VM box - in our case ubuntu/trusty64 then type: vagrant init ubuntu/trusty64 then type: vagrant up
(Manipulating Files) Wildcard g* returns what output?
g* All filenames that begin with the character "g"
How to create a branch
git checkout -b [name_of_your_new_branch] the -b option is telling git that what follows is the name of the branch you are creating
How to merge branches
git checkout master #first make sure you're in the branch you want to merge into git merge branch_name #then merge your branch into master
How to commit
git commit -m "some type of commit message"
How to pull updates
git pull master origin
How to push code
git push
What is GitHub?
github is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) funcitonality of Git as well as adding its own features manages your shit and collaborate on projects
How to create a repository
go to github website, create a repo by clicking the plus sign at the top of screen - fill in the name and click green button - do not initialize with a README then select code that shows up from the "...or create a new repo on the command line" section and copy! then, in your terminal - create a directory that will contain your code and cd into it then paste the block of coe you copied earlier and hit <enter> it should prompt you for your username and passworde from: https://intranet.hbtn.io/concepts/57
(Shell, I/O Redirection) What does the command head do
head - output the first part of files - Print the first 10 lines of each FILE to standard output. http://linuxcommand.org/lc3_man_pages/head1.html
A Guided Tour: What is a symbolic link
http://linuxcommand.org/lc3_lts0040.php type of file that points to another file - provides text of an "actual" file name, not the file data itself type of file that points to data of another file - multiple files can point to the same hard data
Other: What is a Shebang
https://en.wikipedia.org/wiki/Shebang_(Unix) In computing, a shebang is the character sequence consisting of the characters number sign and exclamation mark (#!) at the beginning of a script.
Who is Bill Joy
https://www.cs.colostate.edu/helpdocs/vi.html Joy co-founded Sun Microsystems in 1982 along with Vinod Khosla, Scott McNealy and Andreas von Bechtolsheim, and served as chief scientist at the company until 2003. He played an integral role in the early development of BSD UNIX while a graduate student at Berkeley, and he is the original author of the vi text editor.
Who is Richard Stallman
inventor of emacs, created for the GNU project - often known by initials rms, an american software freedom activist and programmer - launched the GNU project
Looking Around: What do the commands ls, less, file do
ls lists the contents of a directory less lets you view text files file examines a file and tells you what kind of file it is
The basic Emacs commands: Opening and saving files
opening emacs: emacs filename saving: *C-x C-s*
Navigation: What do the commands or built-ins cd, pwd, ls do
pwd (print working directory) - to find the name of the working directory cd (change directory) - to navigate to another directory type cd followed by pathname of the desired working directory ls (list files and directories) - to list the files in the working directory
What does the command uname do
returns user name
(Shell, I/O Redirection) What does the command sort do
sort - sort lines of text files - write sorted concatenation of all FILE(s) to standard output -
Permissions: How to change user ID or become superuser
su - Run A Shell With Substitute User And Group IDs The su command is used to start a shell as another user. The command syntax looks like this: su [-[l]] [user] If the "-l" option is included, the resulting shell session is a login shell for the specified user. This means that the user's environment is loaded and the working directory is changed to the user's home directory. This is usually what we want. If the user is not specified, the superuser is assumed. Notice that (strangely) the "-l" may be abbreviated "-", which is how it is most often used. To start a shell for the superuser, we would do this: [me@linuxbox ~]$ su - Password: [root@linuxbox ~]# After entering the command, we are prompted for the superuser's password. If it is successfully entered, a new shell prompt appears indicating that this shell has superuser privileges (the trailing "#" rather than a "$") and the current working directory is now the home directory for the superuser (normally /root). Once in the new shell, we can carry out commands as the superuser. When finished, enter "exit" to return to the previous shell: [root@linuxbox ~]# exit [me@linuxbox ~]$ http://manpages.ubuntu.com/manpages/zesty/man1/chown.1.html
(Shell, I/O Redirection) What does the command tail do
tail - output the last part of files - print the last 10 lines of each FILE to standard output http://linuxcommand.org/lc3_man_pages/tail1.html
What Is "The Shell"?: What is the difference between a terminal and a shell
terminal is a program called terminal emulator - it is a program that opens a window, letting you interact with the shell
Navigation: What is the difference between the root directory and the home directory of the user root
the home directory is located within the root directory
What is the shell
the shell is a program that takes commands from the keyboard and gives them to the operating system to perform
Navigation: What is the root directory
to navigate to root cd /
Navigation: What is the working directory, how to print it and how to change it
to print - type pwd command to change - type cd command the first directory in the file system
The basic vi commands: How to start and exit vi
to start: vi filename to exit: :q<Return>
The basic vi commands: What are the command and insert modes, and how to switch from one to the other
to type - i insert text before cursor, until <esc> hit to command - press <esc> Inserting or Adding Text
Working With Commands: What do type, which, help, man commands do
type - Display information about command type which - Locate a command help - Display reference page for shell builtin man - Display an on-line command reference
Navigation: How to navigate the filesystem
type cd then desired pathname
The basic vi commands: Undo
u
(Shell, I/O Redirection) What does the command uniq do
uniq - report or omit repeated lines - filter adjacent matching lines from INPUT (or standard input) writing to OUTPUT (or standard output) with no options, matching lines are merged to the first occurence.
Other man pages: How to create a user
useradd - Create a new user or update default new user information for more on options: http://linuxcommand.org/man_pages/useradd8.html
What is vagrant
vagrant is a tool for building complete development environments - streamlines your workflow and helps automate your virtual machine
What is Git
version control system for tracking changes in computer files and coordinating work on those files among multiple people
(Shell, I/O Redirection) What does the command wc do
wc - print newline, word, and byte counts for each file and a total line if more than one FILE is specified -- with no FILE, or when FILE is -, read standard input http://linuxcommand.org/lc3_man_pages/wc1.html
What Is "The Shell"?: What is the shell prompt
what you see when you open a terminal window - shell prompt contains your user name and name of the machine followed by a dollar sign [me@linuxbox me]$
Navigation: What is the home directory, and how to go there
when you first log on to a linux system, working directory is set to home directory - this is where files are saved - on most systems, home dir is called /home/your_user_name to navigate to home dir, type in cd followed by nothing
A Guided Tour: What does the ln command do
whenever the system is given a file name that is a symbolic link, it transparently maps it to the file it is pointing to