Electronic Engineers's Notebook


UNIX Commands

VI Commands

C odds and ends

ASCII Table

Network debugging


UNIX Commands

A few basic commands for the occasional UNIX user.

ls -al List all files in detail
more filename Type a file without it heading for the ceiling
cp from_file to_file
rm filename Delete
mkdir Create a directory
rmdir Get rid of it again
chmod o+rw file Give others read write access (u user, g group, x execute)
whoami Display own id
echo $SHELL Display the current shell
set Display all environment variables (Bourne)
Display all shell variables (C shell)
setenv Display all environment variables (C shell)

VI Commands

Some people swear by this editor. Most I suspect swear at it but least you know its there.

i Insert at cursor
a Append after cursor
ESC Get out of inset/append and back to command mode
x Delete current character
p Put back most recently deleted text
u undo
:wq Save the file and get out of here

C

printf() Format Control
%<flag><field><.precision><size prefix><conversion char>

flag
- Left justify
+ Print sign
<space> Force blank
# Force 0 (0x with o, x, X and . with floats)
0 Pad with zeros

field - minimum no. of characters to be printed
precision - specifies no. of fraction characters
prefix
h Short (integers only)
l long (integers), double (floats)
L Long double (floats)
conversion characters
d, i, u Integer
o Octal integer
x, X Hexadecimal integer
f Floating-point number
e, E Exponential notation
g, G Shorter of f, e or E
c Character
s String
p void *
n int *
% % - prints a % sign!

ASCII

X

0Xh

1Xh

2Xh

3Xh

4Xh

5Xh

6Xh

7Xh

0h

NUL

DLE

SP

0

@

P

`

p

1h

SOH

DC1

!

1

A

Q

a

q

2h

STX

DC2

"

2

B

R

b

r

3h

ETX

DC3

#

3

C

S

c

s

4h

EOT

DC4

$

4

D

T

d

t

5h

ENQ

NAK

%

5

E

U

e

u

6h

ACK

SYN

&

6

F

V

f

v

7h

BEL

ETB

'

7

G

W

g

w

8h

BS

CAN

(

8

H

X

h

x

9h

HT

EM

)

9

I

Y

I

y

Ah

LF

SUB

*

:

J

Z

j

z

Bh

VT

ESC

+

;

K

[

k

{

Ch

FF

FS

,

<

L

\

l

|

Dh

CR

GS

-

=

M

]

m

}

Eh

SO

RS

.

>

N

^

n

~

Fh

SI

US

/

?

O

_

o

DEL

What do the abbreviations mean?

00h NUL null 10h DLE data link escape
01h SOH start of heading 11h DC1 direct control 1

02h STX start text

12h DC2 direct control 2

03h ETX end text

13h DC3 direct control 3

04h EOT end of transmission

14h DC4 direct control 4

05h ENQ enquiry

15h NAK negative acknowledge

06h ACK acknowledge

16h SYN synchronous idle

07h BEL bell

17h ETB end transmission block

08h BS backspace

18h CAN cancel

09h HT horizontal tab

19h EM end of medium

0Ah LF line feed

1Ah SUB substitute

0Bh VT vertical tab

1Bh ESC escape

0Ch FF form feed

1Ch FS form separator

0Dh CR carriage return

1Dh GS group separator

0Eh SO shift out

1Eh RS record separator

0Fh SI shift in

1Fh US unit separator

20h SP space

7Fh DEL delete

Networking Commands

A few basic commands for trying to debug a network (Windows).

ipconfig /all See assigned address information
ping address Are you there?
tracert address How are we connected?
nslookup address Resolves DNS names to IP addresses and vice versa


Top

Home


Last updated August 23, 2004
© 2004 Michael Wells