Pages

Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Tuesday, January 22, 2013

View the end of file in linux

tail -10 filename

This will show you last 10 lines of the file.

Tuesday, January 15, 2013

EC2 machine login ubuntu operating system

EC2 Machine if the operating system is Ubuntu then the user should be ubuntu.
Also change the permissions of the keyfile to chmod 400.

Courtesy: JK

Thursday, October 11, 2012

Create and Extract .bz2 and .gz files


#apt-get install bzip2
Installing bzip2 in ubuntu
sudo apt-get install bzip2
Uncompressing a bzip2 File Using bunzip2 in Debian
To uncompress a bzip2 file, execute the following command
#bunzip2 filename.txt.bz2 (where filename.txt.bz2 is the name of the file you wish to uncompress)

Friday, October 5, 2012

No output on nohup.out when running a python program in the background

Python when you run it as a background process, it keeps the buffers to itself and does not output anything to your nohup.out, I was stuck at this problem for hours until jk helped me! The solution is to just use python -u

Yup that's it!

So instead of nohup python filename.py & use nohup python -u filename.py &

Few more important commands:

Getting a list of processes  
ps -ax | grep python

Force kill a process
kill -9 processid