To see where the shell will look for binaries to execute: echo $PATH
. You should see that the first entry is /home/yourADusername/bin
This means that anything you place in your ~/bin folder that is also executable will be executed.
Here are a few scripts that make working on turing quicker:
this script will run ps -aefl --forest .... every second
#!/bin/bash
while true
do
clear
ps -aefl --forest | grep -v myproc | grep --color -E $USER
sleep 1
done
To create the script:
- vim ~/bin/myproc
- paste above code, make sure to change
grep -v myproc
to reflect what your script is named - chmod u+x ~/bin/myproc
- run from command line by typing
myproc
#!/bin/bash
make clean
make
same create instructions as first, just have to run
mm
and with the changes in the Makefile that is all you should have to type for each build/execution
GCC = gcc
EXE = zombie
OBJ = zombie.o
SOURCE = zombie.c
default: $(EXE)
$(OBJ): $(SOURCE)
$(GCC) -c -o $@ $(SOURCE) -std=gnu99 -lrt
$(EXE): $(OBJ)
$(GCC) $(OBJ) -o $(EXE) -std=gnu99 -lrt
./$(EXE) &
clean:
rm -rf *.o $(EXE)
this makefile will start the compiled program in the background.. ./$(EXE) &
for the correntz one, just add a number for testing
I use vim, mainly because it has a c linter, see https://github.com/amix/vimrc for vim configuration files.
Or if you want to use your own editor on your computer, see if it has an SFTP client plugin that you can connect to turing with, so you can write code on your computer, it will reflect changes on turing, and you will just have to run make
from a PuTTY session.
Sublime Text: https://wbond.net/sublime_packages/sftp
This has been the best sftp plugin across multiple editors
You dont have to pay, but every like 6 saves it will prompt you to buy the full version