Skip to content

Fles/bash-for-frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Useful bash commands for frontend development

1. Navigation

pushd User/Documents
# do stuff
popd
# we're back to the directory we started in
pwd
# display paht of current working directory

2. Output

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

3. Search

find ./Documents -name "files.*"
find ./Documents -name "files.*"

4. History

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

5. Files

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

6. Variables

printenv
# List the names and values of all environment variables 
env
# Display, set, or remove environment variables, Run a command in a modified environment. 

7. Rest

w
# Display who is logged in and what they are doing. 
# Display IP address you can access from diferent devices in development mode 

About

Collection of bash commands for frontend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages