0% found this document useful (0 votes)
53 views1 page

Comandos Unix en

This document provides instructions for common Linux shell commands, program compilation, debugging programs, and common errors. It lists commands for navigating and manipulating files and directories, running processes, comparing and sorting files. It also outlines how to compile C code with gcc and debug it using gdb or ddd, including setting breakpoints and viewing variables.

Uploaded by

André Perdigão
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views1 page

Comandos Unix en

This document provides instructions for common Linux shell commands, program compilation, debugging programs, and common errors. It lists commands for navigating and manipulating files and directories, running processes, comparing and sorting files. It also outlines how to compile C code with gcc and debug it using gdb or ddd, including setting breakpoints and viewing variables.

Uploaded by

André Perdigão
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Basic Shell commands

man {section} keyword ls {-a} {wildcard} pwd cd directory mkdir directory rmdir directory cp file1 file2 mv file1 file2 rm file cat file grep string file more file ps {-a} kill {-9} pid diff file1 file2 sort file who or w pico file vi file emacs file # Unix online manual # list directory contents # return working directory name # change directory # make directory # remove directory # copy file(s) # move file(s) # remove file(s) # concatenate and print files to stdout # print lines from a file that match a pattern # print files to stdout page by page # process status # terminate a process (by using -9) # compare two files # sort a file # display who is on the system # file editor # file editor # file editor

Operating Systems

Program compilation
gcc Wall file1.c file2.c (...) o executable (Note: Use compile options Wall . Solve every error and warning that is shown by the compiler. Do not ignore warnings, normally they result from poor and error-prone coding!)

Common errors verification


lclint file1.c file2.c (...)

Debugger
Compile using option g (debug information). Execute gdb ddd is the graphical interface for gdb gdb executable OR gdb --core=core ddd executable" Useful commands: o help o run {parameter1} {parameter2} {} o break {line} {function} o step o cont o display {var} o where o list {line} {function} o quit

# help # run a program # set a breakpoint in a line/function # advance one step in the program # continue execution # shows a variable value # shows where the crash occurred # show source code # close debugger

DEI-FCTUC

You might also like