Subscribe to
Posts [Atom]


Unix Commands

Monday, May 12, 2008



ifconfig -- allows the user to view information about the configured network interface.
uname -a -- to view Operating System Information
jar -tvf foo.jar -- view the contents of a jar file
to find the users on a server: go to cd etc/passwd press more to see more.

to find a directory or file find . -name "tomcat" -print
To ssh into a machine you type: ssh machineaddress
To get to a directory you type: cd then the folder below root
To run tomcat you type: cd /Applications/tomcat55/bin/
To start tomcat type: ./startup.sh
To copy a file to your local machine(in a clean terminal window): scp user@localhost:/directory/foo.zip .
Which is: scp user@machine:/directory local directory
To show and hide hidden folders: defaults write com.apple.finder AppleShowAllFiles TRUE
To force the kill of a tomcat process: ps ef|grep tomcat
Then kill the individual process: kill -9 816 1017
816 and 1017 are the process id’s
to see all process ps –ef
to run two programs in parallel use the | (pipe)
to go back a directory type: cd ..
October 30, 2007
To run a console with a running display: tail -f catalina.out
For example: tail -f file.txt in the directory of the file.txt
To get back to root directory you can type: cd
To see some of a file you can type: more filname.txt
To find all lines with phrase you can type: grep phrase file.txt
To show line numbers in grep type: grep –n phrase file.txt
To show a file you can type : cat filename when in that directory: cat file.txt
Show the date: $ date
show the current logged in users: $ who
show the user you are logged in as: $ who am i
see detail about a certain directory ls -l filename
show everything and hidden file names ls -a
show all executable files ls -f
list directory and subdirectories ls -R
see one terminal full of a file: less
show file and position in file: less -M
help: h
change password: passwd
move files to a server: sftp user@server
then: put file.txt

chmod:
user access: u
group access: g
other access: o
read: r
write: w
execute: x
add permission to entire directory contents: *
(in order to access a directory parent directories must have execute permission all the way to root)


Control Characters
cancel a command: ctrl c
delete a character: ctrl h
erase whole input line: ctrl u
pause screen output: ctrl s
restart output: ctrl q
signal end of input for certain applications or logout: ctrl d

x windows
calculator: xcalc &
new terminal window: xterm &

Popular Greps
lsof | grep TCP will show you all your TCP connections

Labels:


0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home