Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
123unix Cheat Sheet

123unix Cheat Sheet

Ratings: (0)|Views: 11|Likes:
Published by Sravan Arella

More info:

Published by: Sravan Arella on Jun 08, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less





du -skdu -kIMP UNIX COMMANDS USED IN WEBSPERE1.ls -ltrlist current directoryls -lato show all files and directory including ones starting with . eg: . and .. and .ssh and .profile etc.ls -ltr /bin/usr grep "nav$"to search the files in 'usr' directory of ending with 'nav'2.uname -ashows the OS for Solarisoslevel -rshows the OS for AIX3.df -kshows the (file system)partition spacedf -khto show in GB of partition space (h options notavailable on all systems)4.du -k sort -nto show tree structure directory --- (total space & Avaialable) WRONGdf -k /tmp to know the spcae available in filesystem where/tmp directory resides.du -sk directory size5.netstat -andisplays the port & local address & foreign address statenetstat -an  grep 9091to search for 9091 port6.nslookupshows IP & hostname7.ps -eaf grep PIDshows the process ID by filtering8.find . -name myFileNamesearch file by name myFileName is current directory which is denoted by .9.find . -exec ls -lrtexecute the command (eg here ls -lrt) on the result of the previous command here (find . -> means all files and directories in current dir)find /  grep "log$"displays all files ends with 'log' in the wholesystem (need root authority)find /  grep "robert"displays all files which has 'robert' in its name in the whole system. (need root authority)10.ln -s lmsi2w_i2 lmsi2wsoft link -- first file (actual physical file)is linked to second file(just a pointer like a shortcut).11.hostnamedisplays the name of host(machine)12.touchchanges the file time stamp or creates a new file if it does not already exist13.rm -rrecursively remove directories & files14.chmod -R changes the permissions of the file recursively15.chown -Rchanges the owner(and group) of the file recursively16.cd - changes the directory to previous directory17.cd ~ or cd changes the home directory of the currently logged in user18.ssh - hostnameconnects to that particular host as the currently logged in userssh tempuser@hostnameconnects to that particular host as the user named tempuser19.kill -9 <PID>kills the particular process ID.20.kill -3<PID> to take (java) Thread dump.21.> <file name>to pass (redirect) the output to "file name" Ex:- #banner naveen >lnav22.cat /dev/null > fileto empty file23.sleep xwait "X" amount of seconds.24.& to run in back ground. Ex- #startnode.sh & (torun script in backgorund) or ^z after commnad runs25.bgcontinuous stopped job in the back ground26.fgconti...stopped job in the foreground.27.tar -cvf x.tar a b cCreate tar file x.tar consisting of files or dir
ectories a, b, c28.tar -xvf x.taruntar (unzip) tar file x.tar in current directory29.tar -tvf x.tarjust display contents of x.tar to screen withoutuntarring it30.java -versiondisplays the Java version (finds java from yourpath). if you want version of a specific java installation on you machine, go tothe directory where it is installed and issue ./java -version.31.compress, uncompresscompresses file having extension -- .z32.usersI dont think there is a command like this33.diff a bprints the lines that are different34.gzip <filename>compress the file.gzip -9 <filename>max compression but long time35.gunzip <filename>uncompress the file.36.more <filename>Displays file one page at a time.37.passwdallows you to change the password.38.wccounts the no of lines (-l) words (-w) and bytesor characters (-c) for each file39.whoshows who is logged in40.uptimeshows how long the system has been up.41.finger scottgives the full name of logged in user with username as scott42.tail filenameshows the last 10 lines of the file.43.tail -f filename -f shows the last 4 lines with process going lines means if more lines are written it will keep showing them. Control will not come back to command prompt. You have to hit Ctrl+C to get it back. Otherwise itwill keep waiting there and will list out the new lines as they are being written.tail -5 filenameshows last 5 lines.44.tail -50flast 50 lines + show running texthead -5shows the first 5 of the file.45.catto view the entire file.46.;to execute 'n' no of commands. ex:- ls -lrt ; pwd ----> list and path47.crontab -llist the crontab file which contains list of commands that you want to run on a regular schedule.crontab -eedit the above file48.ps -eaf grep <sysname> awk '{print $2}'to show PID onlyone excluding "grep PID" & show only PID no.49.ps -eaf  grep <sysname>  awk '{print $2}'  xargs kill -9 <pid>2 commands at once - show & kill.50.*/usr/ucb/ps -auxww grep java  grep -v grep(for solaris)/usr/ucb/ps -auxww  grep dmgrlsof -i:60040lists the connections of the port 6004051.less <filename>To see the contents of the file like MORE command. but is more useful than MORE. just type vi to enter vi mode.52.sudo53suswitch user to act as another user54.alias nav="ls"the alias ls given to nav,so when u enter nav itlists files.55.aliasto see all the alias names.56.unalias navto remove alias for nav.57..Present working directory58.id or whoamidisplays who am i loogged in as.59.$PWD/60 cd -goes to previous directory61.ssh <username>@boxnamelogin to another machine from current box.62.ftp <HOST IP>To login to another machine
63.ftp>!pwdto show the path in the local machine64.ftp>pwdto show the path of remote machine.64.scpto copy file from one box to another boxscp -pr root@ws02.akt.com:/apps/software/* <target>scp rrobert@ws02.akt.com:/tmp/software.tar . ---> secure copy64.echo $SHELLto check the shell name (bsh,csh,ksh)65.. .profileto run profile.66.export PS1='#'to change the prompt67grep -i ravi *to find lines in all files in current dir whichcontain string "ravi"find / -name <f.n>to find a file with its name in the dir / i.e inthe whole systemfind / grep *.tar or "tar$"history  grep grepshellexport PS1='nav'to change prompt to 'nav'envshow the environment variablesecho $PATHcd ../../bin to go to 2 directories back and entering into "bin" in thatifconfig -ato check the IP address of this hostsununame -a to see O/S & version.Aixoslevel -rto see the version of Aixgroupsto check the group of your user.groups wasadminto show the group of the user called wasadmintopsee the processor usage for top cpu consuming processesumaskfile mode creation mask - display it to screentelnet <H.N> or user@<H.N>SSH <H.N> or user@<H.N>nslookup www.yahoo.commkdir -p /tmp1/tmp2/tmp3 this creates dir tmp1 and dir tmp2 inside it and dir tmp3 inside it.which cddisplays which dir "cd" command is found in - inyour PATHwhich grepdisplays which dir "grep" command is found in -in your PATHwhich psdisplays which dir "ps" command is found in - inyour PATHenv shows the environment variablesls -lrt /usr/bin  grep "ps$"shows the files which ends with "ps"groupadd <wasadmin>useradd -g wasadmin -d /home/wasadmin -s /bin/bash -cusermod wasadmin nrobertto add existing user "nrobert" to "wasadmin" grouplast To show the users logged inprtconfSolaris system conflsof -i:portSee what process is listening on this port.echo $?to check exit status of previous commnad ******0 for success, 1 for failure, 2 for other or incompletepkginfoto view all installed packages (softwares)pkgaddto add / install packagespkgrmto remove /uninstall packagesSolpkginfo grep -i websphereto search for packages of websphere in solAixlslpp -al grep -i websphere to search for packages of websphere in Aixrm -r <Directory of F.n> To delete all files in directory recursivelyexport DISPLAY= to set the display path for the Xwindow of hummingburd

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->