pushd User/Documents
# do stuff
popd
# we're back to the directory we started in
pwd
# display paht of current working directory
cat package.json
# display the content of file(s)
tac package.json
# cat backwards (starting from the end)
less package.json
# page through text one screenful at a time
tail package.json
# output the last part of file (10 lines by default)
head package.json
# display first 10 lines of file content
cat .env | pbcopy
# copy file content to clipboard
wc -c file.txt # prints the number of characters in file.txt
$ 442 file.txt
wc -w file.txt # prints the number of words in file.txt
$ 142 file.txt
wc -l file.txt # prints the number of lines in file.txt
$ 42 file.txt
cat file.txt | wc -l # prints only the number of lines in file.txt
$ 42
find ./Documents -name "files.*"
find ./Documents -name "files.*"
history | grep webpack
# grep your bash history to quickly find instances with webpack
install package
# after the above execution type
sudo !!
# will become:
sudo install package
ls | nl
# List information about files and prepend line number
cp -a /source/. /dest/
# copy source directory to dest
mv apple orange.doc
# rename the file apple as orange.doc
mv orange.doc ~/Documents/orange.doc
# move orange.doc to the Documents folder
du -sh *
# list files and folders with their sizes
printenv
# List the names and values of all environment variables
env
# Display, set, or remove environment variables, Run a command in a modified environment.
w
# Display who is logged in and what they are doing.
# Display IP address you can access from diferent devices in development mode