Common bash commands

typing this at the promptdoes this
tar -xvzf [fileName.tar.gz]
unzip a .tar file
standard would be ls and ls -l, but lsd and lsd -l is way better 🙂
list all files and folders in your working diretory with info on permissions
standard would be du -a -h --max-depth=1 | sort -hr, but dust is way better 🙂
lists all files and folders in your working directory sorted by size
standard would be du -sh *, but dust is way better 🙂
simpler version of the command above. lists all files in a folder and shows their file size
standard would be df -h, but duf is way better 🙂
view free/used disk space by drive
ls -l | wc -l
counts files in a directory
tree -d, but broot is way better 🙂
lists all files and folders in your working directory as a tree structure
lsblk
lists drives and their size (as well as used/free space on each)
pressing up arrow
recalls previous command
cd /
takes you to the root directory
cd ~
takes you to your home directory
cd ..
takes you up one level in your file directory
cd ../..
takes you up two levels in your file directory
chmod u+x [fileName]
edits permissions on file
chown [yourUserName] [fileName]
makes you the owner of a file
chgrp [yourUserName] [fileName]
assigns you as the group for the file
rm -rf [directoryName]
removes a folder and all of its contents
wget [URLtoFile]
downloads a file from a website
defaults write com.apple.finder AppleShowAllFiles YES
show all hidden files in the finder (Mac only)
pip freeze
lists all the python packages (and their versions) installed on the server
sudo nano /etc/profile
opens up the system profile where new program paths can be added to the system PATH
export PATH="/path/to/your/software/:$PATH"
add a new piece of software to the system PATH so it is executable from anywhere
alias something="something else"
add lines like this to your ~/.bash_profile to create a keyboard shortcut, in this case typing 'something' actually does 'something else'
progress or watch progress
displays the progress of file manipulation jobs (e.g. from cp, mv, etc)