Shell cheatsheet

ยท

2 min read

Few commands I found very useful during development.

CommandDescription
man lsshow manual for command 'ls'
wc <file>words count
rm <file>remove/delete file
rm -i <file>remove/delete file (interactive, ask confirm)
rmdir <directory>remove/delete directory
rm -R <directory>remove/delete directory and subdirectory
rm -iR <directory>remove/delete directory (interactive)
cp <current location> <destination>copy files
chmod -R 755 <folder>add writing permission to folder
pwdpresent working directory / print working directory
cdchange directory
mkdirmake directory
lslist files
ls -llist files (long form)
ls -lahlist files (long form, all also hidden, human readable)
touch [filename]create file
chownchange owner
cat <file>show file
<cmd> > <file>direct the output of "cmd" into "file"
grep -rl "<text>" <dir>search for all files containing <text> inside <dir>
lnsymbolic link
aliasshow available alias on shell
cd -go to the previous current directory
ctrl + radvanced search (search any word in bash history)