DEV Community

StuartCreed
StuartCreed

Posted on • Updated on

Unix Linux Cheatsheet

Memory and File System Storage differences
Memory (short term storage - mostly RAM) gets erased when you restart your computer. It is used for things like browsing the web. Where as File System storage (log term storage) stays stored when you restart your computer. An analogy is a desk top and the draw underneath. The desk top is for quick access to items, but is limited in space. The desk top is cleared at the end of the day. The draw underneath can hold more storage and does not get cleared out at the end of the day.

Commands
cd ~ or cd Takes you to home
grep -r “string” * Searches for a string within the folders of directories. -r makes it look in the subfolders
du -sh * Finds the size of every directory in your current directory.
df -h Finds the file storage space left on your machine (long term memory)
To view the free short term memory in readable format:
free -h
ls -lrt lists a directory in updated at order.
ls -lrt NAME* to do a wild card search
| pipe - allows you to pipe one command into another
ping computer-name find out IP address on the some LAN.
/bin holds all of the compilers you have installed such as csh, ksh and bash.
crontab -l to view a crontab
crontab -e to edit a crontab with your default editor
nano file to edit a file in the nano editor

Vi editor commands
vi filename edits or creates a file
i is insert mode
v is visual mode - which also allows you to delete characters
x is delete character and dd is delete line
Esc to exit a mode
:wq to write and quit a file
:q to quit a file

Use the instructions in the following link to see how to search for executable files:
https://kb.iu.edu/d/acec

Top comments (3)

Collapse
 
jethrojm profile image
Jethro Moller (He/Him)

I believe v is visual mode

Collapse
 
stuartcreed profile image
StuartCreed

Hi Jethro! Thanks for your comment :) Thanks for pointing that out, I didn’t notice that before :) I have edited the post to correct it.

Collapse
 
jethrojm profile image
Jethro Moller (He/Him)

You're welcome! :)