Command line stuff

Command line
cd -go back
mkdir -p './oneleve/{a,b,c}/{c,d}'Create folder hierarchy
rm -rf dirnameRemove dir with contents
find . -name testfile.txtFind a file called testfile.txt in current and sub-directories.
find /home -name *.jpgFind all .jpg files in the /home and sub-directories.
find . -type f -emptyFind an empty file within the current directory.
find /home -user exampleuser -mtime -7 -iname ".db"Find all .db files (ignoring text case) modified in the last 7 days by a user named exampleuser.
find . -name "*.bak" -deleteCareful!! To delete the files that end up matching your search, you can add -delete at the end of the expression. Do this only when you are positive the results will only match the files you wish to delete.
find . -type f -exec grep "example" '{}' \; -printThis searches every object in the current directory hierarchy (.) that is a file (-type f) and then runs the command grep “example” for every file that satisfies the conditions. The files that match are printed on the screen (-print). The curly braces ({}) are a placeholder for the find match results. The {} are enclosed in single quotes (’) to avoid handing grep a malformed file name. The -exec command is terminated with a semicolon (;), which should be escaped (;) to avoid interpretation by the shell.
Package mnagement

You probably have unused packages.

NPX depcheck scans your entire codebase for unuswed packages NPX depcheck --online is convenient to remove them with npm unistall [packages]


List rsa file connected to repo localy

ssh-add -L (<— or -l)

Add rsa to local repository

ssh-add -K ~/.ssh/id_skf

Generating a new ssh key (macos)§

Have multiple Git accounts

In ssh config

# Personal account, - the default config
Host github account
   User git
   IdentityFile ~/.ssh/id_ed25519

# Work account
Host workSKF github account
   User git
   IdentityFile ~/.ssh/id_skf

In global git config

 lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
 email =
 name = Nicolas Hervy
[includeIf "gitdir:~/Documents/SKF/"]
    path = ~/Documents/SKF/.gitconfig

In git config in local folder

 lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
 email =
 name = Nicolas Hervy

Then clone with git clone workSKF:skfccoe/rep-document-bundles.git


Get request with curl

curl <url>

Get headers

curl -v <url>

Have curl follow redirect

curl -L <url>