Unix Commands
how to use UNIX variants
doing su
(change to super user) is often helpful
If having to copy files over to server, sometimes need more access, so chown (regular id) (directory)
to give a long directory listing sorted by moddate: ls -l --sort=t
to find a file by name, start from the directory to start searching
-
find . -name "thread*"
- to find a directory add
-type "d"
- to find a directory add
to find files by contents
grep contentstofind *
to remove a non-empty directory rm -r (directory)
show length of file in lines: wc -l file
to show the contents of a file use cat
-
or
head -count file
ortail -count file
-
to copy file contents to MacOs X Clip Board:
cat file | pbcopy
to print matching lines from a file: grep -F "Aii" events.log
uncompressing:
-
use
gunzip
on a .tgz file -
tar xvf (filename)
for a .tar file
processes
-
ps -A
to see everything -
ps -C java
to see subset -
kill pid
to kill process with numberpid
-
ps auxww
to see lots of detail on specific apps running
disk utilization:
-
df -h
will tell you the basic availability on the machine -
"find -printf
%s %p\n
| sort -nr | head" - will tell you the 10 biggest space consumers
run things in a detached screen (which, among other things, keeps them running after you disconnect)
-
one variation:
screen -dmS sessionName commands
, then, to access its console while running:screen -r sessionName
-
or just
screen -S sessionName
, then type commands as usual, then when ready hitctl-a d
to detach
make
-
make
compiles (after fetching necessary pieces) -
make install
(aftermake
) installs (or instead ofmake
compiles, then installs)- can
make
, then tweak a file, then go straight tomake install
- can
-
http://www.zettai.net/Members/george/python213FreeBSDPlone.blog/view
-
http://mail.gnu.org/archive/html/gnustep-dev/2002-12/msg00032.html
-
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html
Edited: | Tweet this! | Search Twitter for discussion