Using Linux: EE 599-006: Real-Time Digital Systems Fall 2006
Using Linux: EE 599-006: Real-Time Digital Systems Fall 2006
• mkdir dir
• rmdir dir
• Use <tab> for file completion
• !! # do the last command
• <up arrow>, <down arrow>
File Name Globbing
• ‘*’ matches any string
• ‘?’ matches any one character
• “[adf-m]” matches ‘a’, ‘d’, and any char. ‘f’ - ‘m’
• Examples:
- ls *.h
- ls foo.?
- ls [g-t]*.c
File Viewing/Searching
• GUI
• vi
• emacs
• pico
Code Development
• Text editor
• gcc opts file1.c file2.c
• make [ target ]
• man subject
GCC Example
#include <stdio.h>
int main(int argc, char *argv[]) {
printf(“Hello, world\n”);
return 0;
}
• gcc -Wall -O2 -o hello hello.c
• ./hello
Makefiles
CCFLAGS= -O2 -Wall
all: hello hello2
hello: hello.c
gcc -O2 -Wall -o hello hello.c
hello2: hello2a.o hello2b.o
gcc ${CCFLAGS} -o hello2 hello2a.o hello2b.o
Network Access
• Remote access
- ssh host
- scp user1@host1:path1 user2@host2:path2
• Windows interface
- Putty
- WinSCP
Redirecting stdin and
stdout
• Redirect stdout with ">" or ">>"
• Redirect stdin with "<"
• Redirect stdout of prog1 to stdin of prog2
with "prog1 | prog2"
• find . -name “*.h” -print | egrep “hello”