# list all files ending with either pdf or md
ls {*.pdf,*.md}
# match every file starting with i, then a pattern zero or more times
# followed by an m
ls i?(nter)m*Anything TCP, UDP and sockets related. Connects and listens.
# Look at the manual
man ncCreate a connection between your two terminals Terminal 1
# nc -l <port>
nc -l 8743Terminal 2
# nc <your ip> <port specified in terminal 1>
nc 123.123.123.123 8743
# Write anything and see it shown in Terminal 1# show listening sockets and guessing the use of the socket
ss -tl
# show listening sockets without guessing the use of the socket
ss -tlnSet user identification (SUID) allow a user to run a program as some other user (like root).
# creating folders there is only allowed by the root user
mkdir '/srv/newfolder'
mkdir 'removabletestfolder'
cd 'removabletestfolder'
# create a program which does it
cat << EOF > 'mytestprogram.sh'
mkdir '/srv/newfolder'
EOF
# 'mytestprogram.sh' file is there, owned by the current user
ls -l
# change ownership of the program to root user and root group
sudo chown root:root 'mytestprogram.sh'# 'mytestprogram.sh' file is there, owned by the root user
ls -l
sudo chmod u+x,g+x,o+x 'mytestprogram.sh'
# change file mode bits
sudo chmod u+s 'mytestprogram.sh'# should run :), but currently doesn't
bash 'mytestprogram.sh'!$ brings back the last argument of the previous command.
# echo prints all arguments (separated by space)
echo 1 2 3 # output: 1 2 3
echo !$ # output: 3
# even though space separates arguments, it's still inserted
echo 1 "2 3" # output: 1 2 3
echo !$ # output: 2 3
echo 1 2 3"4 5" # output: 1 2 34 5
echo !$ # output: 34 5Basic Calculator
echo "1+1" | bclet "x=1+1"
echo $x