su root
useradd foo
pass foo
# Add user to the sudoers group
usermod -aG wheel foo
su - foo
whoami
# apt is a frontend to dpkg
dpkg --list {name}
dpkg --remove {name}
apt remove {name}
cat /etc/passwd | grep foo
echo $0
*
: any string of none or more characters?
: single character[]
: any of the characters inside the brackets>
: Output redirection.>>
: Output redirection – append.<
: Input redirection.<<
: Input redirection.*
: File substitution wildcard (explained previously).?
: File substitution wildcard (explained previously).[ ]
: File substitution wildcard (explained previously).|
: Pipe for using multiple commands.;
: Command execution sequence.( )
: Group of commands in the execution sequence.||
: Conditional execution (OR).&&
: Conditional execution (AND).&
: Run a command in the background.#
: Use a command directly in the shell.$
: Variable value expansion.\
: The escape character.cmd
: Command substitution.$(cmd)
: Command substitution.ls -l /etc/ | less
touch myfile-1
touch myfile-2
# brace expansion
rm ~/{myfile-1, myfile-2}
~/.bash_profile
or ~/.bashrc
printenv | grep PATH
echo $PATH
# Soft Link
# ln -s [original_filename] [link_filename]
touch a.txt
ln -s a.txt b.txt
echo "aaa" >> a.txt
cat a.txt
cat b.txt
# return the name of the file the symbolic link points to
readlink b.txt
# Hard Link
# different virtual file that points to the original file
# they are physically the same
touch a.txt
ln a.txt b.txt
echo "aaa" >> a.txt
cat a.txt
cat b.txt
readlink b.txt
# more detailed info-name,size,type
stat a.txt
# report type of a file
file a.txt
less
print one page and allows navigationhead
print first 10 linestail
print last 10 lines
-f
output appends as the file grows