• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/38

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

38 Cards in this Set

  • Front
  • Back
>
-$ cat oceans.txt > continents.txt

-> takes the standard output of the command on the left, and redirects it to the file on the right.


-standard output, abbreviated as stdout, is the information outputted after a process is run.

>>
-$ cat glaciers.txt >> rivers.txt

->> takes the standard output of the command on the left and appends (adds) it to the file on the right.


-standard output, abbreviated as stdout, is the information outputted after a process is run.

<
-$ cat < lakes.txt-< takes the standard input from the file on the right and inputs it into the program on the left.

-standard output, abbreviated as stdout, is the information outputted after a process is run.

|
-$ cat volcanoes.txt | wc-| is a "pipe". The | takes the standard output of the command on the left, and pipes it as standard input to the command on the right.

-You can think of this as "command to command" redirection.

~/.bash_profile
-$ nano ~/.bash_profile

-~/.bash_profile is the name of file used to store environment settings. It is commonly called the "bash profile". When a session starts, it will load the contents of the bash profile before executing commands.

alias
-alias pd="pwd"

-The alias command allows you to create keyboard shortcuts, or aliases, for commonly used commands.

cd
-cd Desktop/

-cd takes a directory name as an argument, and switches into that directory.


-To navigate directly to a directory, use cd with the directory's path as an argument. Here, cd jan/memory/ command navigates directly to the jan/memory directory.


-$ cd jan/memory

cd ..
-$ cd ..

-To move up one directory, use cd ..


-Here, cd .. navigates up from jan/memory/ to jan/.

cp
-$ cp frida.txt historical/

-cp copies files or directories. Here, we copy the file lincoln.txt and place it in thehistorical/ directory

Wildcards
-$ cp * satire/

-The wildcard * selects in the working directory, so here we use cp to copy all files into the satire/ directory.




-$ cp m*.txt scifi/


-Here, m*.txt selects all files in the working directory starting with "m" and ending with ".txt", and copies them to scifi/.

env
-The env command stands for "environment", and returns a list of the environment variables for the current user.
export
-export USER="Jane Doe"

-export makes the variable to be available to all child sessions initiated from the session you are in. This is a way to make the variable persist across programs.

grep
-$ grep Mount mountains.txt

-grep stands for "global regular expression print".


-It searches files for lines that match a pattern and returns the results. It is case sensitive.

grep -i
-$ grep

-i Mount mountains.txt-grep -i enables the command to be case insensitive.

grep -R
-$ grep

-R Arctic /home/ccuser/workspace/geography-grep


-R searches all files in a directory and outputs filenames and lines containing matched results.


-R stands for "recursive".

grep -Rl
-$ grep -Rl Arctic /home/ccuser/workspace/geography

-grep -Rl searches all files in a directory and outputs only filenames with matched results.


-R stands for "recursive" and l stands for "files with matches".

HOME
-$ echo $HOME

-The HOME variable is an environment variable that displays the path of the home directory.

ls
-$ ls

-ls lists all files and directories in the working directory

ls -a
-ls -a

-lists all contents in the working directory, including hidden files and directories


-options (like -a, -l, -t) can be combined together


-a is called an option. Options modify the behavior of commands, for example using -a will show hidden files and directories (which start with a .)

ls -l
-ls -l

-lists all contents of a directory in long format.


-options (like -a, -l, -t) can be combined together


-here are what the columns mean:


1. Access rights. These are actions that are permitted on a file or directory.


2. Number of hard links. This number counts the number of child directories and files. This number includes the parent directory link (..) and current directory link (.).


3. The username of the file's owner. Here the username is cc.


4. The name of the group that owns the file. Here the group name is eng.


5. The size of the file in bytes.


6. The date & time that the file was last modified.


7. The name of the file or directory.

ls -t
-ls -t orders files and directories by the time they were last modified.

-options (like -a, -l, -t) can be combined together

mkdir
-$ mkdir media

-mkdir takes in a directory name as an argument, and then creates a new directory in the current working directory. Here we used mkdir to create a new directory named media/.

mv
-$ mv superman.txt superhero/

-To move a file into a directory, use mv with the source file as the first argument and the destination directory as the second argument. Here we move superman.txt into superhero/.

nano
-$ nano hello.txt

-nano is a command line text editor. It works just like a desktop text editor like TextEdit or Notepad, except that it is accessible from the the command line and only accepts keyboard input.

PATH
-$ echo $PATH-/home/ccuser/.gem/ruby/2.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin

-PATH is an environment variable that stores a list of directories separated by a colon.


-Each directory contains scripts for the command line to execute. (series of commands for computer to execute)


-PATH lists which directories contain scripts.

pwd
-pwd prints the name of the working directory
rm
-$ rm waterboy.txt

-rm deletes files. Here we remove the file waterboy.txt from the file system.

rm -r
-$ rm -r comedy

-rm -r deletes a directory and all of its child directories.

sed
-$ sed 's/snow/rain/' forests.txt

-sed stands for "stream editor". It accepts standard input and modifies it based on an expression, before displaying it as output data.


-In the expression 's/snow/rain/':


-s: stands for "substitution".


-snow: the search string, the text to find.


-rain: the replacement string, the text to add in place.

sort
-$ sort lakes.txt

-sort takes the standard input and orders it alphabetically for the standard output.


-standard input, abbreviated as stdin, is information inputted into the terminal through the keyboard or input device.

standard error
-standard error, abbreviated as stderr, is an error message outputted by a failed process.
source
-source ~/.bash_profile

-source activates the changes in ~/.bash_profile for the current session.


-Instead of closing the terminal and needing to start a new session, source makes the changes available right away in the session we are in.

standard input
-standard input, abbreviated as stdin, is information inputted into the terminal through the keyboard or input device.
standard output
-standard output, abbreviated as stdout, is the information outputted after a process is run.
touch
-$ touch data.txt

-touch creates a new file inside the working directory. It takes in a file name as an argument, and then creates a new empty file in the current working directory.


-Here we used touch to create a new file named keyboard.txt inside the 2014/dec/ directory.


-If the file exists, touch is used to update the modification time of the file

env | grep VARIABLE

-env | grep PATH


-env | grep PATH is a command that displays the value of a single environment variable.

environment variables

Environment variables hold values related to the current environment, like the Operating System or user sessions.




One of the most well-known is called PATH on Windows, Linux and Mac OS X. It specifies the directories in which executable programs* are located on the machine that can be started without knowing and typing the whole path to the file on the command line.

sort

-$ sort lakes.txtsort takes the standard input and orders it alphabetically for the standard output.


-standard output, abbreviated as stdout, is the information outputted after a process is run.