Summary
A few useful commands that I don't want to forget.
bash/zsh
du
du -hsx * | sort -rh | head -n 10
recursively finds the largest files/directories in human readable format
find
find . -type f -mtime +30 -delete
delete all files in the current directory that are older than 30 daysfind [directory_location] -name "[search_string]" [-type [f,d]] [-exec something]
recursively find a file that matches a search_string- Ex:
find ~ -name "*.txt" -type f
finds all *.txt files (excludes directories) - Ex:
find ~ -name "*.txt" -type f -exec echo {} \;
echo's all *.txt files
- Ex:
grep
grep -r "search_string" .
recursively looks in the current directory for a search string
ls
ls -Slh
sort by size in long format, human readable
Invalid MIT-MAGIC-COOKIE-1
If you are receiving the following error: Invalid MIT-MAGIC-COOKIE-1 keyxterm Xt error: Can't open display: localhost:11.0
, follow the following diagnostic steps:
- Is your X11 Windows server running? (xQuarts)? If not, start it.
- You can tell something is wrong if you issue an
xauth list
on your local machine and nothing works. - Issue the following command:
xhost +local:
beforessh
-ing to the server.