Linux Commad Quick Reference

Command Description
cd .. Move up one level to upper directory.
cd /root Move /root directory.
pwd Show working directory (your current position).
ls -lah Show all files and directory in working dir with format as list, all (show hidden files) and human readable size (eg. with Mb). I use it as general listing.
ls -ltr ls with order by date.
ls | wc -l Count files on a directory.
ls -lahS ls with order by file size.
df -h Check disk space.
du -hd 1 /root Check disk usage for every directories under /root directory. Useful for tracking disk space eater. Add | sort -h to sort the result.
wget -c -url- Use -c option to resume download.
grep -Rnw '/path/to/search' -e 'pattern' find in files, use --include=\*.{c,h} or --exclude=\*.o param to include or exclude spesific file extensions. Use --exclude-dir={dir1,dir2,*.dst} param to exclude dirs.

No comments:

Post a Comment