Friday, 22 April 2011

Ubuntu/Linux Commands

A list of useful commands which i keep forgetting :

Misc
sudo su // Change user to root

Installers
sudo apt-get install build-essential // C++ support
sudo apt-get install freeglut3-dev // FreeGLUT and OpenGL support
sudo apt-get install avrdude // AVR firmware upload tool
sudo apt-get install gcc-avr // AVR atmel processors compiler
sudo apt-get install avr-libc // C lib for AVR atmel processors
sudo apt-get install xorg-dev // X11 headers and libraries
sudo apt-get install libpng-dev // PNG headers and libraries
sudo apt-get install libjpeg-dev // JPEG headers and libraries
sudo apt-get install libasound-dev // Alsa headers and libraries

Tools
top // Real-time list of processes
ps // Show running processes
chmod a+rwx fileorfolder -R // Change permissions of all files to read/write recursively
dmesg // Get drivers messages
dmesg | grep tty // Get serial ports drivers messages
lsusb // Get usb devices
tail -f /var/log/messages // Similar to dmesg | tail
otool -hv library.a // Get compiled objects architecture
du -k filename // Get file size
ldd filename // Get shared libraries dependencies
find . -iname '*c' | xargs grep 'foo' -sl // search C files for the string foo

Network

nslookup address // Get the IP address of a domain name
dig address // DNS servers interrogator
traceroute / tracert address // Show the path of a packet to a certain address
ping address // Check if address is reachable
lsof -i :port // Get process using this port
 

Last update 1:47 23/12/2011

No comments: