Project Directory Prerequisites

echo "Using conditional statement to create a project directory and project"

# Variable section
export project_dir=$HOME/csp # change vscode to different name to test git clone
export project=$project_dir/sjavaproject  # change APCSP to name of project from git clone
export project_repo="https://github.com/saumyapalk23/saumyafastpages.git"  # change to project of choice

cd ~    # start in home directory

# Conditional block to make a project directory
if [ ! -d $project_dir ]
then 
    echo "Directory $project_dir does not exists... makinng directory $project_dir"
    mkdir -p $project_dir
fi
echo "Directory $project_dir exists." 

# Conditional block to git clone a project from project_repo
if [ ! -d $project ]
then
    echo "Directory $project does not exists... cloning $project_repo"
    cd $project_dir
    git clone $project_repo
    cd ~
fi
echo "Directory $project exists."
Using conditional statement to create a project directory and project
Directory /home/spalak06/csp exists.
Directory /home/spalak06/csp/sjavaproject does not exists... cloning https://github.com/saumyapalk23/saumyafastpages.git
fatal: destination path 'saumyafastpages' already exists and is not an empty directory.
Directory /home/spalak06/csp/sjavaproject exists.
echo "Navigate to project, then navigate to area wwhere files were cloned"
cd $project
pwd

echo ""
echo "list top level or root of files with project pulled from github"
ls

echo ""
echo "list again with hidden files pulled from github"
ls -a   # hidden files flag, many shell commands have flags

echo ""
echo "list all files in long format"
ls -al   # all files and long listing
Navigate to project, then navigate to area wwhere files were cloned
bash: cd: /home/spalak06/csp/sjavaproject: No such file or directory
/home/spalak06

list top level or root of files with project pulled from github
Anaconda3-2022.05-Linux-x86_64.sh    anaconda3  csp  lib              vscode
Anaconda3-2022.05-Linux-x86_64.sh.1  bin        etc  saumyafastpages

list again with hidden files pulled from github
.              .landscape                 .wget-hsts
..             .local                     Anaconda3-2022.05-Linux-x86_64.sh
.bash_history  .m2                        Anaconda3-2022.05-Linux-x86_64.sh.1
.bash_logout   .motd_shown                anaconda3
.bashrc        .node-gyp                  bin
.cache         .npm                       csp
.conda         .npmrc                     etc
.config        .profile                   lib
.gitconfig     .sts4                      saumyafastpages
.ipython       .sudo_as_admin_successful  vscode
.jupyter       .vscode-server

list all files in long format
total 1349352
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 15:37 .
drwxr-xr-x 1 root     root          4096 Aug 19 04:04 ..
-rw------- 1 spalak06 spalak06     19997 Aug 28 17:07 .bash_history
-rw-r--r-- 1 spalak06 spalak06       220 Aug 19 04:04 .bash_logout
-rw-r--r-- 1 spalak06 spalak06      4258 Aug 19 09:42 .bashrc
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 09:03 .cache
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 19 09:36 .conda
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 23 09:23 .config
-rw-r--r-- 1 spalak06 spalak06        49 Aug 19 08:41 .gitconfig
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 22 09:32 .ipython
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 20 00:49 .jupyter
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 19 04:05 .landscape
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 22 09:30 .local
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 23 08:48 .m2
-rw-r--r-- 1 spalak06 spalak06         0 Aug 28 12:27 .motd_shown
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 20 00:52 .node-gyp
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 09:03 .npm
-rw------- 1 spalak06 spalak06        22 Aug 21 22:05 .npmrc
-rw-r--r-- 1 spalak06 spalak06       807 Aug 19 04:04 .profile
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 23 08:49 .sts4
-rw-r--r-- 1 spalak06 spalak06         0 Aug 19 09:28 .sudo_as_admin_successful
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 19 04:12 .vscode-server
-rw-r--r-- 1 spalak06 spalak06       218 Aug 21 22:43 .wget-hsts
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh.1
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 09:23 anaconda3
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 22 08:38 bin
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 15:37 csp
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 etc
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 lib
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 17:57 saumyafastpages
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 08:54 vscode
echo "Look for posts"
export posts=$project/_posts  # _posts inside project
cd $posts  # this should exist per fastpages
pwd  # present working directory
ls -l  # list posts
Look for posts
bash: cd: /home/spalak06/csp/sjavaproject/_posts: No such file or directory
/home/spalak06
total 1349320
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh.1
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 09:23 anaconda3
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 22 08:38 bin
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 15:37 csp
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 etc
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 lib
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 17:57 saumyafastpages
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 08:54 vscode
echo "Look for notebooks"
export notebooks=$project/_notebooks  # _notebooks is inside project
cd $notebooks   # this should exist per fastpages
pwd  # present working directory
ls -l  # list notebooks
Look for notebooks
bash: cd: /home/spalak06/csp/sjavaproject/_notebooks: No such file or directory
/home/spalak06
total 1349320
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh.1
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 09:23 anaconda3
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 22 08:38 bin
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 15:37 csp
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 etc
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 lib
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 17:57 saumyafastpages
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 08:54 vscode
echo "Look for images in notebooks, print working directory, list files"
cd $notebooks/images  # this should exist per fastpages
pwd
ls -l
Look for images in notebooks, print working directory, list files
bash: cd: /home/spalak06/csp/sjavaproject/_notebooks/images: No such file or directory
/home/spalak06
total 1349320
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh.1
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 09:23 anaconda3
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 22 08:38 bin
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 15:37 csp
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 etc
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 lib
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 17:57 saumyafastpages
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 08:54 vscode

look inside markdown files

echo "Navigate to project, then navigate to area wwhere files were cloned"

cd $project
echo "show the contents of README.md"
echo ""

cat README.md  # show contents of file, in this case markdown
echo ""
echo "end of README.md"
Navigate to project, then navigate to area wwhere files were cloned
bash: cd: /home/spalak06/csp/sjavaproject: No such file or directory
show the contents of README.md

cat: README.md: No such file or directory

end of README.md

env, git, and github

  • key / value concepts
echo "Show the shell environment variables, key on left of equal value on right"
echo ""

env
cd $project

echo ""
echo "show the secrets of .git"
cd .git
ls -l

# echo ""
# echo "look at config file"
# cat _config.yml
Show the shell environment variables, key on left of equal value on right

SHELL=/bin/bash
PYTHONUNBUFFERED=1
project=/home/spalak06/csp/sjavaproject
CONDA_EXE=/home/spalak06/anaconda3/bin/conda
_CE_M=
WSL_DISTRO_NAME=Ubuntu
ELECTRON_RUN_AS_NODE=1
VSCODE_AMD_ENTRYPOINT=vs/workbench/api/node/extensionHostProcess
NAME=DESKTOP-2SM2O6U
PWD=/home/spalak06
LOGNAME=spalak06
CONDA_PREFIX=/home/spalak06/anaconda3
project_dir=/home/spalak06/csp
HOME=/home/spalak06
LANG=C.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
CONDA_PROMPT_MODIFIER=(base) 
PYDEVD_USE_FRAME_EVAL=NO
posts=/home/spalak06/csp/sjavaproject/_posts
LESSCLOSE=/usr/bin/lesspipe %s %s
VSCODE_HANDLES_SIGPIPE=true
TERM=xterm-256color
_CE_CONDA=
LESSOPEN=| /usr/bin/lesspipe %s
USER=spalak06
PYTHONIOENCODING=utf-8
notebooks=/home/spalak06/csp/sjavaproject/_notebooks
CONDA_SHLVL=1
SHLVL=1
PAGER=cat
project_repo=https://github.com/saumyapalk23/saumyafastpages.git
VSCODE_CWD=/mnt/c/Users/Saumya/AppData/Local/Programs/Microsoft VS Code
CONDA_PYTHON_EXE=/home/spalak06/anaconda3/bin/python
PS1=[PEXP\[\]ECT_PROMPT>
CONDA_DEFAULT_ENV=base
WSLENV=VSCODE_WSL_EXT_LOCATION/up
VSCODE_WSL_EXT_LOCATION=/mnt/c/Users/Saumya/.vscode/extensions/ms-vscode-remote.remote-wsl-0.66.3
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
PATH=/home/spalak06/.vscode-server/bin/e4503b30fc78200f846c62cf8091b76ff5547662/bin/remote-cli:/home/spalak06/.local/bin:/home/spalak06/bin:/home/spalak06/anaconda3/bin:/home/spalak06/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0:/mnt/c/WINDOWS/System32/OpenSSH:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/WiFi/bin:/mnt/c/Program Files/Common Files/Intel/WirelessCommon:/mnt/c/Program Files (x86)/IVI Foundation/VISA/WinNT/Bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/nodejs:/mnt/c/Users/Saumya/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Saumya/AppData/Roaming/npm:/mnt/c/Users/Saumya/AppData/Local/Programs/Microsoft VS Code/bin:/snap/bin
VSCODE_NLS_CONFIG={"locale":"en","availableLanguages":{}}
HOSTTYPE=x86_64
VSCODE_HANDLES_UNCAUGHT_ERRORS=true
OLDPWD=/home/spalak06/csp
VSCODE_IPC_HOOK_CLI=/tmp/vscode-ipc-d16986ec-0f10-4023-ace5-802f43f4288e.sock
_=/usr/bin/env
bash: cd: /home/spalak06/csp/sjavaproject: No such file or directory

show the secrets of .git
bash: cd: .git: No such file or directory
total 1349320
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh
-rw-r--r-- 1 spalak06 spalak06 690850711 May 10 11:35 Anaconda3-2022.05-Linux-x86_64.sh.1
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 09:23 anaconda3
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 22 08:38 bin
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 15:37 csp
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 etc
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 21 22:05 lib
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 28 17:57 saumyafastpages
drwxr-xr-x 1 spalak06 spalak06      4096 Aug 25 08:54 vscode