cat -n notes.sh
echo "foo" > teste.txt
echo "foo" >> teste.txt
rmdir foo
rm -r foo
zip -r my_dir.zip my_dir
unzip -l my_dir.zip
unzip my_dir.zip
tar -cz my_dir > work.tar.gz # with output redirect
tar -czf work.tar.gz my_dir/ # without output redirect
tar -cjf work.tar.bz2 workspace/
tar -xz < work.tar.gz # with output redirect
tar -xzf work.tar.gz # without output redirect
tar -vxzf work.tar.gz # without output redirect and with verbose mode
date "+%d/%m/%y"
head foo.txt
head -n 3 foo.txt
tail -n 3 foo.txt
less foo.txt
i inserts in the current column
a inserts in the next column
A inserts in the end of the line
x deletes current character
5x deletes next 5 characters
5dd deletes 5 lines
G goes to last line
1G goes to first line
$ goes to line end
0 goes to line begin
/word + Enter
n goes to next result
N goes to previous result
yy copy line
3yy copy 3 lines
p paste
2p paste 2 times
# Show all processes
ps -e
# Stop proccess
kill 1234
# Kill proccess
kill -9 1234
# Search proccess
ps -ef | grep firefox
# Kill all processes by name
killall -9 firefox
# Show proccess by user
top -u anderson
# Show processess tree
pstree
# Run proccess in background (terminal unlocked)
firefox &
# Run proccess in foreground (terminal locked)
firefox
# Suspend proccess
ctrl + z
# Show jobs
jobs
# Send job to background (terminal unlocked)
bg 1
# Send job to foreground (terminal locked)
fg 1
# Add execution permission to all users and group
chmod +x file.sh
# Remove execution permission
chmod -x file.sh